#This Document will be continuously updated.

오픈 소스의 도움을 받아 만들었기에 공개 가능한 코드는 다음 github 에 모두 공개 합니다. 다른 포스트도 지우거나 해당 github의 소스로 모두 대체합니다.

https://github.com/hajunho/repo_hajunho.slack.com

 

GitHub - hajunho/repo_hajunho.slack.com: is able to use SWIFT, PYTHON, WEB programming language well.

is able to use SWIFT, PYTHON, WEB programming language well. - hajunho/repo_hajunho.slack.com

github.com

######################################

최근, 혼자 쏘캐너를 만들고 있었습니다. Android, iOS 둘 다 만들어서 마켓에 런칭한 이 후 Anil 이라는 좋은 인도 개발자를 만나서 안드로이드쪽은 떼 주고 이전에 정리했었던 기술도 어느 정도 통일이 되어 Swift + SwiftUI 로 최신 프로젝트를 하고 있습니다. 제가 기여한 오픈소스를 가져와서 프로그램을 만들기 때문에 회사 귀속으로 할 수도 없거니와(하려면 해당 오픈 소스들을 제 값주고 다 사야 하는데 아마 수천억 들겠죠) 제가 인터넷에서 받은 수 많은 지식들을 회사 귀속 코드를 제외하고 다 돌려 드리기 위해 이 카테고리를 만들었습니다. 어찌보면 광고의 목적도 있고, 함께 하고픈 사람도 계속 늘여 나가고 싶기도 하구요. IPO가 목적인데, 처음엔 일부 동의하는 사람이 있는 줄 알았는데 지금보니 저 혼자 IPO를 믿고 있는 것 같습니다. 아마 기술 분야로 해야 하고 마지막 그림은 저 외엔 보기 힘들다는 점도 ... 이걸 깨달아야 외롭지 않게 묵묵히 길을 갈 수 있겠지요. 이 블로그를 살아 움직입니다. 글이 써졌다가 고쳐졌다가 지워지기도 하구요. 아마 오랜 구독자는 이미 잘 알고 계시리라 생각합니다. 단, 거짓말은 하지 않는 다는 것을요. 순수한 마음으로 접근해도 평생을 바쳐도 모자란 것이 지식 탐구라는 것을 알면, 세속적 기준을 가져다 대는 것이 얼마나 우스운 일인지... 10대 때 알았던 사람은 저처럼 40대가 되어도 변함이 없다는 것을, 또 80대가 되어도 마찬가지라는 것을 알겁니다. 

 

 요즘은 거의 백엔드만 하고 있어서 사실 iOS도 적합한 개발자를 뽑으면 이 카테고리도 shutting down 하고 백엔드에만 집중하고 싶습니다. 그래도 iOS 개발이 10년이 넘어가다 보니 Xcode 단축키만 쳐도 뭔가 편안함이 느껴지는 터라.

취미로 개발을 하고,

취미로 개발을 해도 publishing 이 가능한 분야가 되었네요.

이에, 꾸준히 빌드업을 할테고 백엔드를 해서인지 다른 언어를 통해 Swift 를 보는 관점을 달리 해 보니 또 더 깊게 알게 되는 것 같아 좋아요. 지난 게시글이 있지만 #This Document continuously updated. 라는 문구가 있으면 지난 자료는 뒤로 보내거나 없애거나 수정을 하며 하나의 게시글을 계속 업데이트 하는 방식으로 진행하려고 합니다. 그래서 아무리 시간이 지나도(제가 죽을 때까지?) 한 카테고리 당 100개의 게시물을 넘지 않도록 하려고 해요. 제가 60계 치킨을 좋아하다보니 그 숫자를 60에 맞추려고 할지도 모르겠군요. 아무튼, 여러개를 올리는 것 보다 좀 더 농도 짙은 게시글로 하고 싶은 마음이 있습니다.  --> 테마를 바꾸어 보니 30개에 맞춰야 보기 편하겠네요.

 

테스트 계정 /2023/656b64010b5fed1db4fc7ae4

파일명 형식

20240402103818_03_2024_5088212684.jpg
2.09 MB image/jpeg 2024. 4. 2.

20240402103835_03_2024_5088212684.jpg
2.42 MB image/jpeg 2024. 4. 2.

20240402103848_03_2024_5088212684.jpg
2.03 MB image/jpeg 2024. 4. 2.

20240402103901_03_2024_5088212684.jpg
1.87 MB image/jpeg 2024. 4. 2.

20240402103916_03_2024_5088212684.jpg
1.96 MB image/jpeg 2024. 4. 2.

20240402103929_03_2024_5088212684.jpg

733753835824_4_2024__656b64010b5fed1db4fc7ae4_거래처명:xx산부인과.jpg
2.04 MB image/jpeg 2024. 4. 2.

733754143865_4_2024__656b64010b5fed1db4fc7ae4_거래처명:xx산부인과.jpg

앱스토어 신규 필터.


App Store Connect
 
Hello,

We noticed one or more issues with a recent submission for App Store review for the following app:
---

---

---
Although submission for App Store review was successful, you may want to correct the following issues in your next submission for App Store review. Once you've corrected the issues, upload a new binary to App Store Connect.

ITMS-91053: Missing API declaration - Your app’s code in the “App” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryDiskSpace. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api.

ITMS-91053: Missing API declaration - Your app’s code in the “App” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryFileTimestamp. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api.

ITMS-91053: Missing API declaration - Your app’s code in the “App” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryUserDefaults. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api.

Apple Developer Relations

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

MSA 아키텍처 도입  (0) 2023.12.11
Apple developer program has been updated.  (0) 2021.06.08
game center icon  (0) 2021.06.04
Game Center transcript  (0) 2021.06.04
agreements  (0) 2021.05.29

[This Document will be continueously updated]

이제부터 모든 문서는 구글 드라이브로 이전...

https://docs.google.com/document/d/1JiIC0ByhhoWNN5J3YnnoIeIKB3MEMWd9BMZ48337uXQ/edit?usp=sharing

 

hjh_MSArchitecture

 

docs.google.com

 

 

==== 사족 ====

runBlocking, async, Combine, Task

Android - 

runBlocking과 async는 Kotlin의 코루틴을 사용하는 두 가지 다른 구문입니다. 각각의 목적과 사용 방법에 대해 알아보겠습니다.

  1. runBlocking:
    • 목적: runBlocking은 주로 비동기 코드를 동기적으로 실행하는 데 사용됩니다. 일반적으로 최상위 레벨에서 사용되는 것이 아니라, 테스트 코드나 메인 함수와 같이 코루틴이 루트 수준에서 시작되는 곳에서 사용됩니다.
    • 동작: runBlocking 블록 안에서의 모든 코루틴이 완료될 때까지 현재 스레드를 차단합니다. 따라서 일반적으로 메인 스레드에서 사용하는 것은 피해야 합니다.
    • 예시:
    •   
    • runBlocking { // 코루틴 코드 }
    • kotlinCopy code
  2. async:
    • 목적: async는 비동기적으로 작업을 수행하고 그 결과를 반환하는 데 사용됩니다. 여러 async 작업을 시작하면서 각 작업의 결과를 기다리는 데 유용합니다.
    • 동작: async는 비동기적으로 실행되며, await 함수를 통해 해당 작업이 완료될 때까지 대기할 수 있습니다.
    • 예시:
    • kotlinCopy code
      runBlocking { val result1 = async { // 비동기 작업 1 } val result2 = async { // 비동기 작업 2 } // result1.await()와 result2.await()를 사용하여 각 작업의 결과를 기다릴 수 있음 }
    • async는 주로 여러 작업을 동시에 시작하고 결과를 모아야 하는 경우에 사용됩니다. 비동기적으로 실행되기 때문에 여러 작업을 동시에 수행할 수 있습니다.

주의할 점은 runBlocking은 주로 테스트나 메인 함수와 같은 특정 상황에서만 사용되어야 하며, 메인 스레드에서의 사용은 피해야 합니다. 반면에 async는 비동기적인 작업을 수행하고 결과를 모을 때 주로 사용됩니다.

Swift에서 runBlocking 함수는 Kotlin의 runBlocking과는 다르게 내장된 함수로 제공되지 않습니다. 그러나 비슷한 기능을 구현하려면 Swift에서는 DispatchGroup을 사용하거나 async/await 패턴을 활용할 수 있습니다.

  1. DispatchGroup 사용:
    swiftCopy code
    import Foundation let dispatchGroup = DispatchGroup() dispatchGroup.enter() someAsyncFunction { // 비동기 작업 완료 시 호출 dispatchGroup.leave() } dispatchGroup.enter() anotherAsyncFunction { // 다른 비동기 작업 완료 시 호출 dispatchGroup.leave() } // 모든 비동기 작업이 완료될 때까지 기다림 dispatchGroup.wait() // 여기로 오면 모든 비동기 작업이 완료된 후
  2. DispatchGroup은 여러 비동기 작업이 완료될 때까지 기다리는 데 사용됩니다. 아래는 DispatchGroup을 사용하여 비동기 작업이 모두 완료될 때까지 기다리는 예제입니다.
  3. async/await 사용:
    swiftCopy code
    func someAsyncFunction() async { // 비동기 작업 수행 } func anotherAsyncFunction() async { // 다른 비동기 작업 수행 } // 비동기 작업이 모두 완료될 때까지 기다림 await Task.whenAll { await someAsyncFunction() await anotherAsyncFunction() } // 여기로 오면 모든 비동기 작업이 완료된 후
    이것은 async/await를 사용하여 비동기 작업이 완료될 때까지 기다리는 더 간결한 방법입니다.
  4. Swift 5.5부터는 async/await 패턴이 도입되었습니다. 이를 사용하면 비동기 코드를 더 간결하게 작성할 수 있습니다.

이러한 패턴은 Swift에서 runBlocking과 유사한 기능을 제공하며, 비동기 코드를 처리하는 데 사용됩니다. 선택적으로 Task를 사용하여 새로운 비동기 작업을 만들 수 있습니다.

SwiftUI에서는 비동기 작업 및 다중 스레딩과 관련된 개념이 있습니다. 비동기적인 코드를 작성하거나 다중 스레딩 환경에서 작업을 처리해야 하는 경우, SwiftUI 앱에서 사용할 수 있는 몇 가지 개념과 구성 요소가 있습니다.

  1. Swift의 비동기 프로그래밍:
    • SwiftUI는 Swift 언어를 기반으로 하기 때문에, Swift의 비동기 프로그래밍 기능을 활용할 수 있습니다. Swift 5.5부터는 async/await와 같은 비동기적인 기능들이 도입되었습니다. 이를 통해 비동기 코드를 더 쉽게 작성하고 관리할 수 있습니다.
  2. Combine 프레임워크:
    • Combine은 SwiftUI와 함께 사용되는 반응형 프로그래밍을 위한 Apple의 프레임워크입니다. 비동기적인 이벤트 스트림을 처리하고 결합하는 데 사용됩니다. Publisher 및 Subscriber와 같은 개념을 제공하여 데이터의 비동기적인 흐름을 효율적으로 다룰 수 있습니다.
    swiftCopy code
    import Combine var cancellables: Set<AnyCancellable> = [] URLSession.shared.dataTaskPublisher(for: url) .map(\.data) .decode(type: YourDecodableType.self, decoder: JSONDecoder()) .sink(receiveCompletion: { completion in // Handle completion }, receiveValue: { decodedData in // Handle decoded data }) .store(in: &cancellables)
  3. 비동기적 SwiftUI 뷰 업데이트:
    • SwiftUI에서는 @State 및 @Binding 속성을 사용하여 뷰의 상태를 관리합니다. 이러한 속성은 특정 값이 변경될 때 해당 뷰를 다시 그리도록 트리거됩니다. 비동기 작업이 완료된 후 뷰를 업데이트하려면 DispatchQueue.main.async 또는 Task를 사용할 수 있습니다.
    swiftCopy code
    Task { let result = await fetchData() DispatchQueue.main.async { self.data = result } }

위의 코드는 비동기 작업을 수행하고, 작업이 완료된 후에 메인 스레드에서 SwiftUI 뷰의 상태를 업데이트하는 예시입니다. 여기서 Task는 Swift의 새로운 비동기 작업을 나타내는 개념입니다.

SwiftUI 및 Swift의 최신 버전에서는 비동기 및 다중 스레딩을 다루기 위한 다양한 기능과 패턴이 계속해서 발전하고 있으므로, 현재의 문법과 패턴에 대한 최신 정보를 확인하는 것이 좋습니다.

 

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

[공지] Swift 에서 SOCANNER로 카테고리를 바꿉니다.  (0) 2024.04.02
Apple developer program has been updated.  (0) 2021.06.08
game center icon  (0) 2021.06.04
Game Center transcript  (0) 2021.06.04
agreements  (0) 2021.05.29

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

[공지] Swift 에서 SOCANNER로 카테고리를 바꿉니다.  (0) 2024.04.02
MSA 아키텍처 도입  (0) 2023.12.11
game center icon  (0) 2021.06.04
Game Center transcript  (0) 2021.06.04
agreements  (0) 2021.05.29

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

MSA 아키텍처 도입  (0) 2023.12.11
Apple developer program has been updated.  (0) 2021.06.08
Game Center transcript  (0) 2021.06.04
agreements  (0) 2021.05.29
swift log level  (0) 2021.05.28

Hello and welcome to WWDC.
-Hey, everyone.
 I'm Joe.
 -And I'm Michael.
 And we're both designers on the Game Center design team.
 We're here today to talk to you about the new Game Center experience and a whole lot of enhancements we've made to make it more engaging and beautiful for players.
 This session will give you an overview of how to design your game to make the most of Game Center's features.
There are a number of reasons to add Game Center to your game, including social features, where players can add friends and manage their gaming identity.
 Achievements and leaderboards to encourage competition within your game and keep your players coming back for more.
 And a rich multiplayer experience for real time and turn-based games.
 To help you take advantage of all of this, we'll be talking in detail about a number of things, starting with the access point, a consistent and recognizable way for players to access Game Center from within your game.
Let's take a look at this feature by launching a game.
 This is The Coast, an indie game where you have to carefully direct ships away from the shore so they don't crash and lose their precious cargo.
When your game launches, the first thing you'll see is the Game Center welcome banner.
 When this goes away, you'll notice a new UI element appear.
 This is the access point, a clear and easy way for players to access their Game Center information on any game.
The player's avatar serves as the access point for Game Center.
 Tapping or clicking it at any point will launch the new Game Center dashboard.
 It's where players can check out their profile, achievements, leaderboards and other useful information related to your game.
 But we'll get to that in a minute.
You can choose to present just the player's avatar or pair it with bits of helpful information we call "highlights.
" These highlights surface a player's Game Center data, like achievement progress and leaderboard positions.
The access point is pretty flexible.
 You can place it in any corner of the screen that works for your game's UI.
 However, we'd recommend placing it at top left, if possible.
And it works with how your game's designed in both landscape and portrait.
You'll just want to make sure none of your game's UI encroaches upon the area the access point takes at its maximum size.
On iPhone 11 Pro, the access point on portrait games is 62 by 335 points.
 We'd recommend leaving a safe area of 114 points from the top or bottom of the screen that spans the full width.
And for landscape games, it's 62 by 280 points.
It's best to leave a safe area of 91 points from the top or bottom of the screen that spans the full width.
The access point is available across other platforms.
 You can find full details on safe areas for other devices in the Human Interface Guidelines.
Whenever possible, display your access point at your game's main menu.
 Placing it here gives players quick access before they dive into your game.
 Just be sure it appears at the right moment within your game's launch sequence.
 Let any splash screens or cinematics finish before displaying the access point, along with your game's main menu.
If you can't place the access point on your main menu, you could find another place for it that players return to in your game, like on a level select screen or in Settings.
 As you can see, the access point is designed to adapt to your game, but think about how to design your game's UI to feel complementary and fit naturally into the experience.
When the game starts, it's a good idea to hide the access point so players can focus on game play and allow space for any critical in-game controls.
The access point is the best, most consistent way for users to access Game Center from within your game.
 However, you can also link to Game Center using your own custom UI.
 We've provided different icon options to be used within your game-- full color, white and black variants in a variety of formats, all of which you can find in the Apple Design Resources.
 Please use the iconography as provided and don't alter it in any way.
If your custom deep link includes text, please use the correct terminology, Game Center, and don't localize this term.
 And that's the new access point.
 Just a few things to remember: Place the access point on your main menu where possible.
Find the best corner to display your access point.
Surface player information with highlights.
 And ensure safe areas around your access point.
Joe, you're up.
 Thanks, Michael.
 Now let's move on to the dashboard and profile.
Tapping the access point will reveal the dashboard, a jumping-off point into each of the key areas that make up the new Game Center experience.
 The dashboard is presented as a transparent layer on top of your game, and it shows through the color of the screen behind it.
 We recommend that you pause your game or minimize any overly distracting animations when the dashboard is presented.
 The dashboard, along with the rest of the Game Center UI, supports both landscape and portrait orientation, to respect the way your game has been designed.
It has also been designed to feel consistent across iOS, iPadOS, macOS and tvOS.
On tvOS, you can also optionally display artwork on the dashboard.
 This really helps brand the experience and makes it feel more integrated into your game.
 When choosing the artwork to display here, please make sure that it comfortably contrasts with the Game Center UI.
 Consider using transparency to let the background show through.
Make sure that the artwork is simple, clear and reads well at a distance.
 The artwork you use here shouldn't be your app icon.
 Instead, use something different.
 For example, your game's logo or word mark.
 Dashboard artwork is not focusable.
 Here are the specifications for uploading your dashboard artwork.
It must be a TIFF or a PNG file to support transparency.
The image size should be 923 by 150 pixels at 1x.
.
.
1846 by 300 pixels at 2x, at least 72 DPI and in the sRGB color space.
The first section of the dashboard provides access to the profile.
Tapping on this shows players a holistic overview of their Game Center profile-- their friends, friend suggestions and the ability to access their achievements across all of the games they have played.
The profile is always accessible from the dashboard.
 However, you can also optionally provide a button inside your game to link players directly to the profile page.
This could be useful if you want to encourage players to add more friends so that they can better enjoy your game's leaderboard or multiplayer experience.
If you want to provide a link directly to the profile, please use this icon.
 You can style it to work with your game, but do not alter the shape in any way.
 To avoid confusion with the design of the access point, please don't use the player's Game Center avatar for this purpose.
If pairing the link with text, please use the correct language-- Game Center Profile and not "profile" on its own, "account" or anything else.
 And as mentioned before, the term Game Center should not be localized.
However, you can localize the term "profile.
" The accompanying tech session for Game Center will go into detail about how to link to the profile.
And that's the new dashboard and profile.
Let's review what we just talked about.
Remember to pause your game when the Game Center user interface is open.
 You can optionally provide dashboard artwork for tvOS.
And if needed, you can link directly to the Game Center profile from your game.
Now over to Michael for the next section.
 And now on to my personal favorite update to Game Center, achievements, which you'll find in the second section of the dashboard.
I used to love collecting trading cards.
 You just want to get them all, and there's nothing like getting the ones that are hard to find.
 That's exactly why we've redesigned achievements as a collectible card format.
Here, in the redesigned achievements section, players will see a lineup of these cards, representing your game's achievements, which are now grouped by "completed" and "locked.
" There are different kinds of achievements.
 Standard, which are earned straightaway once the requirements are met.
Progressive, which give players a sense of how far away they are from unlocking an achievement.
 And hidden, in which the details remain a mystery until the moment they're unlocked.
Think about how to make the most of these achievement types to improve the experience of playing your game.
And when a player completes any achievement, an image appears in the top portion of the card.
Make sure these images look awesome.
 The Coast has all these great lighthouses from around the world.
 I got this one in Level 5.
 The Passage Lighthouse is in the Great Lakes near Mackinac Island.
 This should be eye-catching, complement your game's look and feel, and make players feel rewarded by getting something special.
 It's a big step in keeping players engaged in your game.
Stay away from using text inside your artwork and upload custom images for each achievement.
 Players love earning unique achievements that remind them of each accomplishment.
And provide an opaque image for each achievement.
 The system automatically crops the image into a circle, so make sure any primary content is centered.
Achievement images are for display only, so they're not focusable.
Order your achievements in a way that reflects the progress of your game play.
 You're allowed up to 100 achievements in a game.
 Be selective about how many you provide.
 It's good to only use what you need to make your game challenging, so earning every one feels rewarding.
And rather than offer all 100 in version one of your game, leave room to add more in later releases to give players a reason to come back.
 There's just a few rules to consider around achievement images.
 It must be a JPEG, TIFF or PNG file, 512 by 512 pixels at 1x, 1024 by 1024 pixels at 2x, at least 72 DPI and in the sRGB color space.
You'll also need to include a title and description text for each of your achievements.
 Make sure they're as clear and succinct as possible so players understand how to earn an achievement at a glance.
And since achievement cards show two lines of your title and description before truncating, try to keep your text under 30 characters to guarantee it will work well across devices.
 Keep your titles initial caps, your description sentence case and avoid using all caps.
And for those final touches to copy, include a second description for when an achievement's been completed.
 And make sure all copy is localized depending on the country or region.
You can also choose to present in-game achievement notifications that give your players an immediate sense of accomplishment.
 We definitely recommend you work these into your game.
 Time these to display right at that moment of completion.
 Like here, in The Coast, as soon as players clear the level.
If you'd like to give players more direct access, you can also provide a custom link into the achievement section of Game Center.
 If you'd like to use iconography, use this, which features the card representation.
 You can style it to work with your game's UI, but don't alter the shape in any way.
Also just be consistent in how you refer to them, using the term "achievements" and not "trophies" or "awards" or anything else.
 That's the new achievement experience.
Let's recap.
Use achievement types to work with your game.
 Design unique, eye-catching images.
 Keep those descriptions clear and succinct.
And incorporate in-game notifications for some of that immediate reward.
Back over to you, Joe.
Thanks, Michael.
 The next section of the dashboard features your game's leaderboards.
A great place to encourage a player to compete with their friends and keep them coming back for more.
Tapping into this section provides an overview of all the leaderboards in your game.
 We recommend that you create leaderboards that best represent the core mechanics of your game play.
 They could be tied to a specific score in your game.
 For example, the longest distance traveled or the total number of coins collected, or alternatively, like in The Coast, each of the leaderboards are tied to a specific geographic region in the game.
Let's focus on the first leaderboard, Crater Lake.
When designing your leaderboard imagery, you should provide unique, eye-catching artwork that is recognizable at a glance.
Ensure that you use different artwork for each leaderboard so that players can differentiate between them.
And also consider how your leaderboards look alongside each other, so that they feel complementary as a set.
For leaderboard image specifications, images must be a JPEG, a TIFF or a PNG file, at 512 by 512 pixels at 1x, 1024 by 1024 pixels at 2x, at least 72 DPI and in the sRGB color space.
On tvOS, leaderboards have a 16-by-9 aspect ratio.
 They're also focusable and support between one and three multilayer images to provide a parallax effect.
During focus on parallax, content around the edges of some layers may be cropped or difficult to see clearly as the image scales and moves.
To ensure that your primary content is always visible, please don't place it close to the edges.
tvOS leaderboard images have different upload specifications.
 Images must be a PNG file, at 659 by 371 pixels at 1x, 1318 by 742 pixels at 2x, at least 72 DPI and in the sRGB color space.
You can find a more detailed overview of how to design focusable layered images for tvOS in the Human Interface Guidelines.
Leaderboards can only show a maximum of two lines before truncating.
 We recommend keeping your leaderboard titles under 30 characters to guarantee that it will work well across all devices and accessibility settings.
Keep titles for your leaderboards initial caps and please avoid using all caps.
Tapping into one of these reveals the scores for the specific leaderboard.
 We have redesigned leaderboards to be focused on friends, the players you care about competing with the most.
Speaking of which, Michael, you've got a bit of catching up to do.
You can also embed the information from your leaderboards directly into your game to give players visibility when it matters the most.
For example, you can give your players a chance to see their position before they start a level, or at the end after they beat their friends' top score.
The Game Center tech session will go into detail about how to embed leaderboard data into your game.
You can also choose to link directly into the leaderboard section of Game Center, or even directly into a specific leaderboard if you want to.
If you'd like to do this, please use the icon that we have provided.
 You can style it to work with your game's UI, but please do not alter the shape in any way.
If accompanying the icon with text, please use the correct language-- "leaderboards," and not "rankings" or "scores" or anything else.
And that's leaderboards.
As a summary of what we just covered, please design unique, eye-catching artwork for each leaderboard.
 tvOS requires a custom 16-by-9 layered artwork.
 Keep your descriptions short and succinct.
 And you can optionally embed leaderboard data into your game and also provide direct links to specific leaderboards.
 Now back to Michael.
Let's touch on multiplayer.
Game Center lets you easily take advantage of its robust set of multiplayer features for real time and turn-based games.
All you'll need is a button as a clear way for players to open the multiplayer lobby.
The new, redesigned lobby makes it simple and easy to jump into a game.
 When the lobby opens, you may want to pause any distracting animation in the background so players can focus on inviting friends.
 Tapping "add" reveals the player picker.
From here, you can see nearby players, friends, recent players and contacts.
Tap a player to add them to the lobby.
And when you're ready, just tap "Invite and Start.
" And if you'd like, you can also implement our multiplayer features without using our UI by building it directly into your game.
 Check out the tech session for more details.
Back over to you, Joe.
Thanks, Michael.
 And now on to the final section.
Game Center is now closely integrated into the App Store.
Visitors to the store will now be able to access their Game Center profile, see their achievements, add friends and browse the games their friends are playing.
Your friends' avatars will now show up on app icons and feature prominently in the game's tab.
Friends playing will also be highlighted on your game's product page.
 You can see them here at the top of the page and also in more detail further down.
 All of this will be enabled by simply integrating your game with Game Center, giving your game a great chance to be featured on the App Store.
 And that takes us to the end.
 Now back to Michael for a summary of everything we've just talked about.
Thanks, Joe.
 And that's the new Game Center experience.
A new way to access Game Center with in-game highlights, the fully redesigned dashboard, our beautiful collectible achievements, our engaging leaderboards and a whole lot more.
 Please remember that everything we discussed can be found in more detail in the Human Interface Guidelines.
We're looking forward to see what you do with Game Center, and we can't wait to play all the games you design.
 Thank you.
 Thanks a lot.

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

Apple developer program has been updated.  (0) 2021.06.08
game center icon  (0) 2021.06.04
agreements  (0) 2021.05.29
swift log level  (0) 2021.05.28
coredata 를 배열로 쓰기  (0) 2021.05.23

APPLE INC.

MACOS SDK AND XCODE AGREEMENT

 

PLEASE READ THIS MACOS SDK AND XCODE AGREEMENT ("LICENSE") CAREFULLY BEFORE USING THE DEVELOPER SOFTWARE (DEFINED BELOW). BY USING THE DEVELOPER SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS LICENSE.  IF YOU ARE ACCESSING THE DEVELOPER SOFTWARE ELECTRONICALLY, SIGNIFY YOUR AGREEMENT TO BE BOUND BY THE TERMS OF THIS LICENSE BY CLICKING THE "AGREE " BUTTON.  IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, DO NOT USE THE DEVELOPER SOFTWARE AND CLICK “DISAGREE”. 

 

IMPORTANT NOTE: To the extent that this software may be used to reproduce materials, it is licensed to you only for reproduction of non-copyrighted materials, materials in which you own the copyright, or materials you are authorized or legally permitted to reproduce. If you are uncertain about your right to copy any material, you should contact your legal advisor.

 

1. General. 

A. The Apple software, tools, utilities, sample or example code, documentation, interfaces, content, data, and other materials accompanying this License, whether on disk, print or electronic documentation, in read only memory, or any other media or in any other form, (collectively, the "Developer Software") are licensed, not sold, to you by Apple Inc. ("Apple") for use only under the terms of this License.  Apple and/or Apple’s licensors retain ownership of the Developer Software itself and reserve all rights not expressly granted to you. The terms of this License will govern any software upgrades provided by Apple that replace and/or supplement the original Developer Software, unless such upgrade is accompanied by a separate license in which case the terms of that license will govern. 

 

B. Title and intellectual property rights in and to any content displayed by or accessed through the Developer Software belongs to the respective content owner. Such content may be protected by copyright or other intellectual property laws and treaties, and may be subject to terms of use of the third party providing such content. This License does not grant you any rights to use such content nor does it guarantee that such content will continue to be available to you.

 

2. Permitted License Uses and Restrictions.

A. License. Subject to the terms and conditions of this License, you are granted a limited, non-exclusive license to use the Developer Software on Apple-branded computers to develop and test application and other software. You may make only as many internal use copies of the Developer Software as reasonably necessary to use the Developer Software as permitted under this License and distribute such copies only to your employees whose job duties require them to so use the Developer Software; provided that you reproduce on each copy of the Developer Software or portion thereof, all copyright or other proprietary notices contained on the original. 

 

B. Other Use Restrictions. The grants set forth in this License do not permit you to, and you agree not to, install, use or run the Developer Software on any non-Apple-branded computer, or to enable others to do so. Except as otherwise expressly permitted by the terms of this License or as otherwise licensed by Apple: (i) only one user may use the Developer Software at a time, and (ii) you may not make the Developer Software available over a network where it could be run or used by multiple computers at the same time. You may not rent, lease, lend, sell, sublicense or otherwise redistribute the Developer Software or exploit any services provided by or through the Developer Software in any unauthorized way. 

 

C. No Reverse Engineering; Limitations. You may not, and you agree not to or to enable others to, copy (except as expressly permitted by this License), decompile, reverse engineer, disassemble, attempt to derive the source code of, decrypt, modify, create derivative works of the Developer Software or any services provided by or through the Developer Software or any part thereof (except as and only to the extent any foregoing restriction is prohibited by applicable law or to the extent as may be permitted by licensing terms governing use of the  Open-Sourced Components or Sample Code). 

 

D. Sample Code. Certain portions of the Developer Software consist of sample or example code provided by Apple ("Sample Code"). You may use, reproduce, modify and redistribute such Sample Code only in accordance with the licensing terms accompanying such Sample Code or related project(s).

 

E. QuickTime Development Software. You may use the QuickTime development software only to develop application software that is compatible with, and runs only on supported macOS and/or Windows platforms with QuickTime installed. Your software application may not interfere with the functionality of QuickTime Player or the QuickTime Plug-in, including but not limited to file type or MIME type associations that are registered to QuickTime.

 

F. Use of System-Provided Images. The system-provided images owned by Apple and documented as such in Apple's Human Interface Guidelines for macOS and iOS ("System-Provided Images") are licensed to you solely for the purpose of developing macOS and iOS applications, respectively, using the Developer Software. Upon termination of this License, you may continue to distribute the System-Provided Images as used within software you developed using the Developer Software; however, you agree to provide to Apple, at Apple's request, a copy of any software you developed using the Developer Software that incorporates any of the System-Provided Images so Apple may determine, in its sole discretion, whether your use of the System-Provided Images complies with these terms.

 

G. Location Services; Consents. 

1. Apple may enable you to access certain location-based application programming interfaces (APIs) (e.g., Core Location) documented by Apple (“Location APIs”) through the Developer Software.  Subject to these terms and conditions, you may use such APIs and services only to enable software programs you develop for use on macOS (“Applications”) to access location data (e.g. the real-time geographic location of a user’s computer) from users who consent to such access. For Applications that use Location APIs or otherwise provide location-based services, you agree that such Applications may not be designed or marketed for automatic or autonomous control of vehicle behavior, or for emergency or life-saving purposes. In addition, Applications that offer location-based services or functionality must notify and obtain consent from an individual before his or her location data is collected, transmitted or otherwise used by the Application. For Applications that use Location APIs for real-time navigation (including, but not limited to, turn-by-turn route guidance and other routing that is enabled through the use of a sensor), you must have an end-user license agreement that includes the following notice: YOUR USE OF THIS REAL TIME ROUTE GUIDANCE APPLICATION IS AT YOUR SOLE RISK. LOCATION DATA MAY NOT BE ACCURATE.

 

2. You agree that neither you nor your Applications will disable, override or otherwise interfere with any Apple-implemented system alerts, warnings, display panels, consent panels and the like, including, but not limited to, those that are intended to notify the user that the user's location data is being collected, transmitted, maintained, processed or used, or intended to obtain consent for such use.  If consent is denied or withdrawn, neither you nor your Applications may collect, transmit, maintain, process or utilize the user's location information or data through the Location APIs. You understand and agree that you and your Applications must comply with all applicable criminal, civil and statutory laws and regulations (including privacy, data collection and location service laws and regulations) in any jurisdictions in which your Applications may be delivered.  You shall be solely responsible for, and Apple shall have no responsibility or liability whatsoever with respect to, any and all claims, suits, liabilities, losses, damages, costs and expenses arising from, related or attributable to, or otherwise involving your Application, including but not limited to your Application’s use of the Location APIs.

 

H. Compliance with Laws. You agree to use the Developer Software and the services in compliance with all applicable laws, including local laws of the country or region in which you reside or in which you download or use the Developer Software or services.

 

3. Transfer. You may make a one-time permanent transfer of all of your license rights to the Developer Software (in its original form as provided by Apple) to another party, provided that: (a) the transfer must include all of the Developer Software, including all its component parts and this License; (b) you do not retain any copies of the Developer Software, full or partial, including copies stored on a computer or other storage device; and (c) the party receiving the Developer Software accepts the terms and conditions of this License. You may not transfer any Developer Software that has been modified or replaced under Section 13 below. All components of the Developer Software are provided as part of a bundle and may not be separated from the bundle and distributed as standalone applications.

 

4. Consent to Use of Data.

A. Diagnostic and Usage Data. If you choose to allow diagnostic and usage collection, you agree that Apple and its subsidiaries and agents may collect, maintain, process and use diagnostic, technical, usage and related information, including but not limited to unique system or hardware identifiers, information about your computer, system and application software, and peripherals, that is gathered periodically to provide and improve Apple’s products and services, facilitate the provision of software updates, product support and other services to you (if any) related to the Developer Software, and to verify compliance with the terms of this License. You may change your preferences for Diagnostics & Usage collection at any time by going to the Diagnostics & Usage setting on your computer and deselecting the checkbox. The Diagnostics & Usage setting is found in the Security & Privacy pane within System Preferences. Apple may use this information, as long as it is collected in a form that does not personally identify you, for the purposes described above. To enable Apple’s partners and third party developers to improve their software, hardware and services designed for use with Apple products, Apple may also provide any such partner or third party developer with a subset of diagnostic information that is relevant to that partner’s or developer’s software, hardware and/or services, as long as the diagnostic information is in a form that does not personally identify you. 

 

B. Privacy Policy. At all times your information will be treated in accordance with Apple’s Privacy Policy, which is incorporated by reference into this License and can be viewed at: http://www.apple.com/legal/privacy/.

 

5. Services; Mac Developer Program.

A. Apple may provide access to services by or through the Developer Software for you to use.  Use of these services may require an Apple ID, may require you to accept additional terms and may be subject to additional fees. If you elect to use such services in conjunction with the Developer Software, your usage of such services will be subject to those additional terms and conditions (e.g., your use of Developer IDs obtained from your Apple Developer Program account will be subject to the applicable Apple Developer Program terms for Developer IDs), but this License will continue to apply to your use of the Developer Software licensed hereunder. If you would like to submit Applications you develop to the Mac App Store, then you must apply to join the Mac Developer Program. More information about Apple’s Developer Programs is available at http://developer.apple.com/. Apple reserves the right to refuse admission to any of its Developer Programs at any time in its sole discretion. 

 

B. You agree that the services contain proprietary content, information and material that is owned by Apple and its licensors, and is protected by applicable intellectual property and other laws, and that you will not use such proprietary content, information or materials in any way whatsoever except for permitted use of the services or in any manner that is inconsistent with the terms of this License or that infringes any intellectual property rights of a third party or Apple. Except to the extent expressly permitted in the applicable terms for the services, You agree not to reproduce, modify, rent, lease, lend, sell, distribute, or create derivative works based on the services, in any manner, and you shall not exploit the services in any unauthorized way whatsoever, including but not limited to, using the services to transmit any malware, or by trespass or burdening network capacity. 

 

C. In addition, services that may be accessed, linked to or displayed through the Developer Software may not be available in all languages or in all countries. Apple makes no representation that any such services would be appropriate or available for use in any particular location. Apple reserves the right to change, suspend, remove, or disable access to any services at any time. In no event will Apple be liable for the removal of or disabling of access to any such services or for any updates, maintenance, warranty, technical or other support for such services. Apple may also impose limits or other restrictions on the use of or access to the services, in any case without notice or liability.  You acknowledge and agree that Apple reserves the right to revoke or remove your access to any services provided by or through the Developer Software at any time in its sole discretion.

 

6. Termination. This License is effective until terminated. Your rights under this License will terminate automatically or cease to be effective without notice from Apple if you fail to comply with any term(s) of this License. In addition, Apple reserves the right to terminate this License if a new version of Apple's operating system software or the Developer Software is released which is incompatible with this version of the Developer Software. Upon the termination of this License, you shall cease all use of the Developer Software and destroy all copies, full or partial, of the Developer Software. Section 2B, 2C, 4, 5B, and 6 through 13 of this License shall survive any termination.

 

7. Disclaimer of Warranties. 

A. YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE LAW, USE OF THE DEVELOPER SOFTWARE AND ANY SERVICES PERFORMED BY OR ACCESSED THROUGH THE DEVELOPER SOFTWARE IS AT YOUR SOLE RISK AND THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT IS WITH YOU. 

 

B. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE DEVELOPER SOFTWARE AND SERVICES ARE PROVIDED “AS IS” AND “AS AVAILABLE”, WITH ALL FAULTS AND WITHOUT WARRANTY OF ANY KIND, AND APPLE AND APPLE'S LICENSORS (COLLECTIVELY REFERRED TO AS “APPLE” FOR THE PURPOSES OF SECTIONS 7 AND 8) HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH RESPECT TO THE DEVELOPER SOFTWARE AND SERVICES, EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, QUIET ENJOYMENT, AND NON-INFRINGEMENT OF THIRD PARTY RIGHTS. 

 

C. APPLE DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE DEVELOPER SOFTWARE AND SERVICES, THAT THE FUNCTIONS CONTAINED IN, OR SERVICES PERFORMED OR PROVIDED BY, THE DEVELOPER SOFTWARE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE DEVELOPER SOFTWARE OR SERVICES WILL BE UNINTERRUPTED OR ERROR-FREE, THAT ANY SERVICES WILL CONTINUE TO BE MADE AVAILABLE, THAT THE DEVELOPER SOFTWARE OR SERVICES WILL BE COMPATIBLE OR WORK WITH ANY THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES, OR THAT DEFECTS IN THE DEVELOPER SOFTWARE OR SERVICES WILL BE CORRECTED. INSTALLATION OF THIS DEVELOPER SOFTWARE MAY AFFECT THE USABILITY OF THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES AS WELL AS OTHER APPLE PRODUCTS OR SERVICES.

 

D. YOU FURTHER ACKNOWLEDGE THAT THE DEVELOPER SOFTWARE AND SERVICES ARE NOT INTENDED OR SUITABLE FOR USE IN SITUATIONS OR ENVIRONMENTS WHERE THE FAILURE OR TIME DELAYS OF, OR ERRORS OR INACCURACIES IN THE CONTENT, DATA OR INFORMATION PROVIDED BY, THE DEVELOPER SOFTWARE OR SERVICES COULD LEAD TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE, INCLUDING WITHOUT LIMITATION THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, LIFE SUPPORT OR WEAPONS SYSTEMS. 

 

E. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY. SHOULD THE DEVELOPER SOFTWARE OR SERVICES PROVE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES OR LIMITATIONS ON APPLICABLE STATUTORY RIGHTS OF A CONSUMER, SO THE ABOVE EXCLUSION AND LIMITATIONS MAY NOT APPLY TO YOU. 

 

8. Limitation of Liability. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT SHALL APPLE BE LIABLE FOR PERSONAL INJURY, OR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, CORRUPTION OR LOSS OF DATA, FAILURE TO TRANSMIT OR RECEIVE ANY DATA OR INFORMATION, BUSINESS INTERRUPTION OR ANY OTHER COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO YOUR USE OR INABILITY TO USE THE DEVELOPER SOFTWARE OR SERVICES OR ANY THIRD PARTY SOFTWARE, APPLICATIONS, OR SERVICES IN CONJUNCTION WITH THE DEVELOPER SOFTWARE OR SERVICES, HOWEVER CAUSED, REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, TORT OR OTHERWISE) AND EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR PERSONAL INJURY, OR OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Apple's total liability to you for all damages (other than as may be required by applicable law in cases involving personal injury) exceed the amount of fifty dollars ($50.00). The foregoing limitations will apply even if the above stated remedy fails of its essential purpose.

 

9. Export Control. You may not use or otherwise export or re-export the Developer Software except as authorized by United States law and the laws of the jurisdiction(s) in which the Developer Software was obtained. In particular, but without limitation, the Developer Software may not be exported or re-exported (a) into any U.S. embargoed countries or (b) to anyone on the U.S. Treasury Department's list of Specially Designated Nationals or the U.S. Department of Commerce Denied Person's List or Entity List. By using the Developer Software, you represent and warrant that you are not located in any such country or on any such list. You also agree that you will not use the Developer Software for any purposes prohibited by United States law, including, without limitation, the development, design, manufacture or production of missiles, nuclear, chemical or biological weapons.

 

10. Government End Users. The Developer Software and related documentation are "Commercial Items", as that term is defined at 48 C.F.R. §2.101, consisting of "Commercial Computer Software" and "Commercial Computer Software Documentation", as such terms are used in 48 C.F.R. §12.212 or 48 C.F.R. §227.7202, as applicable. Consistent with 48 C.F.R. §12.212 or 48 C.F.R. §227.7202-1 through 227.7202-4, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (a) only as Commercial Items and (b) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished-rights reserved under the copyright laws of the United States.

 

11. Controlling Law and Severability. This License will be governed by and construed in accordance with the laws of the State of California, excluding its conflict of law principles. This License shall not be governed by the United Nations Convention on Contracts for the International Sale of Goods, the application of which is expressly excluded. If for any reason a court of competent jurisdiction finds any provision, or portion thereof, to be unenforceable, the remainder of this License shall continue in full force and effect.  

 

12. Complete Agreement; Governing Language. This License constitutes the entire agreement between you and Apple relating to the use of the Developer Software licensed hereunder and supersedes all prior or contemporaneous understandings regarding such subject matter. No amendment to or modification of this License will be binding unless in writing and signed by Apple.  The parties hereto confirm that they have requested that this License and all related documents be drafted in English. Les parties ont exigé que le présent contrat et tous les documents connexes soient rédigés en anglais.

 

13. Third Party Acknowledgements. 

A. Certain components of the Developer Software, and third party open source programs included with the Developer Software, have been or may be made available by Apple on its Open Source web site (http://www.opensource.apple.com/) (collectively the "Open-Sourced Components"). You may modify or replace only these Open-Sourced Components; provided that: (i) the resultant modified Developer Software is used in accordance with the permitted uses set forth above; and (ii) you otherwise comply with the terms of this License and any applicable licensing terms governing use of the Open-Sourced Components. Apple is not obligated to provide any updates, maintenance, warranty, technical or other support, or services for the resultant modified Developer Software. You expressly acknowledge that if failure of or damage to Apple hardware results from modification of the Open-Sourced Components of the Developer Software, such failure or damage is excluded from the terms of the Apple hardware warranty.

 

B. Certain software libraries and other third party software included with the Developer Software are free software and licensed under the terms of the GNU General Public License (GPL) or the GNU Library/Lesser General Public License (LGPL), as the case may be. You may obtain a complete machine-readable copy of the source code for such free software under the terms of the GPL or LGPL, as the case may be, without charge except for the cost of media, shipping, and handling, upon written request to Apple. The GPL/LGPL software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of the GPL and LGPL is included with the Developer Software.

 

C. The Developer Software includes certain software licensed under the IBM Public License Version 1.0 (IPL) or the Common Public License Version 1.0 (CPL). A copy of the source code for the IPL and CPL licensed software may be found in Apple’s Open Source repository. See Apple's Open Source web site (http://www.opensource.apple.com) for information on how to obtain the source code. THE IPL AND CPL SOFTWARE IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  NEITHER APPLE, IBM NOR ANY OTHER CONTRIBUTOR TO THE  IPL AND CPL SOFTWARE SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, WITHOUT LIMITATION, LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE IPL AND CPL SOFTWARE OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

 

EA1422

8/25/2016

 

 

APPLE INC.

MACOS SDK AND XCODE AGREEMENT

 

PLEASE READ THIS MACOS SDK AND XCODE AGREEMENT ("LICENSE") CAREFULLY BEFORE USING THE DEVELOPER SOFTWARE (DEFINED BELOW). BY USING THE DEVELOPER SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS LICENSE.  IF YOU ARE ACCESSING THE DEVELOPER SOFTWARE ELECTRONICALLY, SIGNIFY YOUR AGREEMENT TO BE BOUND BY THE TERMS OF THIS LICENSE BY CLICKING THE "AGREE " BUTTON.  IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, DO NOT USE THE DEVELOPER SOFTWARE AND CLICK “DISAGREE”. 

 

IMPORTANT NOTE: To the extent that this software may be used to reproduce materials, it is licensed to you only for reproduction of non-copyrighted materials, materials in which you own the copyright, or materials you are authorized or legally permitted to reproduce. If you are uncertain about your right to copy any material, you should contact your legal advisor.

 

1. General. 

A. The Apple software, tools, utilities, sample or example code, documentation, interfaces, content, data, and other materials accompanying this License, whether on disk, print or electronic documentation, in read only memory, or any other media or in any other form, (collectively, the "Developer Software") are licensed, not sold, to you by Apple Inc. ("Apple") for use only under the terms of this License.  Apple and/or Apple’s licensors retain ownership of the Developer Software itself and reserve all rights not expressly granted to you. The terms of this License will govern any software upgrades provided by Apple that replace and/or supplement the original Developer Software, unless such upgrade is accompanied by a separate license in which case the terms of that license will govern. 

 

B. Title and intellectual property rights in and to any content displayed by or accessed through the Developer Software belongs to the respective content owner. Such content may be protected by copyright or other intellectual property laws and treaties, and may be subject to terms of use of the third party providing such content. This License does not grant you any rights to use such content nor does it guarantee that such content will continue to be available to you.

 

2. Permitted License Uses and Restrictions.

A. License. Subject to the terms and conditions of this License, you are granted a limited, non-exclusive license to use the Developer Software on Apple-branded computers to develop and test application and other software. You may make only as many internal use copies of the Developer Software as reasonably necessary to use the Developer Software as permitted under this License and distribute such copies only to your employees whose job duties require them to so use the Developer Software; provided that you reproduce on each copy of the Developer Software or portion thereof, all copyright or other proprietary notices contained on the original. 

 

B. Other Use Restrictions. The grants set forth in this License do not permit you to, and you agree not to, install, use or run the Developer Software on any non-Apple-branded computer, or to enable others to do so. Except as otherwise expressly permitted by the terms of this License or as otherwise licensed by Apple: (i) only one user may use the Developer Software at a time, and (ii) you may not make the Developer Software available over a network where it could be run or used by multiple computers at the same time. You may not rent, lease, lend, sell, sublicense or otherwise redistribute the Developer Software or exploit any services provided by or through the Developer Software in any unauthorized way. 

 

C. No Reverse Engineering; Limitations. You may not, and you agree not to or to enable others to, copy (except as expressly permitted by this License), decompile, reverse engineer, disassemble, attempt to derive the source code of, decrypt, modify, create derivative works of the Developer Software or any services provided by or through the Developer Software or any part thereof (except as and only to the extent any foregoing restriction is prohibited by applicable law or to the extent as may be permitted by licensing terms governing use of the  Open-Sourced Components or Sample Code). 

 

D. Sample Code. Certain portions of the Developer Software consist of sample or example code provided by Apple ("Sample Code"). You may use, reproduce, modify and redistribute such Sample Code only in accordance with the licensing terms accompanying such Sample Code or related project(s).

 

E. QuickTime Development Software. You may use the QuickTime development software only to develop application software that is compatible with, and runs only on supported macOS and/or Windows platforms with QuickTime installed. Your software application may not interfere with the functionality of QuickTime Player or the QuickTime Plug-in, including but not limited to file type or MIME type associations that are registered to QuickTime.

 

F. Use of System-Provided Images. The system-provided images owned by Apple and documented as such in Apple's Human Interface Guidelines for macOS and iOS ("System-Provided Images") are licensed to you solely for the purpose of developing macOS and iOS applications, respectively, using the Developer Software. Upon termination of this License, you may continue to distribute the System-Provided Images as used within software you developed using the Developer Software; however, you agree to provide to Apple, at Apple's request, a copy of any software you developed using the Developer Software that incorporates any of the System-Provided Images so Apple may determine, in its sole discretion, whether your use of the System-Provided Images complies with these terms.

 

G. Location Services; Consents. 

1. Apple may enable you to access certain location-based application programming interfaces (APIs) (e.g., Core Location) documented by Apple (“Location APIs”) through the Developer Software.  Subject to these terms and conditions, you may use such APIs and services only to enable software programs you develop for use on macOS (“Applications”) to access location data (e.g. the real-time geographic location of a user’s computer) from users who consent to such access. For Applications that use Location APIs or otherwise provide location-based services, you agree that such Applications may not be designed or marketed for automatic or autonomous control of vehicle behavior, or for emergency or life-saving purposes. In addition, Applications that offer location-based services or functionality must notify and obtain consent from an individual before his or her location data is collected, transmitted or otherwise used by the Application. For Applications that use Location APIs for real-time navigation (including, but not limited to, turn-by-turn route guidance and other routing that is enabled through the use of a sensor), you must have an end-user license agreement that includes the following notice: YOUR USE OF THIS REAL TIME ROUTE GUIDANCE APPLICATION IS AT YOUR SOLE RISK. LOCATION DATA MAY NOT BE ACCURATE.

 

2. You agree that neither you nor your Applications will disable, override or otherwise interfere with any Apple-implemented system alerts, warnings, display panels, consent panels and the like, including, but not limited to, those that are intended to notify the user that the user's location data is being collected, transmitted, maintained, processed or used, or intended to obtain consent for such use.  If consent is denied or withdrawn, neither you nor your Applications may collect, transmit, maintain, process or utilize the user's location information or data through the Location APIs. You understand and agree that you and your Applications must comply with all applicable criminal, civil and statutory laws and regulations (including privacy, data collection and location service laws and regulations) in any jurisdictions in which your Applications may be delivered.  You shall be solely responsible for, and Apple shall have no responsibility or liability whatsoever with respect to, any and all claims, suits, liabilities, losses, damages, costs and expenses arising from, related or attributable to, or otherwise involving your Application, including but not limited to your Application’s use of the Location APIs.

 

H. Compliance with Laws. You agree to use the Developer Software and the services in compliance with all applicable laws, including local laws of the country or region in which you reside or in which you download or use the Developer Software or services.

 

3. Transfer. You may make a one-time permanent transfer of all of your license rights to the Developer Software (in its original form as provided by Apple) to another party, provided that: (a) the transfer must include all of the Developer Software, including all its component parts and this License; (b) you do not retain any copies of the Developer Software, full or partial, including copies stored on a computer or other storage device; and (c) the party receiving the Developer Software accepts the terms and conditions of this License. You may not transfer any Developer Software that has been modified or replaced under Section 13 below. All components of the Developer Software are provided as part of a bundle and may not be separated from the bundle and distributed as standalone applications.

 

4. Consent to Use of Data.

A. Diagnostic and Usage Data. If you choose to allow diagnostic and usage collection, you agree that Apple and its subsidiaries and agents may collect, maintain, process and use diagnostic, technical, usage and related information, including but not limited to unique system or hardware identifiers, information about your computer, system and application software, and peripherals, that is gathered periodically to provide and improve Apple’s products and services, facilitate the provision of software updates, product support and other services to you (if any) related to the Developer Software, and to verify compliance with the terms of this License. You may change your preferences for Diagnostics & Usage collection at any time by going to the Diagnostics & Usage setting on your computer and deselecting the checkbox. The Diagnostics & Usage setting is found in the Security & Privacy pane within System Preferences. Apple may use this information, as long as it is collected in a form that does not personally identify you, for the purposes described above. To enable Apple’s partners and third party developers to improve their software, hardware and services designed for use with Apple products, Apple may also provide any such partner or third party developer with a subset of diagnostic information that is relevant to that partner’s or developer’s software, hardware and/or services, as long as the diagnostic information is in a form that does not personally identify you. 

 

B. Privacy Policy. At all times your information will be treated in accordance with Apple’s Privacy Policy, which is incorporated by reference into this License and can be viewed at: http://www.apple.com/legal/privacy/.

 

5. Services; Mac Developer Program.

A. Apple may provide access to services by or through the Developer Software for you to use.  Use of these services may require an Apple ID, may require you to accept additional terms and may be subject to additional fees. If you elect to use such services in conjunction with the Developer Software, your usage of such services will be subject to those additional terms and conditions (e.g., your use of Developer IDs obtained from your Apple Developer Program account will be subject to the applicable Apple Developer Program terms for Developer IDs), but this License will continue to apply to your use of the Developer Software licensed hereunder. If you would like to submit Applications you develop to the Mac App Store, then you must apply to join the Mac Developer Program. More information about Apple’s Developer Programs is available at http://developer.apple.com/. Apple reserves the right to refuse admission to any of its Developer Programs at any time in its sole discretion. 

 

B. You agree that the services contain proprietary content, information and material that is owned by Apple and its licensors, and is protected by applicable intellectual property and other laws, and that you will not use such proprietary content, information or materials in any way whatsoever except for permitted use of the services or in any manner that is inconsistent with the terms of this License or that infringes any intellectual property rights of a third party or Apple. Except to the extent expressly permitted in the applicable terms for the services, You agree not to reproduce, modify, rent, lease, lend, sell, distribute, or create derivative works based on the services, in any manner, and you shall not exploit the services in any unauthorized way whatsoever, including but not limited to, using the services to transmit any malware, or by trespass or burdening network capacity. 

 

C. In addition, services that may be accessed, linked to or displayed through the Developer Software may not be available in all languages or in all countries. Apple makes no representation that any such services would be appropriate or available for use in any particular location. Apple reserves the right to change, suspend, remove, or disable access to any services at any time. In no event will Apple be liable for the removal of or disabling of access to any such services or for any updates, maintenance, warranty, technical or other support for such services. Apple may also impose limits or other restrictions on the use of or access to the services, in any case without notice or liability.  You acknowledge and agree that Apple reserves the right to revoke or remove your access to any services provided by or through the Developer Software at any time in its sole discretion.

 

6. Termination. This License is effective until terminated. Your rights under this License will terminate automatically or cease to be effective without notice from Apple if you fail to comply with any term(s) of this License. In addition, Apple reserves the right to terminate this License if a new version of Apple's operating system software or the Developer Software is released which is incompatible with this version of the Developer Software. Upon the termination of this License, you shall cease all use of the Developer Software and destroy all copies, full or partial, of the Developer Software. Section 2B, 2C, 4, 5B, and 6 through 13 of this License shall survive any termination.

 

7. Disclaimer of Warranties. 

A. YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE LAW, USE OF THE DEVELOPER SOFTWARE AND ANY SERVICES PERFORMED BY OR ACCESSED THROUGH THE DEVELOPER SOFTWARE IS AT YOUR SOLE RISK AND THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT IS WITH YOU. 

 

B. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE DEVELOPER SOFTWARE AND SERVICES ARE PROVIDED “AS IS” AND “AS AVAILABLE”, WITH ALL FAULTS AND WITHOUT WARRANTY OF ANY KIND, AND APPLE AND APPLE'S LICENSORS (COLLECTIVELY REFERRED TO AS “APPLE” FOR THE PURPOSES OF SECTIONS 7 AND 8) HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH RESPECT TO THE DEVELOPER SOFTWARE AND SERVICES, EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, QUIET ENJOYMENT, AND NON-INFRINGEMENT OF THIRD PARTY RIGHTS. 

 

C. APPLE DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE DEVELOPER SOFTWARE AND SERVICES, THAT THE FUNCTIONS CONTAINED IN, OR SERVICES PERFORMED OR PROVIDED BY, THE DEVELOPER SOFTWARE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE DEVELOPER SOFTWARE OR SERVICES WILL BE UNINTERRUPTED OR ERROR-FREE, THAT ANY SERVICES WILL CONTINUE TO BE MADE AVAILABLE, THAT THE DEVELOPER SOFTWARE OR SERVICES WILL BE COMPATIBLE OR WORK WITH ANY THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES, OR THAT DEFECTS IN THE DEVELOPER SOFTWARE OR SERVICES WILL BE CORRECTED. INSTALLATION OF THIS DEVELOPER SOFTWARE MAY AFFECT THE USABILITY OF THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES AS WELL AS OTHER APPLE PRODUCTS OR SERVICES.

 

D. YOU FURTHER ACKNOWLEDGE THAT THE DEVELOPER SOFTWARE AND SERVICES ARE NOT INTENDED OR SUITABLE FOR USE IN SITUATIONS OR ENVIRONMENTS WHERE THE FAILURE OR TIME DELAYS OF, OR ERRORS OR INACCURACIES IN THE CONTENT, DATA OR INFORMATION PROVIDED BY, THE DEVELOPER SOFTWARE OR SERVICES COULD LEAD TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE, INCLUDING WITHOUT LIMITATION THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, LIFE SUPPORT OR WEAPONS SYSTEMS. 

 

E. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY. SHOULD THE DEVELOPER SOFTWARE OR SERVICES PROVE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES OR LIMITATIONS ON APPLICABLE STATUTORY RIGHTS OF A CONSUMER, SO THE ABOVE EXCLUSION AND LIMITATIONS MAY NOT APPLY TO YOU. 

 

8. Limitation of Liability. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT SHALL APPLE BE LIABLE FOR PERSONAL INJURY, OR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, CORRUPTION OR LOSS OF DATA, FAILURE TO TRANSMIT OR RECEIVE ANY DATA OR INFORMATION, BUSINESS INTERRUPTION OR ANY OTHER COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO YOUR USE OR INABILITY TO USE THE DEVELOPER SOFTWARE OR SERVICES OR ANY THIRD PARTY SOFTWARE, APPLICATIONS, OR SERVICES IN CONJUNCTION WITH THE DEVELOPER SOFTWARE OR SERVICES, HOWEVER CAUSED, REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, TORT OR OTHERWISE) AND EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR PERSONAL INJURY, OR OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Apple's total liability to you for all damages (other than as may be required by applicable law in cases involving personal injury) exceed the amount of fifty dollars ($50.00). The foregoing limitations will apply even if the above stated remedy fails of its essential purpose.

 

9. Export Control. You may not use or otherwise export or re-export the Developer Software except as authorized by United States law and the laws of the jurisdiction(s) in which the Developer Software was obtained. In particular, but without limitation, the Developer Software may not be exported or re-exported (a) into any U.S. embargoed countries or (b) to anyone on the U.S. Treasury Department's list of Specially Designated Nationals or the U.S. Department of Commerce Denied Person's List or Entity List. By using the Developer Software, you represent and warrant that you are not located in any such country or on any such list. You also agree that you will not use the Developer Software for any purposes prohibited by United States law, including, without limitation, the development, design, manufacture or production of missiles, nuclear, chemical or biological weapons.

 

10. Government End Users. The Developer Software and related documentation are "Commercial Items", as that term is defined at 48 C.F.R. §2.101, consisting of "Commercial Computer Software" and "Commercial Computer Software Documentation", as such terms are used in 48 C.F.R. §12.212 or 48 C.F.R. §227.7202, as applicable. Consistent with 48 C.F.R. §12.212 or 48 C.F.R. §227.7202-1 through 227.7202-4, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (a) only as Commercial Items and (b) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished-rights reserved under the copyright laws of the United States.

 

11. Controlling Law and Severability. This License will be governed by and construed in accordance with the laws of the State of California, excluding its conflict of law principles. This License shall not be governed by the United Nations Convention on Contracts for the International Sale of Goods, the application of which is expressly excluded. If for any reason a court of competent jurisdiction finds any provision, or portion thereof, to be unenforceable, the remainder of this License shall continue in full force and effect.  

 

12. Complete Agreement; Governing Language. This License constitutes the entire agreement between you and Apple relating to the use of the Developer Software licensed hereunder and supersedes all prior or contemporaneous understandings regarding such subject matter. No amendment to or modification of this License will be binding unless in writing and signed by Apple.  The parties hereto confirm that they have requested that this License and all related documents be drafted in English. Les parties ont exigé que le présent contrat et tous les documents connexes soient rédigés en anglais.

 

13. Third Party Acknowledgements. 

A. Certain components of the Developer Software, and third party open source programs included with the Developer Software, have been or may be made available by Apple on its Open Source web site (http://www.opensource.apple.com/) (collectively the "Open-Sourced Components"). You may modify or replace only these Open-Sourced Components; provided that: (i) the resultant modified Developer Software is used in accordance with the permitted uses set forth above; and (ii) you otherwise comply with the terms of this License and any applicable licensing terms governing use of the Open-Sourced Components. Apple is not obligated to provide any updates, maintenance, warranty, technical or other support, or services for the resultant modified Developer Software. You expressly acknowledge that if failure of or damage to Apple hardware results from modification of the Open-Sourced Components of the Developer Software, such failure or damage is excluded from the terms of the Apple hardware warranty.

 

B. Certain software libraries and other third party software included with the Developer Software are free software and licensed under the terms of the GNU General Public License (GPL) or the GNU Library/Lesser General Public License (LGPL), as the case may be. You may obtain a complete machine-readable copy of the source code for such free software under the terms of the GPL or LGPL, as the case may be, without charge except for the cost of media, shipping, and handling, upon written request to Apple. The GPL/LGPL software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. A copy of the GPL and LGPL is included with the Developer Software.

 

C. The Developer Software includes certain software licensed under the IBM Public License Version 1.0 (IPL) or the Common Public License Version 1.0 (CPL). A copy of the source code for the IPL and CPL licensed software may be found in Apple’s Open Source repository. See Apple's Open Source web site (http://www.opensource.apple.com) for information on how to obtain the source code. THE IPL AND CPL SOFTWARE IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  NEITHER APPLE, IBM NOR ANY OTHER CONTRIBUTOR TO THE  IPL AND CPL SOFTWARE SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, WITHOUT LIMITATION, LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE IPL AND CPL SOFTWARE OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

 

EA1422

8/25/2016

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

game center icon  (0) 2021.06.04
Game Center transcript  (0) 2021.06.04
swift log level  (0) 2021.05.28
coredata 를 배열로 쓰기  (0) 2021.05.23
tableview 에 button 삽입 후 title 가져오기  (0) 2021.05.23

struct _logLevel: OptionSet {

        let rawValue: Int

        static let critical    = _logLevel(rawValue: 1 << 0)

        static let major  = _logLevel(rawValue: 1 << 1)

        static let minor   = _logLevel(rawValue: 1 << 2)

        static let just   = _logLevel(rawValue: 1 << 3)

        static let graph = _logLevel(rawValue: 1 << 4)

        static let current = _logLevel(rawValue: 1 << 5)

        static let fixing = _logLevel(rawValue: 1 << 6)

        static let motion = _logLevel(rawValue: 1 << 7)

        static let network = _logLevel(rawValue: 1 << 8)

        static let network2 = _logLevel(rawValue: 1 << 9)

        static let none = _logLevel(rawValue: 1 << 10)

        static let layer = _logLevel(rawValue: 1 << 11)

        static let json = _logLevel(rawValue: 1 << 12)

        static let share = _logLevel(rawValue: 1 << 13)

        static let guideline = _logLevel(rawValue: 1 << 14)

        static let calendar = _logLevel(rawValue: 1 << 15)

        static let refresh = _logLevel(rawValue: 1 << 16)

        static let location = _logLevel(rawValue: 1 << 17)

        static let all: _logLevel = [.critical, .major, .minor, .just, .graph, .current, .location, .fixing, .motion, .network, .network2, .layer, .json, .share, .guideline, .calendar, .refresh]

    }

 

class GS {

    

    static let s = GS()

    

    var totalScore : Int? = 0

    

    var logLevel: _logLevel = .current

 

 

if GS.s.logLevel == .motion { debugPrint("didSwipe Down") }

 

if GS.s.logLevel == .fixing {

 

 

if(!GS.s.logLevel.contains(.none)) {

 

 

나름 나의 고급 기술인데 오픈한다.

 

로그 레벨을 나눈 것과 아닌 프로젝트의 차이는 트러블슈팅에서 천지차이.

 

 

 

list4c = getCentaur()

currentAnimal = list4c[row].name?.description ?? ""

 

ORM 은 정말 편하다. Objective-C에서는 sql을 직접 다루느라 힘들었는데 말이다.

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

agreements  (0) 2021.05.29
swift log level  (0) 2021.05.28
tableview 에 button 삽입 후 title 가져오기  (0) 2021.05.23
한 번은 사용해 봐야할 iOS 기술 스택  (0) 2021.05.21
Snapkit 실무 코드  (0) 2021.05.20

let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as! HomeTableViewCell

        cell.selectionStyle = .none

        let image = UIImage(named:"twodimg_"+"\(indexPath.row+1)")

        cell.feedImageView.image = image

 

        let button = UIButton(frame: CGRect(x: 0, y: 0, width: cellFrame.width, height: cellFrame.height))

        button.setTitle("fff", for: .normal)

        button.titleLabel?.layer.opacity = 0.0;

        button.addTarget(self, action: #selector(onClickCheck(_:)), for: .touchUpInside)

        cell.addSubview(button)

        

        return cell

 

debugPrint("title is", (sender as? UIButton)?.titleLabel?.text)

 

기본 코드다. 이미지만 쓰는 테이블 뷰를 만들고 데이터를 title 로 보내는 것을 만들고 있다. button에 extension을 달아도 되지만 title자체를 쓰지 않으니 타이틀을 텍스트에 실어 보내는.

이미지 번호를 row로 세팅하는 것처럼 객체 배열 번호를 넣어주면 된다.

인터넷 보니 tag 밖에 없어 int 만 전달할 수 없으니 내가 만드는 제품에는 불편해서 생각해 본 아이디어.

https://haningya.tistory.com/33

 

뱅크 샐러드는 어떤 라이브러리를 쓸까?(iOS 유용한 라이브러리)

많고 많은 라이브러리~ 뱅크 샐러드를 쓰다가 재밌는 걸 발견했다ㅋㅋㅋ 개인설정 --> 오픈소스 라이센스 이용고지 --> 스크롤 하면 채용정보가 나타난다ㅋㅋㅋ 커여운 이모티콘과 함께 뱅크 샐

haningya.tistory.com

Alamofire 

AlignedCollectionView

FlowLayout 

Async 

Carte 

ChameleonFramework/Swift 

CSV.swift Firebase/Core 

Firebase/Database 

JTAppleCalendar 

KakaoLink 

NVActivityIndicatorView 

ObjectMapper 

PinLayout 

RealmSwift 

RLMRealm 

RxCocoa 

RxSwift 

SnapKit 

SQLite 

SwiftyJSON 

Then

SnapKit 으로 실무 변환 코드를 써 놓으니 아마 도움 되실 분이 계실 것 같다.




Code 로 View 를 그리기 위한 필수 Pod 이다. SnapKit을 이용하면 코드량이 줄고 가독성이 좋아진다. pod 'SnapKit' 설치 후, import SnapKit 이면 코드 전환이 가능하다.

 

NSLayoutConstraint.activate([

            btnAddDefect.widthAnchor.constraint(equalToConstant: 64),

            btnAddDefect.heightAnchor.constraint(equalToConstant: 64),

            btnAddDefect.leadingAnchor.constraint(equalTo: self.mainView.leadingAnchor, constant: 8),

            btnAddDefect.bottomAnchor.constraint(equalTo: bottomView.topAnchor, constant: -8),

        ])

 

이 코드를 SnapKit을 이용하여, 간결하며 보다 나은 가독성의 코드로 바꿀 수 있다.

 

btnAddDefect.snp.makeConstraints {

            $0.width.equalTo(64)

            $0.height.equalTo(64)

            $0.left.equalTo(self.mainView.snp.left).offset(8)

            $0.bottom.equalTo(bottomView.snp.top).offset(-8)

        }

 

 

Tip : 다국어 적용이 아니면, leading 보다 left를, trailing보다 right를 쓰는 것이 좋다. leading/trailing 의 경우 오른쪽에서 왼쪽으로 쓰는 언어(히브리어, 아랍어) 인 경우 우측 정렬을 우선시 하게 해 준다.

 

그 외 변환 된 다양한 실무 코드를 보자.

 

NSLayoutConstraint.activate([
           slider.widthAnchor.constraint(equalToConstant: 256),
           hjhSlider.heightAnchor.constraint(equalToConstant: 30),
           hjhSlider.leadingAnchor.constraint(equalTo: minusImage.trailingAnchor, constant: 12),
           hjhSlider.trailingAnchor.constraint(equalTo: plusImage.leadingAnchor, constant: -12),
           hjhSlider.centerYAnchor.constraint(equalTo: viewAngleLabel.centerYAnchor),
        ])
      hjhSlider.snp.makeConstraints {
            $0.width.equalTo(256)
            $0.height.equalTo(30)
            $0.left.equalTo(minusImage.snp.left).offset(12)
            $0.right.equalTo(plusImage.snp.right).offset(-12)
            $0.centerY.equalTo(viewAngleLabel.snp.centerY)
        }



NSLayoutConstraint.activate([
            minusImage.widthAnchor.constraint(equalToConstant: 16),
            minusImage.heightAnchor.constraint(equalToConstant: 2.7),
            minusImage.leadingAnchor.constraint(equalTo: viewAngleLabel.trailingAnchor, constant: 4),
            minusImage.centerYAnchor.constraint(equalTo: viewAngleLabel.centerYAnchor),
        ])
        

minusImage.snp.makeConstraints {
            $0.width.equalTo(16)
            $0.height.equalTo(2.7)
            $0.left.equalTo(viewAngleLabel.snp.right).offset(4)
            $0.centerY.equalTo(viewAngleLabel.snp.centerY)
        }

Tip : 레거시 코드 수동 변환 시에는 ^⌘T 로 옆에 탭을 하나 더 열고 작업하는 것이 좋다.

 

NSLayoutConstraint.activate([
            plusImage.widthAnchor.constraint(equalToConstant: 16),
            plusImage.heightAnchor.constraint(equalToConstant: 16),
            plusImage.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -12),
            plusImage.centerYAnchor.constraint(equalTo: viewAngleLabel.centerYAnchor),
        ])
plusImage.snp.makeConstraints {
            $0.width.equalTo(16)
            $0.height.equalTo(16)
            $0.right.equalToSuperview().offset(-12)
            $0.centerY.equalTo(viewAngleLabel.snp.centerY)
        }

Tip : 상위 뷰가 self.view라면 .equalToSuperview를 쓸 수 있다.



NSLayoutConstraint.activate([
            dropDown.heightAnchor.constraint(equalToConstant: 32),
            dropDown.leadingAnchor.constraint(equalTo: self.mtkView.leadingAnchor, constant: 8),
            dropDown.trailingAnchor.constraint(equalTo: self.mtkView.trailingAnchor, constant: -8),
        ])
dropDown.snp.makeConstraints {
            $0.height.equalTo(32)
            $0.left.equalToSuperview().offset(8)
            $0.right.equalToSuperview().offset(-8)
        }





NSLayoutConstraint.activate([
            viewAngleLabel.widthAnchor.constraint(equalToConstant: 30),
            viewAngleLabel.heightAnchor.constraint(equalToConstant: 24),
            viewAngleLabel.leadingAnchor.constraint(equalTo: self.mtkView.leadingAnchor, constant: 12),
            viewAngleLabel.bottomAnchor.constraint(equalTo: self.mtkView.bottomAnchor, constant: -8),
        ])
viewAngleLabel.snp.makeConstraints {
            $0.width.equalTo(30)
            $0.height.equalTo(24)
            $0.left.equalToSuperview().offset(12)
            $0.bottom.equalToSuperview().offset(-8)
        }





NSLayoutConstraint.activate([
            hjh_currentLocation.widthAnchor.constraint(equalTo: self.mtkView.widthAnchor, multiplier:0.4),
            hjh_currentLocation.heightAnchor.constraint(equalToConstant: 32),
            hjh_currentLocation.leadingAnchor.constraint(equalTo: self.mtkView.leadingAnchor),
            hjh_currentLocation.topAnchor.constraint(equalTo: emptyView.bottomAnchor)
        ])
        hjh_currentLocation.snp.makeConstraints({ (ConstraintMaker) in
            ConstraintMaker.width.equalTo(view.frame.width * 0.4)
            ConstraintMaker.height.equalTo(32)
            ConstraintMaker.left.equalToSuperview()
            ConstraintMaker.top.equalTo(bottomView.snp.bottom)
        })




파일 설치

  • python opencv/platforms/ios/build_framework.py ios
  • python opencv/platforms/ios/build_framework.py ios --contrib opencv_contrib
  • python opencv/platforms/ios/build_framework.py ios --contrib opencv_contrib --iphoneos_archs arm64 --iphonesimulator_archs x86_64



- (IBAction)onClickSegmentedControl:(id)sender {

    self.mNmTppg=@"";

    if(self.mDokkaebi.selectedSegmentIndex ==0) {

        mCanYouSeeThisSword = @"H";

    } else if(self.mDokkaebi.selectedSegmentIndex ==1) {

        mCanYouSeeThisSword = @"P";

    }

    [self initializeData];

}




 HPQualityControl2 *v = [[HPQualityControl2 alloc] initWithNibName:@"HPQualityControl2" bundle:[NSBundle mainBundle]];

        if(self.mDokkaebi.selectedSegmentIndex ==0) {

            v.previousSegment = false;

        } else if(self.mDokkaebi.selectedSegmentIndex ==1) {

            v.previousSegment = true;

        }

            if(self.mDokkaebi.selectedSegmentIndex ==0) {

                v.mNm_tppg = _mCdTppg; } else {

                                v.mNm_tppg = _mNmTppg;

                }



  if(self.mDokkaebi.selectedSegmentIndex ==0) {

            [mLblHosh setText:[NSString stringWithFormat:@"→%@ %@호(%@)→%@%ld건", dongNm, nohs, tppgCd, mvin, (long)cntB]];

            [GlobalVar saveToUserDefaults:tppgCd forKey:@"HP_CD_TPPG"];

            } else if(self.mDokkaebi.selectedSegmentIndex ==1) {




'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

한 번은 사용해 봐야할 iOS 기술 스택  (0) 2021.05.21
Snapkit 실무 코드  (0) 2021.05.20
POD  (0) 2021.05.20
List  (0) 2021.05.18
UINavigationBar  (0) 2021.05.18

iOS에서 지난 10년간 히스토리로 POD은 필수가 되어 버렸다.

 

junhoha  ~/Documents/Github/takeTouch   main  pod init
 junhoha  ~/Documents/Github/takeTouch   main  pod install
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `Touch.xcworkspace` for this project from now on.
Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed.

[!] The Podfile does not contain any dependencies.

[!] Automatically assigning platform `iOS` with version `13.0` on target `Touch` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
 junhoha  ~/Documents/Github/takeTouch   main ●

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

Snapkit 실무 코드  (0) 2021.05.20
iOS용 openCV 라이브러리 나왔으면 좋겠다.  (0) 2021.05.20
List  (0) 2021.05.18
UINavigationBar  (0) 2021.05.18
오늘자 troubleshooting  (0) 2020.04.08

 

TableView 만들기 (Swift + Storyboard)

다수의 Xib가 합쳐진 것이 스토리보드(Storyboard)이므로 Objetive-C 와 완전히 동일하다. Objective-C에서와 같이 테이블 뷰를 만들고 뷰 컨트롤러에 추가한다.

 

var dataTblDong = [String]()
var dataTblTppg = [String]()
@IBOutlet weak var mDongTable: UITableView!
@IBOutlet weak var mTypeTable: UITableView!

 

중요한 것은 바뀐 코드 형식이다. 테이블 2개를 만드는 실무 코드를 살펴보자.

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    if tableView == self.mDongTable {
        return self.dataTblDong.count
    } else if tableView == self.mTypeTable {
        return self.dataTblTppg.count
    }
    return 1
}

데이터를 담을 전역 변수, 혹은 멤버 변수로 빼고 해당 변수의 개수로 리스트 항목(table rows)개수를 반환한다.

 

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = UITableViewCell()

셀은 코드 내부에서 정의 할 수 있다.


UITableViewCell

UITableViewCell 클래스 원형은 다음과 같다.

open class UITableViewCell : UIView, NSCoding, UIGestureRecognizerDelegate {
.
.
.

    // These properties will always return nil when a non-nil `contentConfiguration` is set.
    @available(iOS, introduced: 3.0, deprecated: 100000, message: "Use UIListContentConfiguration instead, this property will be deprecated in a future release.")
    open var imageView: UIImageView? { get } // default is nil.  image view will be created if necessary.

    @available(iOS, introduced: 3.0, deprecated: 100000, message: "Use UIListContentConfiguration instead, this property will be deprecated in a future release.")
    open var textLabel: UILabel? { get } // default is nil.  label will be created if necessary.

    @available(iOS, introduced: 3.0, deprecated: 100000, message: "Use UIListContentConfiguration instead, this property will be deprecated in a future release.")
    open var detailTextLabel: UILabel? { get } // default is nil.  label will be created if necessary (and the current style supports a detail label).
.
.
.

기본적으로 이미지뷰, 텍스트라벨, 세부 텍스트라벨을 가지고 있다. 이에, 따로 추가 없이 텍스트를 지정할 수 있다.

 

    let obj = self.dataTblDong[indexPath.row]
     cell.textLabel?.text = obj

 

텍스트를 지정하고 셀(cell) 을 리턴(return)하면 바로 텍스트를 볼 수 있다. 셀에 다양하게 속성 적용도 가능하다. 

    cell.backgroundColor = .white
    cell.textLabel?.textColor = .darkGray
    cell.selectedBackgroundView?.backgroundColor = .red
    cell.selectedBackgroundView?.tintColor = .blue
    if cell.description != nil { }

 

TIP! : 보다 자세한 내용은 UITableViewCell에서 cmd+option+0 키를 눌러 해당 함수에 대한 빠른 도움(Quick Help)을 보는 것이다. 가장 아래 Open in Developer documentation 링크를 따라가면 Xcode 에서 바로 사용법을 확인할 수 있다.

 

테이블이 2개인 경우 if 문으로 cell 을 세팅한다.

    if tableView == self.mDongTable{
        let obj = self.dataTblDong[indexPath.row]
        cell.textLabel?.text = obj


UIButton

기본으로 제공되는 ImageView를 이용하지 않고 버튼을 삽입 하려면 이미지 사이즈 조절 extension이 필요하다. cell 내부 이미지 사이즈 조절을 위한 extension 이다.

 

extension UIImage {

    func imageResize (sizeChange:CGSize)-> UIImage{
        let hasAlpha = true
        let scale: CGFloat = 0.0 // Use scale factor of main screen

        UIGraphicsBeginImageContextWithOptions(sizeChange, !hasAlpha, scale)
        self.draw(in: CGRect(origin: CGPoint.zero, size: sizeChange))
        let scaledImage = UIGraphicsGetImageFromCurrentImageContext()
        return scaledImage!
    }
}

https://stackoverflow.com/questions/24709244/how-do-set-a-width-and-height-of-an-image-in-swift

 

UIImage에 붙는 extension 이므로 사용법은 간단하다.

let imgUnChecked = UIImage(named: "hjh_icon_checkbox_none")?.imageResize(sizeChange: CGSize.init(width: 30, height: 30))
let imgChecked = UIImage(named: "hjh_icon_checkbox_checked")?.imageResize(sizeChange: CGSize.init(width: 30, height: 30))



이를 활용하여 다음과 같이 이미지 세팅된 버튼을 삽입 해보자.

      let imgUnChecked = UIImage(named: "hjh_icon_checkbox_none")?.imageResize(sizeChange: CGSize.init(width: 30, height: 30))
        let imgChecked = UIImage(named: "hjh_icon_checkbox_checked")?.imageResize(sizeChange: CGSize.init(width: 30, height: 30))
        
        let btn = UIButton(frame: CGRect(x: 10, y: 10, width: 30, height: 30))
        btn.addTarget(self, action: #selector(customCellButtonTapped), for: .touchUpInside)
        
        btn.setImage(imgUnChecked, for: .normal)
        btn.setImage(imgChecked, for: .selected)
        btn.imageEdgeInsets = UIEdgeInsets(top: 1, left: 6, bottom: 5, right: 2)
        btn.tag = 0
        cell.contentView.addSubview(btn)

 

다른 테이블도 동일하게 적용 가능하다.

        
    } else if tableView == self.mTypeTable
    {
        let obj = self.dataTblTppg[indexPath.row]
        cell.textLabel?.text = obj
        let imgUnChecked = UIImage(named: "hjh_icon_checkbox_none")?.imageResize(sizeChange: CGSize.init(width: 30, height: 30))
        let imgChecked = UIImage(named: "hjh_icon_checkbox_checked")?.imageResize(sizeChange: CGSize.init(width: 30, height: 30))
        let btn = UIButton(frame: CGRect(x: 10, y: 10, width: 30, height: 30))
        btn.addTarget(self, action: #selector(customCellButtonTapped2), for: .touchUpInside)
        btn.imageView?.contentMode = .scaleAspectFit
        btn.setImage(imgUnChecked, for: .normal)
        btn.setImage(imgChecked, for: .selected)
        btn.frame = CGRect(x: 0, y: 0, width: 44, height: 44)
        btn.imageEdgeInsets = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
        btn.tag = 0
        cell.contentView.addSubview(btn)
    }
    return cell
}

 

TIP! : 필자의 경험상 개발 초기에 UI 관련해서는 중복 코드를 놔두는 것이 좋다. 메소드 추출(Extract Method)을 이용하여 공통 부분을 리팩토링(Refactoring) 한 이후, 개발에서 세부적이고 개별적인 수정 사항에 대해 빠른 대응이 어려워진다. 왜냐면 추출된 공통 부분에서 또 공통 모듈이 추출되기 때문이다. 협업을 하다보면, 최종적으로 하나의 기능만 하는 모듈만 따로 분리되어 재 사용성을 높히는데 의견이 모아진다. 그러나 커스텀 UI와 관련된 부분은 UI Guide Line 이 없는 경우 공통 Method 로 빼는 것을 가장 마지막에 할 작업으로 넘기는 것이 좋다. 최종 코드에서 완벽히 공통된 코드를 D&D 와 메소드로 추출 기능 한 번이면 손쉽게 리팩토링이 가능하다. 그럼에도 불구하고 앱개발 경험이 별로 없이 아키텍트라고 하는 사람들이 앱 코드 수정은 하지 않고 코드 리뷰로 일반적이고 상식적이며 뻔히 알고 있는 이야기로 개발이 된 후, 다시 지속적인 변경된 요구사항 받을 때는 결국 상품과 끝 단의 개발자만 홀로 남게 된다. 재 사용성을 높히고자 했던 많은 작업 때문에 공통 코드의 공통 코드를 따라가며 연결된 파라미터를 다시 코드로 펼치는 작업을 하는 경우가 태반이었다. 매우 아랫단(low level)의 코드를 구현 할 때는 for문을 쓰는 것과 똑같은 코드를 펼치는 작업이 CPU 파이프라인을 타는 부분도 다를 경우가 있어서 reset이 되는 문제가 있었다. Application 단에서 그런 경우를 접하거나 어셈블리 코드로 코드의 형평성을 따질 필요는 없지만 요구 사항에 기민하게 대응하는 것이라면 오히려 경험 많은 개발자의 말을 따르는 편이 좋다. 앱 개발을 안다고 해서 API가 내려 간 그 하부단 운영체제 시스템콜의 시퀀스를 모두 고려할 것이 아니라면 말이다. 요약하자면, 코드 리팩토링은 가장 마지막에 하는 것이 맞다. 시장에서도 완전히 안정화 된 상태. 관련 라이브러리나 실행 시스템의 메이저 버전업은 예상되지 않는 상태. 인수인계 직전 등 내 손에서 코드가 떠나기 전인 마지막을 말한다.

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

iOS용 openCV 라이브러리 나왔으면 좋겠다.  (0) 2021.05.20
POD  (0) 2021.05.20
UINavigationBar  (0) 2021.05.18
오늘자 troubleshooting  (0) 2020.04.08
namedtuple  (0) 2020.04.08

 

 

[기초] Overview

Apple에서 정의하는 UI Navigation Bar의 정의는 화면 최상단의 스크린을 탐색바이다. 이해 쉬운 그림은 다음(https://developer.apple.com/documentation/uikit/uinavigationbar)과 같다. 

실무에서는 Navigation Bar를 없애고 Custom 하게 구성하는 경우가 대부분 이었다. iOS를 직접 만들지 않는 이상 앱 튜닝의 끝은 순정 API라는 말처럼 iOS 업데이트에 자동으로 맞춰주고, 테마(Theme)에 따라 자동 변하는 것의 구현. 정상적인 뷰컨트롤러라이프 사이클과 신기술에 기민하게 대응하기 위해 NavigationBar를 애플에서 제공하는 기본으로 유지하는 경우가 많아졌다. 그러나 여전히 legacy code에서의 사용률은 높기 때문에 기본적 사용법과 더불어 커스터마이징 하는 방법도 살펴본다. API를 소개할 때도 네비게이션 바를 혼용해서 사용되는 프로젝트에서 동작하는 코드를 예제로 실무에서 바로 적용이 가능토록 한다.


Basics

일반적으로 Android 에서 화면 구성 단위는 Activity 이고, iOS에서는 ViewController 이다. Android 에서 startActivity로 화면을 연결한다고 하면, iOS의 경우 pushViewController로 연결한다. 주의할 점은 Activity LifeCycle이던, ViewController LifeCycle 이던 임베디드 환경인 휴대폰에서는 Resource 보존에 더 취약하다는 것이다. 화면 실행 단위별로 세팅된 변수, 메소드 리턴값들이 화면이 바뀌었을 때 100% 그대로 유지된다는 보장은 하기 힘들다. 이 점을 간과하면 앱이 죽는데 이유를 찾지 못하는 경우가 많다. 이에, 안드로이드에서는 SharedPreferences를, iOS 에서는 UserDefaults를 적극 활용한다. SQLite3 로컬 DB 로 통일하기도 하지만 복잡한 모듈에서는 속도가 매우 느린다. 이런 기초를 미리 설명하는 이유는 화면 단위를 PUSH, POP 으로 저장하는 스택(stack)이라고 해도 해당 스택에서 튀어나온(pop) 액티비티 혹은 뷰 컨트롤러가 완벽하게 모든 자원(resource)를 가지고 있을 거라는 추측은 삼가해야 한다는 점이다. 필자는 안드로이드 플랫폼만 수년 간 만들다 앱 개발로 갔을 때 하부에서는 심각하게 고민하는 Resource leak 을 단순히 폰 문제로만 단정하는 경우를 많이 보았다. 그도 그럴 것이 프레임웍은 정적 분석이 필수인데 앱의 경우 다양한 이유로 정적 분석을 하지 않기 때문이었다. 다양한 이유 중 하나는 특별히 큰 기능이 없고, 복잡한 모듈의 경우 통합 플랫폼이나 엔진이라고 불리는 컴포넌트, 라이브러리, 서비스 등의 API 덩어리에 던져 버리기 때문이다. 이에, C/C++ 시니어 프로그래머가 앱 개발로 전직할 경우 가장 안정적인 앱을 만들 수 있다는 선입견이 있다.

UX 설계

인스타그램이 나온지 10년이 넘었는데 갤럭시 패드나, 아이패드 용 앱은 아직 화면이 작다. 즉, 전혀 맞지 않는다. 그럼에도 모바일 기획자라고 하면 모든 모바일 기기에 맞춰서 개발해야 한다는 UX 설계자를 만난다. 모바일 쪽에 깊은 지식이 있는 경우가 아니라 모바일 산업이 대세가 되니 갑자기 전직한 경우, 타블렛과 휴대폰은 화면 크기와 비율이 달라 UX 자체가 바뀌는데도 똑같이 보여야 한다는 생각을 가진 사람을 만난다. 심지어 facebook도 초창기엔 Android와 iOS UI를 다르게 갔었는데 그 사용경험(UX)은 동일하게 유지하였었다. Android와 iOS 모두 각 회사만의 철학이 있다. 그러나 하이브리드 앱을 제창하며 모두 회사가 정한 같은 디자인 이어야 한다는 생각이 있는 것 같다. 그 정도의 생각이 있다면, 운영체제도 만들고 성공한 모바일 폰 개발도 직접 하면 좋겠다는 생각이 많이 든다. 휴대폰 회사에서 제공하는 기본 API로 만들어야 운영체제 자체가 업그레이드 되었을 때 바뀐 UI 컨셉으로 앱의 통일성을 유지할 수 있다. 이 몇 줄 안되는 지식을 몰라 출발점부터 어긋나는 경우가 많았다. 그리고 iOS의 경우 화면 호출 방식이 다음과 같은 stack 방식이다.

 

즉, 유저 화면 이동을 고려할 때 TREE 형태로 구성하고 화면을 노드로 하면 유저 경로 탐색은 DFS를 먼저 고려해야 한다는 것이다. 굳이 정의하지 않아도 모든 ViewController는 NavigationBar를 기본 장착하고 있기 때문에 self 예약어로 접근 가능하다.


API

Swift_커스텀 네비게이션바

처음부터 모든 앱을 만든다면 네비게이션 바 관련 코드는 애플 개발자 사이트 혹은 스택오버플로만 참고하면 된다. 그러나 이미 커스텀네비게이션 바를 사용하는 경우 새로운 ViewController를 삽입할 때는 동작 코드가 궁금해 진다. 커스텀 네비게이션 바를 쓰는 뷰에 다음과 같이 viewWillAppear, viewWillDisappear 이벤트 콜백에 각각 해당 코드를 넣어, 커스텀 네비게이션 바를 유지 해준다.

 

override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(true)
        self.navigationController?.navigationBar.isHidden = true
}



override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(true)
        self.navigationController?.navigationBar.isHidden = false
}


기본 네비게이션바 장착한 VC

스토리보드에 새로운 뷰를 만들고 연결한 뷰 컨트롤러에서 네비게이션 바를 달기 위한 코드를 살펴본다.

우선, 네비게이션바의 숨김 속성을 false로 해야 한다. 이번에는 메소드를 이용해 보자.

self.navigationController?.setNavigationBarHidden(false, animated: true)

 

제목 내용 변경 코드는 다음과 같다.

self.navigationItem.title = "First View Title"





navigationController?.setNavigationBarHidden(false, animated: true)

 

override func viewDidLoad() {

        super.viewDidLoad()

        self.navigationController?.navigationBar.isHidden = false

}




backItemTitle Icon changing

 

override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(true)
        
        let button1 = UIBarButtonItem(
            image:  imageLiteral(resourceName: "arrowThinRight"),
            style: .plain,
            target: self,
            action: #selector(self.backBtnTapped(_:))
        )
        self.navigationItem.leftBarButtonItem  = button1
    }
    
    @objc func backBtnTapped(_ sender: UIBarButtonItem) {
        self.navigationController?.popViewController(animated: true)
    }





http://minsone.github.io/programming/ios-custom-imageliteral-on-framework-bundle

imageLiteral



[실전] Obj-C_커스텀 네비게이션바

 

self.title = @"HP 점검";



    UIButton *back = [UIButton buttonWithType:UIButtonTypeCustom];
    UIImage *imgUp = [UIImage imageNamed:@"backward_arrow.png"];
    [back setBackgroundImage:imgUp forState:UIControlStateNormal];
    [back addTarget:self action:@selector(cancel:) forControlEvents:UIControlEventTouchUpInside];
    back.frame = CGRectMake(0, 0, imgUp.size.width, imgUp.size.height);
    UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithCustomView:back];
    self.navigationItem.leftBarButtonItem = cancelButton;



- (void)cancel:(id)sender
{
    [self.navigationController popViewControllerAnimated:NO];
}



'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

POD  (0) 2021.05.20
List  (0) 2021.05.18
오늘자 troubleshooting  (0) 2020.04.08
namedtuple  (0) 2020.04.08
python.c  (0) 2020.04.08

오늘자 troubleshooting

byHAJUNHOJul 17. 2018

관련 강의가 있어 우선, 환경 세팅을 진행하였다. VMWARE에 UBUNTU 18.04 설치.

같은 컴퓨터에서 20명 우분투 환경 설정하는데 버그가 이렇게 다양하게 나오는지 황당했다.

 

VTx Enabling 문제

-> hp elite 8300은 특이하게 Security -> System Security에 해당 옵션이 들어 있어서 황당. 보통은 CPU 혹은 system 의 Advanced Setting에 들어있는데 말이다. 본디 가상화 메뉴가 바이오스 버전인 줄 알고 2013 버전 바이오스를 2018 버전으로 업데이트까지 했었음 ㅠㅠ

 

네트워크가 막힌 상태에서 VMWARE player 14 설치가 안 되는 버그

-> 14 버전에서 설치 시 네트워크로 뭘 체크하나 봄. vmware player 12 버전으로 해결

 

ubuntu 18.04에서 lock 파일로 apt 동작 안 하는 문제

-> 백그라운드에서 자주 쓰나? lock파일 삭제(캐시 폴더에서도 삭제)로 해결

 

네트워크 연결 후 apt-get 실행 시 모두 같은 환경인데 몇몇만 실행 안 되는 문제

-> 동일 IP에서 너무 많은 요청이라 막는 듯. /etc/apt/sources.list에서 us.ubuntu블라블라를 kr.ubuntu로 모두 수정하여 해결

 

build-essential 설치를 못하는 문제 및 기타

-> 리눅스의 bash shell이 어색한 친구들 문제. history 보고 하나씩 해결

 

모두 LOG가 남는 문제라 쉬운 troubleshooting.

 

LOG 남겨

아래 명령어는 알아두자~

https://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/ 

25 Useful Basic Commands of APT-GET and APT-CACHE for Package Management

www.tecmint.com

 

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

List  (0) 2021.05.18
UINavigationBar  (0) 2021.05.18
namedtuple  (0) 2020.04.08
python.c  (0) 2020.04.08
decision science - 2  (0) 2020.04.08

from collections import namedtuple
# or
import collections

param4tuple = ['name', 'age', 'sex', 'address', 'phoneNumber']
personcardskim = namedtuple('whatever1', param4tuple, defaults=(None,) * len(param4tuple))
person001 = personcardskim('Eddie')
print('person001 =', person001)

personcardskim2 = namedtuple('whatever2', 'name age sex address phoneNumber')
person002 = personcardskim2('joe', '34', 'male', 'korea', '01022223333')

print('person002 =',  person002)

difficultTuple = namedtuple('whatever3', ['name', 'age', 'sex'])
person003 = difficultTuple('helloman', '18', 'male')
print('person003 = ', person003)

importTuple = collections.namedtuple('whatever4', 'name age sex', defaults=(None,) * 3)
person004 = importTuple('haha')
print('person004 = ', person004)

 

 

 

 


 

person001.name

Out[3]: 'Eddie'

person002.name

Out[4]: 'joe'

person003.name

Out[5]: 'helloman'

person004.name

Out[6]: 'haha'

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

UINavigationBar  (0) 2021.05.18
오늘자 troubleshooting  (0) 2020.04.08
python.c  (0) 2020.04.08
decision science - 2  (0) 2020.04.08
지금 최고의 AI 스피커는?  (0) 2020.04.08

파이썬 답다.

 

/* Minimal main program -- everything is loaded from the library */

 

#include "Python.h"

 

extern DL_EXPORT(int) Py_Main(intchar **);

 

int

main(int argc, char **argv)

{

 return Py_Main(argc, argv);

}

 

 

 

헤더는

 

#ifndef Py_PYTHON_H

#define Py_PYTHON_H

/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */

 

 

/* Enable compiler features; switching on C lib defines doesn't work

   here, because the symbols haven't necessarily been defined yet. */

#ifndef _GNU_SOURCE

# define _GNU_SOURCE1

#endif

 

/* Forcing SUSv2 compatibility still produces problems on some

   platforms, True64 and SGI IRIX begin two of them, so for now the

   define is switched off. */

#if 0

#ifndef _XOPEN_SOURCE

# define _XOPEN_SOURCE500

#endif

#endif

 

/* Include nearly all Python header files */

 

#include "patchlevel.h"

#include "config.h"

 

#ifdef HAVE_LIMITS_H

#include <limits.h>

#endif

 

/* config.h may or may not define DL_IMPORT */

#ifndef DL_IMPORT/* declarations for DLL import/export */

#define DL_IMPORT(RTYPE) RTYPE

#endif

#ifndef DL_EXPORT/* declarations for DLL import/export */

#define DL_EXPORT(RTYPE) RTYPE

#endif

 

#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)

#define _SGI_MP_SOURCE

#endif

 

#include <stdio.h>

#ifndef NULL

#   error "Python.h requires that stdio.h define NULL."

#endif

 

#include <string.h>

#include <errno.h>

#ifdef HAVE_STDLIB_H

#include <stdlib.h>

#endif

#include <assert.h>

 

#include "pyport.h"

 

#include "pymem.h"

 

#include "object.h"

#include "objimpl.h"

 

#include "pydebug.h"

 

#include "unicodeobject.h"

#include "intobject.h"

#include "longobject.h"

#include "floatobject.h"

#ifndef WITHOUT_COMPLEX

#include "complexobject.h"

#endif

#include "rangeobject.h"

#include "stringobject.h"

#include "bufferobject.h"

#include "tupleobject.h"

#include "listobject.h"

#include "dictobject.h"

#include "methodobject.h"

#include "moduleobject.h"

#include "funcobject.h"

#include "classobject.h"

#include "fileobject.h"

#include "cobject.h"

#include "traceback.h"

#include "sliceobject.h"

 

#include "codecs.h"

#include "pyerrors.h"

 

#include "pystate.h"

 

#include "modsupport.h"

#include "ceval.h"

#include "pythonrun.h"

#include "sysmodule.h"

#include "intrcheck.h"

#include "import.h"

 

#include "abstract.h"

 

#define PyArg_GetInt(v, a)PyArg_Parse((v), "i", (a))

#define PyArg_NoArgs(v)PyArg_Parse(v, "")

 

/* Convert a possibly signed character to a nonnegative int */

/* XXX This assumes characters are 8 bits wide */

#ifdef __CHAR_UNSIGNED__

#define Py_CHARMASK(c)(c)

#else

#define Py_CHARMASK(c)((c) & 0xff)

#endif

 

#include "pyfpe.h"

 

/* These definitions must match corresponding definitions in graminit.h.

   There's code in compile.c that checks that they are the same. */

#define Py_single_input 256

#define Py_file_input 257

#define Py_eval_input 258

 

#ifdef HAVE_PTH

/* GNU pth user-space thread support */

#include <pth.h>

#endif

#endif /* !Py_PYTHON_H */

 

python은 C로 만들어 졌다.

 

 

https://www.python.org/downloads/source/

Python Source Releases for Source release

The official home of the Python Programming Language

www.python.org

 

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

오늘자 troubleshooting  (0) 2020.04.08
namedtuple  (0) 2020.04.08
decision science - 2  (0) 2020.04.08
지금 최고의 AI 스피커는?  (0) 2020.04.08
ML 학습 결과는 늘 같을까?  (0) 2020.04.08

 

 

통계 6 시그마 AHP 시뮬레이션... 뭘 과학적으로 분석한다는 도구는 참 많다. 인공지능도 그중 하나고.

 

이 매거진 처음에 쓴 글에서 가장 중요한 고려 인자는 햇볕을 좋아하는 x이고 100차원이던 200차원이던 그 x가 최상단에 위치하고 앞에 붙는 계수(가중치)에 관계없이 결정에 가장 큰 비중을 차지하는 거대한 고려 사항임에도 틀림이 없을 것이다. 그리고 그 상황은 데이터 전 처리하는 사람은 모르고 넘어갈 가능성이 크고 그냥 raw 데이터만으로 컴퓨터에게 돌려도 센서 데이터가 없어서 이미 누락되어 틀린 상태로 머신 러닝이 시작될 가능성이 크다.

 

그래서 이 매거진을 만들었다.

 

좀 더 쉽게 말하면,

 

인간은 분석될 만큼 단순하지가 않다는 뜻이다. 아마 300년 뒤에는 가능 할런지도 모른다. 그것도 모든 학문과 언어에 통달한 단 1명의 인간이 나와서 인공지능 평가 방법을 만들어 둔다는 가정하에.

 

얼마 안 되는 아르바이트비 가지고, 월급 몇 푼 가지고, 퇴직금 가지고, 사람 조정하려는 사람.

 

일전에 최저 시급 올라서 직원을 다 자를 수밖에 없었고, 죽음까지 결심했다는 사람이 SNS에 글을 올렸을 때 감성팔이 느낌이 나서 싫었다. 최저 시급도 못 줄 만큼 능력 없는 사람이 사업을 하는 것이라면, 당연히 그동안 아르바이트비 쥐어 짜내서 연명했을 것이라는 게 내 논리고, 그런 사람은 사업하지 말고 최저 시급 줄 수 있는 사람 밑에 들어가서 일해야 한다는 생각이다. 그리고 당장은 최저 시급을 불법으로 못 주더라도 따로 남아 있을 만한 대화가 가능한 종업원, 그런 커뮤니케이션이 가능할 정도로 정말 가족같이 생각한 사장이라면 아닌 사장이 다 망해서 경쟁이 줄어 곧 사정이 나아질 만큼 기다릴 수 있을 거라는 생각이다. 간단히 그냥 "가족"과 일한다고 생각하면 이해 쉬운 이야기. 그러나 "함께 일한다"가 아니라 "남의 밑에 들어간다는 생각"을 가진 만큼 사장과 일하는 사람을 나누는 인간 무리가 아예 이 사회에서 뿌리 뽑혀야 한다는 생각이었다. 최저 시급이 크게 오른 지 얼마 안 되었고 사람들의 원성이 자자했던 터라 내가 털릴 수도 있는 입장이었지만, 난 정말 시급 1700원에도 일해 봤었고 그렇게 한 달을 모아봤자 R차(바이크) 3번 빌리면 끝이었다.(그때 오토바이 너무 좋아했기에...) 지금은 어떨 땐 한 달 번 돈으로도 그때 빌리던 R차 3대를 살 수 도 있지만 그때 내 생활은 정말 라면이 전부였다.

 

https://www.youtube.com/channel/UCwx6n_4OcLgzAGdty0RWCoA

워크맨-Workman

��워크맨 인력소 상암점�� � NOW On-Air � [워크맨] 매주 금 오후 6시 ❤꿀잼영상 상시대기❤업계 최고 재미 보장❤ ✔청소.인력.식당.요리.철거.공장.물류 ✔그 외 모든 job것들 ✔200% 부려먹기 가능 ❌장난사절❌ ☎상세 비즈니스 문의☎ lululala.ad@jtb...

www.youtube.com

 

워크맨이라는 youtube가 있다. 정말 많은 일을 소개해 주는데 최저 시급만 주는 일도 많다. 법으로 정해 놓지 않았다면 무조건 그 밑으로 줬을 거라는 생각이다. 내 주변에도 사업하는 사람이 많아서 내가 이렇게 적어 두면 나중에 멀어질 사람들이 있다. 안타깝지만. 정말 최저의 생활을 조금이라도 경험해 본 사람이라면. 지금부터 내가 하는 말을 잘 들었으면 한다.

 

내 어머니는 평생 힘든 일만 하고 사셨고 지금도 그러시다. 최저 시급 도입되고 사람 많이 잘라내어서 힘든 일 하시는데 더 힘들어지셨다. 그리고 뽑는 사람들도 불법적으로 최저 시급 안 줄 수 있는 불법 체류 외국인들 뿐이라 말도 안 통해서 더 힘들어지셨다. 저번 달에도 150 정도 부쳐 드리긴 했지만 나도 월급쟁이고 아이를 키우고 있는 입장이라 나 역시 힘들다. 그러나 최근 구하신 직장에서 그나마 먹고살 수 있는 돈을 받으셨다.

 

어머니께서 현 정부 욕할 때에도 난 반박했다. 그렇다고 문재인이 알아 달라는 것은 아니다. 난 일단 바른말한다. 그게 어머니께서 내가 가르쳐 주신 부분이고 내 기억력이 이 나이가 되어도 좋다는 이야기를 듣는 것은 현실과 타협하며 끊임없이 자신을 속이지 않았기 때문이라는 믿음 때문이다. 그래서 그나마 선방하면서 살아갈 수 있다. 그리고 어머니를 단 한 번도 부끄럽다고 생각해 본 적이 없고 숨길 것도 없기에 내 모든 이야기들은 SNS에 늘 올리고는 했다. 어머니와 유튜브 찍기도 했고. 그만큼 남의 삶도 함부로 이야기하지 않는다. 그래서 이 글에 쓸 수 있다.

 

밤샘 개발하다 보면 밤에 나와 밤새도록 청소하시고 아침에 퇴근하시는 아주머니를 본다. 기업에 아무리 오래 일해도 못 만날 분들이다. 그분들이 몇 개월마다 교대를 하고 어떤 어려움이 있는지 대화 한 번 나눠볼 사람은 기업에 일하는 사람 중에도 몇 없다. 그러나 기업의 대표는 뭐 온갖 어려움 겪고 스트레스받는 것처럼 해서 나중에 큰돈 들어왔을 때 자기 몫은 95% 나머지 모두는 5%로만 해도 크게 생각한다.

 

당신들 없으면 오뚝이 회장 같은 사람이 경쟁 안 하고 독점해서 더 좋은 세상을 만들어도 된다. 그래서 난 한편으로는 사회주의 공산주의를 옹호한다. 그러나 이미 체재 경쟁에서 민주주의가 이겨버린 이유는 어떤 놈이던 그 자리에 가면 대부분 더러운 독재자가 되어 버리는 게 99% 기 때문이다. 주변에서 쉽게 볼 수 있는 졸부만 봐도 그렇다.  그런 졸부들의 결정에는 늘 과학적 근거를 붙인다. 무슨 ㅂㅅ 같은 계산식을 들이대고 말이다.

 

 

최근 타다 뿐 아니라 배달업에 종사하시는 분들의 정차 시간을 계산하는 솔루션이 자주 보인다. 내가 7년 전 삼성전자 본사 재직 시절 중소기업 사장님들을 위해 기획하고 진행했었던 교육이 있는데 그때 이미 삼성 로지텍에서 해당 솔루션을 보았었다. 시간이 꽤 흐르면 그런 솔루션은 사라지겠지 했는데 이제 어느 곳에서나 볼 수 있다. 난 중요한 것은 실적이라고 생각한다. 그런 솔루션을 보유한 기업에서 종사하는 사람들은 재택근무는 있어서도 안되고, 의자에 센서 달아서 그냥 의자에 얼마나 오래 앉아 있었는지를 평가해야 한다고 생각한다.

 

만약 그런 시스템을 만든다고 해도 만든 사람과 운영하는 사람들은 비밀 서약서를 쓰고 그 데이터는 정말 너~무 심하게 일 안 하는 사람을 골라서 면담 대상자로 올릴 때만 쓰도록 해야 한다.

 

고속도로에서 사고 나면 그 누구도 멈추지 않는데 그나마 덤프트럭이나 큰 화물차 운전하시는 분이 사람들을 많이 돕는다고 한다. 내가 운전자고 내 정차 시간을 감시하는 시스템이 있다면 처음엔 사람 도와주겠지만, 저런 차가운 시스템을 돌리는 회사는 뭔가 항의할 피드백 시스템이 없을 것이다. 그래서 나중에는 점점 도와주지 않을 것이다. 

 

피드백이 있다고? 있으면 아마 본인 인증해야 할 것이고 본인 인증 다 하면 팝업 차단되었다고 할 것이다. 팝업 풀고 처음부터 다시 인증받으면 무슨 프로그램을 설치하라고 할 것이고 프로그램 다 설치하고 나면 알 수 없는 오류로 종료되겠지. 그렇게 피해 본 사람들은 이야기할 힘이 없는 게 아니라 채널이 없다. 난 이런 류의 시스템을 만들고 인간보다 낫다며 진보시키지 않는 결정들이 싫다. 실적이 나오고 돈이 벌리면 피드백을 돌아보기보다 그 실적으로 번 돈으로 회식하는 똑같은 삶의 방식, 문화가 싫다. 모바일에다가 트렌디한 일을 하다 보니 그렇게 생각하는 사람들과 요즘엔 일일이 싸우기 귀찮고 말 섞기도 싫어서 이 매거진을 만들었다. 상종하기 싫어서 말 안 하는 사람들을 호구로 생각하는 사람들이 읽었으면 해서 말이다.

 

이 매거진은 평범한 사람들의 대변인 노릇을 해 줄 거라고는 생각지 않는다. 이런 부분에서는 워낙 기분파이기도 해서 수만의 조회수가 나오는 글도 쉽게 지운적이 있다는 것은 오랜 구독자 혹은 떠난 구독자들이 잘 알고 있다. 물론, 내가 싫어서 떠나는 것이 아니라 본인의 삶의 순간순간들이 중요하다는 취지로 늘 쓰기 때문이다.

 

내가 계속 그리고 지우며 앞으로 나가는 이유는 독립운동으로 우리나라를 지키셨던 수많은 독립투사, 의사, 열사가 남겨주신 보물에 대한 작은 보답이기도 하다. 그분들께서 그런 의사 결정을 하고 수많은 졸부들은 이름을 남기지도 못하는데 돈도 없이 지금까지도 남을 이름을 남긴 그 의사 결정에 대해서는 어떤 과학적 근거를 들이댈 수 있는가?

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

namedtuple  (0) 2020.04.08
python.c  (0) 2020.04.08
지금 최고의 AI 스피커는?  (0) 2020.04.08
ML 학습 결과는 늘 같을까?  (0) 2020.04.08
텔레그램은 해킹 가능할까?  (2) 2020.04.08

나이가 들면 약간 애매한 선에 서는 것이 사는 게 편하다. 그러나 할 말은 하고 살아야 한다. 이번 글은 약간 일기 형식으로 적어야 겠다.

 

처남에게는 미안하지만 SK NUGU는 좀 아닌 것 같았다. 그러나 처남에게 줄 때는 카카오 스피커보다는 낫다고 생각해서 줬다.

 

https://youtu.be/fOs7-zHq01I

 

이 동영상이 그 증거라 하겠다. 조용히 말해도 안되어서 아이가 먼저 스피커에 달라 붙었고, 온 가족이 다 달라 붙은 경우. 내가 개그 포인트를 넣었을 때 부터 찍어 재미있는 영상. 앞 부분을 안 잘랐으면 완전한 디스였겠지.

 

그러나 2020년이 된 지금은 최고의 AI 스피커라고 말하고 싶다.

 

3일 전 만나 배 아플 때까지 같이 고기를 처묵 한 학교 후배가 카카오 브레인이 있어서 카카오 이야기를 하는 것은 아니다. 난 가족에게 까지도 할 말은 하고 산다. 그러나 확실히 지금은 최고의 AI 스피커이다. 그래서 집에 2개 내 숙소에 1개 고장 나면 바로 바꿀 1개를 보유 중이다. 뭐, 일부러 많이 산 것은 아니다. 난 뭘 사도 늘 2개 이상을 산다. 키보드(리얼포스임에도 2개)나 마우스(로지텍 여러 개), 신발도 2개 이상 씩... 병은 아니고 버는 돈이 일 년에 억이 넘어가면 작은 물건에는 뭘 사고 그 물건 때문에 뭔가 지체되는 게 돈이 더 아까워서.

 

카카오미니C AI 블루투스스피커

-37% 49,000원, 무료배송. 리뷰 4.7점, 42개

ohou.se

 

이 쇼핑몰은 당연히 아는 곳이 아니다. 그냥 인터넷 검색해서 나와서 그냥 넣었다.

마흔이 되니 그냥 뭐 할 때마다 주변에서는 나에게 다른 이유는 찾는데 난 그냥 아직도 이유 없이 산다.

 

보통 제품 리뷰할 때 제품에 대해 꼼꼼하게 리뷰하는 글이 많다. 난 내가 솔직한 사람이라고 생각한 사람이 뭘 사면 그냥 믿고 따라 사는데 구독자 중에 그런 분이 좀 계셔서 장모님께도 선물한 AI 스피커라고 해 본다. 다만, 업데이트 이후 최근 음악 듣기 구입하셨던 장모님과의 휴대폰 페어링이 깨져서 다시 연결하고 알려 드릴 때 집어던질 뻔 하긴 했다. 딱 한 번이라 넘어가야 할 듯.

 

내가 쓰는 기능은 몇 개 없는데 너무 자주 쓰고, 너무 편하다.

 

1. xx시 x분에 알람 맞춰줘. 

2. 많이 본 뉴스

3. SBS 뉴스

4. KBS 뉴스(MBC는 서비스 안된다)

5. 날씨

6. 내일 날씨

7. 조용히 해(아이에게는 안 쓰고 여기 스트레스 품)

8. 알람 모두 지워줘.

9. 휴대폰 찾아줘.

 

지금 최고의 AI 스피커라고 말하는 이유는 그동안 ML로 음성 인식 서비스를 제공하는 스피커의 지인 찬스 써 가며 다 써보니 한국어는 구글 홈이 좋았다. 사실 내가 참고로 삼은 그 집은 구글 홈에 방송뿐 아니라 IoT, 음악 감상까지 모두 결합을 했기에... 그러나 3D 게임보다 2D 게임이 재미가 있듯.

 

집에서 모니터링 스피커(프리 소너스 셉터 8+우퍼)로 음악을 듣고, 150만 원짜리 바워스앤윌킨스 헤드폰과 아스텔 앤 컨으로 길거리에서 음악 듣는 나로서는 그냥 지금 AI 스피커라고 하는 애들에 대한 기대는 딱히 없다. (에어팟 프로는 와이프가 쓴다. 나는 아직 유선이 좋다 ^^;;) 애플도 돼도 안 하는 닥터드레 정도야 인수했지만 B&W나 베어다이내믹 같은 회사를 인수하기는 힘들다고 생각한다.(그래도 닥터드레 솔로 헤드셋은 2개 있긴 하다. 솔로만 음질 괜찮.) 최근 보스와 B&W 헤드셋을 친구에게 선물 줬는데 딱히 돈 때문에 뭘 선물하거나 선택하라고 하고 싶지도 않다. 그래서 최근에는 카카오 미니 스피커 선물하는 게 취미다.

 

이 글에서 가장 중요한 글자는 [지금]이다.

 

카카오가 하드웨어 제작에도 도전을 해서 많이 밀어주고 싶은 마음이지만 내심 드는 생각은 결국엔 하드웨어도 잘 만들고, 소프트웨어도 우수한 애플이 음성 인식 시장은 통일하지 않겠냐는 생각이다.

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

python.c  (0) 2020.04.08
decision science - 2  (0) 2020.04.08
ML 학습 결과는 늘 같을까?  (0) 2020.04.08
텔레그램은 해킹 가능할까?  (2) 2020.04.08
맥북으로 머신러닝 되나요?  (0) 2020.04.08

ML(Machine Learning)의 학습 결과는 늘 같을까?

 

아니요.

 

실험 방법은 간단하다. 인터넷에는 쉽게 구할 수 있는 개/고양이 예제가 있으니 돌려보면 된다. 다소 친절할 필요는 있어 따끈따끈하게 돌려보고 스샷를 올려 둠.

 

결과도 다르고,

 

 

물론, 모델도 다르게 나온다.

 

시간은 다음의 코드로 측정하면 된다. import 뭘 해야할지 궁금하면 자동 import 를 할 수 있는, pyCharm을 쓰면 편하다.

 

start_time = time.time()

print("interstellar :", time.strftime("%H:%M:%S", time.gmtime(time.time() - start_time)))

--------

interstellar : 00:09:08

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

decision science - 2  (0) 2020.04.08
지금 최고의 AI 스피커는?  (0) 2020.04.08
텔레그램은 해킹 가능할까?  (2) 2020.04.08
맥북으로 머신러닝 되나요?  (0) 2020.04.08
Decision Science  (0) 2020.04.08

GPLv3 제품을 욕하는 행동은 도저히 용납할 수 없어 글을 남긴다.

 

불가능하다.

 

의사 결정을 위해서는 다양한 지식이 필요하다. 이 매거진은 IT 분야의 의사 결정을 위해서 관련 지식을 제공하는 매거진이므로 텔레그램 n 번방에 대해서 이야기해 보려고 한다. 범죄자 입장에서 말하는 것은 여론의 뭇매를 맞을 수도 있으니 추가 범죄자들을 잡아야 하는 시각으로 써 보려고 한다.

 

이상한 안경으로 세상을 보면, 텔레그램 해킹은 매우 쉽다. 텔레그램을 쓰는 사람의 휴대폰을 뺏아 텔레그램을 열고 내용을 보면 된다. 그 외 중간에서 스니핑을 한다거나 서버의 내용을 빼는 것은 불가능하다. 

 

https://telegram.org/blog/cryptocontest

$300,000 for Cracking Telegram Encryption

$300,000 for cracking #Telegram encryption

telegram.org

 

텔레그램은 오래전부터 해킹 대회를 개최하고 있었고, 카톡뿐 아니라 전 세계 메신저들이 그들이 소스를 보고 벤치마킹하는 것으로 유명하다. 게다가 텔레그램은 푸틴이 사장(파벨 두로프)에게 열라고 지시 하자 거부하고 망명해 버린 것으로도 유명하다.

https://platum.kr/archives/27688

텔레그램 창업자, 알고보니 러시아를 떠난 정치 망명객 - 'Startup's Story Platform’

(왼쪽) 텔레그램 창업자인 파벨 두로프 몇일 새 러시아산 메신저 텔레그램(telegram)이 화제를 모으고 있습니다. 정부의 카카오톡 검열이슈에 맞물려 네티즌들이 찾은 대안입니다. 소위 ‘메신저 망명처’로도 불리우고 있습니다. 텔레그램 이야길 해보죠. 텔레그램의 창업자는 러시아의 페이스북이라 불리우는 브콘탁테(ВКонтакте, 원어식발음 ‘브깐딱쩨’, 이하 VK)의 창업자이자 최고경영자였던 파벨 …

platum.kr

 

 

그 외 텔레그램 관련 기사는 수없이 많은데,

https://news.sbs.co.kr/news/endPage.do?news_id=N1004719875

스노든 “암호 해독 키 제공 거부한 '텔레그램' 결정 지지”

러시아에 망명 중인 전 미국 정보요원 에드워드 스노든이 러시아 당국에 암호 해독 키 제공을 거부한 암호화 메신저 '텔레그램'의 결정을 지지하고 나섰습니다. 인테르팍스 통신에 따르면 스노든은 17일 자신의 트위터 계정에 올린 글에서 "나는 예전에 텔레그램 보안 모델을 비판했다.

news.sbs.co.kr

 

이번 사건으로 지난 히스토리를 아예 모르거나 의도적으로 조작을 시도하는 기자들이 보여서 기록을 남기게 되었다. 그런 의도가 컴퓨터를 잘 모르는 사람이 보기에 충분한 "가슴 덜컹"이 된다면 좋은 의도겠지만 뉴스가 그런 식으로 흘러가서는 안된다는 것은 굳이 논쟁하지 않더라도 자명한 사실이다.

 

https://biz.chosun.com/site/data/html_dir/2020/03/07/2020030701078.html

'국민앱' 카톡 10주년… 웃고 울었던 순간들

카카오톡 2010년 3월 출시부터 10년 변천사우여곡절 있었지만 이제는 카카오 최대 수익사업국민 메신저 넘어 생활 플랫폼으로 자리매김한국에서 ‘..

biz.chosun.com

 

 

http://www.mediatoday.co.kr/news/articleView.html?idxno=119312

카카오톡이 국민들에게 사과한 이유는? - 미디어오늘

www.mediatoday.co.kr

 

 

카카오톡이 다시 감청 정보를 제공하고 위기를 틈 타 서버 사용량을 확 줄인 것은 탁월한 선택이었다. 사실, 딸을 키우는 아버지의 입장에서는 범죄자를 잡는 수사협조 외엔 개인 사생활을 들여보는 것이 쉽게 다수의 동의를 얻기 힘들기 때문에 나는 감청에 찬성하는 편이다.(게다가 나는 텔레그램도 쓰니까) 내가 정말 반대였다면 조회수 10배는 더 나오던 블로거에서 티스토리로 바꿀 이유도, 브런치에 글을 쓸 이유도 없겠다. 사생활 존중하는 아이폰과 텔레그램을 선호하지만 카톡 또한 존중한다.(아이를 키우다가 사실, 생각이 변화한 케이스니 내 말은 딱히 근거도 없고, 무조건 틀렸다)

 

말하고자 하는 요지는 한국 정부보다 무서운 러시아 정부의 힘에도 굴복하지 않았던 텔레그램이라서 관련해서 협조를 받을 수 있는 길은 없다고 보면 되겠다. 그러면 텔레그램 방에서 정상적으로 나와서 사진과 텔레그램 자체를 지워버린 사람을 어떻게 추적할 수 있을까? 

 

추적할 수 없다.

 

그러나 운영 중에는 상대방 휴대폰 번호를 볼 수 있었을 테니 명단이 분명 있다.

그리고 경찰은 이런 사건이 발생했을 때 모든 사람을 잡지는 않는다. 가령 퇴폐 업소라고 하면 이용 횟수 3번 이상 + 수입 등 고려해서 잡는 것으로 알고 있다.(교도소가 무한정 있는 것은 아니니까)

 

이럴 때 국가의 수장이라면 어떤 의사 결정을 해야 할까?

 

번화가만 가도 쉽게 볼 수 있는 문제의 가게부터 잡는 게 좋지 않을까?

 

쫓겨난 그들이 앞으로 어디서 어떻게 일 할지도 함께 고민해 봐야 한다. 곤충이 먹거리가 된다면 아마 일 안 해도 굶어 죽는 국민은 없을 것 같긴 하다.

 

텔레그램은 그 어떤 메신저보다 사생활을 존중하는 메신저이다. 범죄로 악용되어 아쉽지만 살인자를 욕해야지 그 칼이나 그 칼을 만든 사람을 욕하지는 말아야겠다.

요약 : 공부용으로만 사용하세요.

+ 아이맥 프로보다 RTX3090 윈도우 데스크탑이 4배는 더 빠른 것 같습니다.

 

 

알파고가 100억 넘는 컴퓨터라는 것을 사람들이 잘 아는데도 이런 질문을 받는 경우가 있다.

답변은  됩니다. 혹은, 안됩니다.

 

라고 말한다.

 

그리고 대기업 개발 쪽 아닌, 관계자가 물어봤을 때는 그냥 안된다고 말했다.

 

노트북으로 한다면 초기엔 구글 코랩이 베스트고, 구글 클라우드가 좋다. 사실, 대형 클라우드 회사는 모두 해당 플랫폼을 가지고 있다. 오라클, IBM 도 브로셔를 보내오고 마이크로소프트의 애저, 아마존의 AWS도 ML 플랫폼이 있다.  원리는 VMWARE나 도커에 파이썬, 텐서, 케라스를 깔아 놓고 돈 받는 형태라 보인다. 가장 큰 AWS도 초창기 데이터 센터 만들 때 VMWARE 기술을 썼다는 기사가 기억난다. 불혹이라 사실 이제 가물가물하다.

 

다음과 같은 플랫폼도 있다. 

 

https://www.openml.org/home

OpenML

OpenML: exploring machine learning better, together. An open science platform for machine learning.

www.openml.org

 

 

그 외 다른 ML 클라우드 회사는 10개 넘었던 것 같은데 다 망한 것 같다.

 

페북이나 구글 하드웨어 개수가 개당 500만 원씩 잡고 30만~100만 개는 될 텐데, 1조 정도 있으면 해 볼만한 사업인 것 같다. 뭐, 국가가 쓸데없는 개 타트 업에 투자해 주는 것보다 그냥 미국 하드웨어 디립따 사서 외교 잘하고 그 하드웨어로 대학교 학생들이 만든 인공지능 모델이나 잘 돌려줘도 좋은 국가 산업이 될 거라는 생각을 해 본다.

 

서론이 길었네. 좀 더 비 개발자가 알아듣기 쉬운 답변으로는

 

맥북 에어 200만 원짜리 노트북으로 돌리면 한 3시간 걸리는 간단한 트레이닝 데이터로 모델을 만들 때, 

500만 원짜리 맥북 프로로 돌리면 한 1.5시간 걸리는 것 같고,

아이맥 프로 800만 원짜리로 돌리면 16 코어 중 5 코어 놀면서 10분 정도에 끝나는 것 같다.

 

맥은 머신러닝 하기 좋은 시스템 플랫폼이 아니다.

 

AMD는 GPU 지원이 nVidia보다 못해서 난 CPU로 돌린다. pyCharm에서 gpu 패키지가 잘 안되거든... ㅡㅡ; 4년 전 Sli나 Crossfire로 GPU 4개씩 사서 머신러닝 한다고 국가 돈 타갔던 회사들은 그걸로 신나게 게임하고 있으리라 생각한다. 혹은 구석에 처박혀 있거낰ㅋㅋㅋ 리눅스에 구축한 텐서의 경우 CPU로는 돌릴 수가 없는 상태. 그래도 아이맥 프로는 plaidbench keras mobilenet 벤치를 돌렸을 때 7초 안에 프롬프트가 뜬다.

 

2년 전이었나? 3년 전이었나... 클라우드 머신으로 돌렸을 때 기억으로는 트레이닝 비용이 월 380만 원 정도가 나왔던 것 같다. 그때 트레이닝 데이터가 지금보다 더 많지는 않았던 것 같은데...(이미지 크기가 다르긴 했으니 1:1 비교는 불가겠지만)

 

암튼, 모델 짜는 것은 종이와 연필이면 충분하고 머신 러닝 돌리는 것은 휴대용에서는 안 하는 게 좋다. 클라우드는 너무 비싸. 좋은 데이터 있으면 클라우드 업체와 딜이 되긴 한다. 걔네들도 뭐, 데이터 없으면 땡이니까.

 

요샌 나 같은 경우 모델 하나로 만들지 않고 어차피 프로그래밍이 되니 여러 모델을 거치도록 설계하기 때문에 클라우드 쓸 일도 없다. 기업 담당자 잘 꼬셔서 맥 프로 최고 사양으로 뽑는 게 좋다. 뭐... AMD GPU도 아직은 아니지만 좀 더 나아지겠지 ^^;; 그리고 어차피 VR, AR 도 하니까 그리고 그래픽 카드 내구성보다는 제온 같은 CPU가 오래 돌리는데 좀 더 안정감을 느끼긴 하다. 3년 이상씩 하드웨어 고장 났을 때만 컴퓨터 끄며 그 외엔 계속 돌려도 하드 디스크 메모리, 그래픽 카드만 뻑났었지 CPU가 죽은 적은 없었기에...

 

내가 데이터 엔지니어를 하는 이유는 이미 늙었고, 했던 분야가 모두 그쪽인 이유도 있지만. 데이터 분석가, 과학자 쪽은 의사결정 쪽과는 거리가 멀다. 의사 결정 또 한 내가 하는 것이 아니다. 잘 뽑은 모델로 한 예측을 잘 보여줄 때 큰돈을 움직이는 사람들이 의사 결정을 하는 것이다. 3D로 잘 보여 주면 더 좋고.

 

3개의 글로 이 매거진의 성격은 어느 정도 파악되었으리라 생각된다.

길을 걸으며 목적지까지 가다,

그 길에 여러 개의 신호등이 존재한다고 하자. 그리고 한 번은 다른 쪽 보행 도로로 넘어가야 할 때, 바로 앞 신호등과 다음 사거리 신호등이 있다면 어떤 신호등을 선택하는 것이 최적의 선택일까?

 

거리가 휘어져 있지 않고 직각이라서 어느 쪽으로 건너더라도 목적지까지의 거리가 같다면, 아마 다음과 같은 여러 생각을 하게 된다.

 

1. 우선 신호 체계와 변환 시각, 현재 신호등 상태, 내 보폭을 고려한 속도 등을 알아야 한다.

2. 바로 앞 신호등이 방금 녹색으로 바뀌었다면 바로 지금 건너는 것이 맞다.

 - 어차피 건너야 할 신호등이기 때문.

3. 바로 앞 신호등이 방금 빨간색으로 바뀌었다면 다음 신호등까지 우선 걷고, 건너는 편이 낫다.

 - 사거리 신호등까지 도착했을 때 신호등 점멸 시간과 내 보폭 등을 고려한 속도와 거리의 상관관계를 분석하기보다. 우선, 사거리까지 걸어가면 직진할 수 있는 신호등을 빨리 만날 수도 있고 길을 건널 신호등을 만날 수도 있기 때문.

4.... 

 

여러 생각을 하지만 세상의 문제는 이처럼 단순하지도 복잡하지도 않다.

 

투입 비용 대 효용가치를 따졌을 때 일일이 계산하고 있는 것 자체가 잘못된 것이기 때문이다. 물론, 개인의 경우 말고 한국 도로의 신호 체계를 따진다면 ROI가 나쁘지 않다. 

 나는 수많은 택시 기사에게서 대로의 신호등 체계가 잘못되었다는 말을 수십 년 간 들었다. 신호 바뀌어서 가면 다음 신호에서 꼭 막히는 지역이 있었다. 꼭 운전을 많이 하시는 택시 기사분들의 말씀을 빌리지 않더라도, 미국에서는 차량 감지 센서가 신호를 열어주는 경험을 했었기에 운전자이기도 한 내가 한국의 특정 도시는 큰 대로변인데도 불구하고 잘못된 신호 체계를 가지고 있음을 아주 쉽게 알 수 있다. 물론, 대로변 신호를 무조건 뚫는 것이 안전과도 직결된 문제라 쉽게 생각하지는 않다. 만약, 그렇다면 홍보를 좀 했으면 하는 생각이기에 분명 무언가 틀렸다고 말할 수는 있다.

 

개인이 길을 걷는 경우

를 다시 생각해 보자. 잘못된 신호등 알고리즘 이야 자명한 사실이라 내가 말할 수 있지만 이제 불혹의 나이에서 "카더라"로 비판을 할 수는 없기에(그 전에도 사실만으로 비판했기에 메이저 뉴스에 나갔으나) 이제 정말 개인적인 예를 들어 보려고 한다. Decision Science는 적어도 사람이 판단하는 것보다는 나은 판단을 해야 하는데 내가 신호등을 지금 건너는 게 맞는지 인공지능(Ok google이나 hey siri)에게 물었을 때 과연 신호등을 건너는 것에 대한 판단을 인공지능이 제대로 내려 줄 수 있을까?라는 것에 의문을 던져 본다.

 

우선은, 아니다.

 

라는 결론을 내어 본다. 나는 하루의 대부분을 사무실에서 햇볕을 쬐지 못하고 지낸다. 대부분 회사 근처에 숙소를 잡는 생활을 해 온 나로서는 신호등 선택으로 시간 몇 분을 줄이는 것은 내 요구사항에 거의 없다고 봐야 한다. 지각해야 한다면, 그냥 지각을 해버리는 나로서는. 아예 0으로 봐도 무방하다. 

 

그래서 적어도 내 기준에서 이 문제에 대해 제대로 된 결정을 내려줄 수 있는 인공 기능이라면, 건물 사이로 햇빛을 받을 수 있는 신호등이라는 새로운 판단 기준이 있어야 한다는 것이다. 

 

이 경우, 내가 이 사실을 알고 알고리즘을 짤 때 변수로 넣으면 그만이겠지만 트레이닝 데이터로 알고리즘을 만들어 내는 AI의 경우 관련 데이터가 없다면 절대 제대로 된 모델이 나올 수 없다. 규칙이 명확하고 단순한 문제들은 스스로 길을 찾기도 하지만 현실 문제를 풀기에는 부족하고 그 모든 정보 해결에 대한 모델을 합치기에는 하드웨어가 부족하다. 양자 컴퓨터가 나와도 어느 정도는 의사 결정을 내려 주겠으나 내 삶에 대한 포괄적인 결정을 내려주기에는 부족해 보인다.

 

그런 점에서 Decision Science가 매력적으로 보인다. 사람의 거짓말 정도는 조금 줄여 줄 수 있을 것 같다.

머신러닝 종류는 많습니다.

https://en.proft.me/media/science/ml_types2.png

 

저도 잘 몰라요. 의사의 공부 코스도 모르지만 일반인으로 생각할 때, 의사가 되기 위해 공부한다는 것보다. 외과나 소아과처럼 조금 더 세부적으로 정하면 좋겠다는 생각입니다.

 

그리고 눈에 바로 보이면 좀 더 흥미롭겠지요.

 

강화 학습은... 텐서 플로우 기반 AWS DeepRacer를

https://youtu.be/HYkBQKXP3nY

 

 

지도 학습은 텐서 플로우 기반 구글 티처블 머신을

 

https://youtu.be/H76mvSFemi4

 

 

원리를 알고 싶다면, 날코딩을

 

http://www.yes24.com/Product/Goods/75732024?scode=032&OzSrank=1

파이썬 날코딩으로 알고 짜는 딥러닝

인공 신경망 원리와 응용을 파이썬 날코딩으로 정말 깊이 이해하자!『파이썬 날코딩으로 알고 짜는 딥러닝』 은 딥러닝 알고리즘의 원리를 깊숙이 이해하고 이를 파이썬 코딩만으로 구현하는 데 주안점을 둔다. 이를 위해 가장 간단한 신경망 구조부터 복잡한 응용 구조까지 다양한 딥러닝 신경망 예제의 실제 구현 과정을 소개한다. 그 과정에서 독자...

www.yes24.com

구매하기

 

 

추천합니다.

 

그리고 결과와 관계없이 몰입하셔서,

http://www.yes24.com/24/AuthorFile/Author/337?scode=008_001

미하이 칙센트미하이 소개 & 대표작 | YES24 작가파일

www.yes24.com

 

 

일상에서 행복을 느끼시길~ 10년이 그냥 갈 듯...

알고리즘으로 검색을 많이 하나 보다.

 

기본적 내용이지만
기본이 가장 중요함.
VPP 버전 사면 된다. 3900원. 2년 넘게 지속 업뎃 해 주었던 것 같다. 일본인이라 ... 시국이 ... 그러나 개발자는 하나.

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

Decision Science  (0) 2020.04.08
머신 러닝을 배우는 빠른 방법  (0) 2020.04.08
스토리보드 이동 방법  (0) 2019.02.14
제주도 항공 촬영  (0) 2019.01.19
C의 struct와 Swift 의 struct  (0) 2019.01.19

#This document will be continuously updated.

내가 쓴 글을 소스로 끌로드와 chatgpt 에 넣어서 갈았다. 간단히 물어보는 것보다 직접 쓴 글 전체를 소스로 제공하는게 내가 하고자 하는 질문에 더 가까운 답이 되어 내가 복습하기 좋고 다른 사람 지식에도 도움되기 때문. 텍스트 분야에 한해서 [AI 믹서기] 라는 표현을 만들고 쓰고 싶다.

내 글을 AI 믹서기에 넣고 갈았다.

iOS & Swift - 스토리보드 이동 방법

1. 기본적인 방법

swift

Copy code
let storyboard = UIStoryboard(name: "StoryboardName", bundle: nil) let viewController = storyboard.instantiateViewController(withIdentifier: "ViewControllerIdentifier") as! CustomViewController

2. 네비게이션 컨트롤러를 사용하여 이동

2.1. 현재 뷰 컨트롤러에서 이동

swift

Copy code
self.navigationController?.pushViewController(viewController, animated: true)

2.2. 싱글톤에 저장된 네비게이션 컨트롤러 포인터를 사용하여 이동

swift

Copy code
let storyboard = UIStoryboard(name: "StoryboardName", bundle: nil) let viewController = storyboard.instantiateViewController(withIdentifier: "ViewControllerIdentifier") as! CustomViewController Singleton.shared.currentNavigationController?.pushViewController(viewController, animated: true)

3. 윈도우에서 뷰 컨트롤러 접근하여 이동

swift

Copy code
self.window?.visibleViewController?.navigationController?.setNavigationBarHidden(true, animated: false) self.window?.visibleViewController?.tabBarController?.tabBar.isHidden = true self.window?.visibleViewController?.navigationController?.pushViewController(viewController, animated: true)

4. 모달 형식으로 뷰 컨트롤러 표시

swift

Copy code
self.window?.visibleViewController?.present(viewController, animated: true, completion: nil)

위의 방법들을 사용하여 스토리보드에서 다른 뷰 컨트롤러로 이동할 수 있습니다. 상황에 맞는 적절한 방법을 선택하여 사용하시면 됩니다.

주의사항:

  • 스토리보드 파일 이름과 뷰 컨트롤러 식별자(Identifier)는 실제 프로젝트에 맞게 변경해야 합니다.
  • 커스텀 뷰 컨트롤러 클래스로 타입 캐스팅할 때는 해당 클래스가 정의되어 있어야 합니다.
  • 싱글톤이나 윈도우를 통해 접근할 때는 해당 객체가 올바르게 초기화되어 있는지 확인해야 합니다.

이러한 방법들을 활용하여 스토리보드 간의 이동을 원활하게 처리할 수 있습니다.

 

iOS에서의 다양한 뷰 컨트롤러 이동 방법

기본 설정

iOS 애플리케이션 개발에 있어서 뷰 컨트롤러 간의 이동은 필수적인 부분입니다. Swift와 iOS SDK를 사용하여, 사용자 인터페이스 간의 전환을 구현하는 방법은 여러 가지가 있습니다. 이 글에서는 주로 UINavigationController를 활용한 이동 방법과 윈도우를 통해 현재 보이는 뷰 컨트롤러를 변경하는 방법에 대해 다룹니다.

방법 1: UINavigationController 사용하기

  • 스토리보드 설정
    • 우선, UIStoryboard 객체를 사용하여 목적지 뷰 컨트롤러의 인스턴스를 생성합니다.
    swiftCopy code
    let storyboard = UIStoryboard(name: "TabMenu", bundle: nil) let viewController = storyboard.instantiateViewController(withIdentifier: "settings_sharing_code") as! SharingCodeController
  • 뷰 컨트롤러 이동
    • UINavigationController의 pushViewController 메서드를 사용하여, 생성된 뷰 컨트롤러로 이동합니다.
    swiftCopy code
    self.navigationController?.pushViewController(viewController, animated: true)

방법 2: 현재 보이는 뷰 컨트롤러에서 이동하기

  • 윈도우에서 현재 뷰 컨트롤러 찾기
    • 현재 보이는 뷰 컨트롤러를 찾아 navigationController의 속성을 수정하고, 새로운 뷰 컨트롤러로 이동합니다.
    swiftCopy code
    self.window?.visibleViewController!.navigationController?.setNavigationBarHidden(true, animated: false) self.window?.visibleViewController!.tabBarController?.tabBar.isHidden = true self.window?.visibleViewController!.navigationController?.pushViewController(viewController, animated: true)
    • 혹은 present 메서드를 사용하여 모달 방식으로 뷰 컨트롤러를 표시할 수 있습니다.
    swiftCopy code
    self.window?.visibleViewController!.present(viewController, animated: true, completion: nil)

이렇게 UINavigationController의 스택을 활용하거나, 현재 활성화된 윈도우에서 직접 뷰 컨트롤러를 조작하는 방법을 통해 iOS 애플리케이션 내에서 다양한 화면 전환을 구현할 수 있습니다. 이 방법들은 사용자에게 부드럽고 직관적인 인터페이스 전환 경험을 제공하는 데 도움이 됩니다.

//제주도에 관심이 많으신 듯.


Swift의 struct와 C에서의 struct는 유사한 구조를 가지고 있지만, 여러 중요한 차이점이 있습니다. 이 차이점들은 언어의 설계 철학과 기능성, 사용 용도에서 비롯됩니다.

C에서의 struct

  • 데이터의 집합: C에서 struct는 여러 데이터 항목(멤버 변수)을 하나의 단위로 묶는 방법을 제공합니다. 이러한 멤버 변수는 다양한 데이터 타입을 가질 수 있습니다.
  • 메모리 할당: C의 struct는 메모리 상에서 연속된 공간을 차지합니다. 멤버 변수들은 선언된 순서대로 메모리에 배치됩니다.
  • 값 타입: C에서 struct는 값 타입(Value Type)입니다. struct를 다른 변수에 할당하거나 함수에 전달할 때, 메모리 내의 실제 데이터가 복사됩니다.
  • 메서드 없음: C의 struct에는 메서드를 직접 포함할 수 없습니다. 대신, struct의 인스턴스를 매개변수로 받는 함수를 정의하여 기능을 구현할 수 있습니다.

Swift에서의 struct

  • 데이터와 기능의 캡슐화: Swift의 struct는 데이터(속성) 뿐만 아니라 기능(메서드)도 함께 캡슐화할 수 있습니다. 이는 struct를 사용하여 더 복잡한 동작을 쉽게 모델링할 수 있게 해줍니다.
  • 값 타입: Swift에서 struct 또한 값 타입입니다. 하지만 Swift는 struct, enum 및 기본 데이터 타입(int, double, string 등)에 대해 값 타입을 권장합니다. 이는 참조 카운팅 오버헤드 없이 효율적인 메모리 관리를 가능하게 합니다.
  • 상속 불가능: Swift의 struct는 상속할 수 없습니다. 이는 클래스와의 주요 차이점 중 하나입니다. 다형성을 달성하기 위해서는 프로토콜을 사용할 수 있습니다.
  • 멤버와이즈 초기화자: Swift의 struct는 자동으로 멤버와이즈 초기화자(Memberwise Initializer)를 제공합니다. 이 초기화자를 통해 각 속성을 초기화할 수 있으며, 모든 속성에 대해 명시적으로 초기값을 제공하지 않아도 됩니다(기본값이 있는 경우).

요약

C의 struct와 Swift의 struct는 기본적인 용도는 유사하지만, Swift의 struct는 메서드를 포함할 수 있고, 상속 대신 프로토콜을 사용하여 다형성을 구현하는 등의 차이점이 있습니다. Swift는 값 타입을 사용하여 참조 카운팅 오버헤드를 줄이고, 메모리 사용을 최적화하는 설계를 채택하고 있습니다.

 

C에서 상속 흉내 내기

비록 C 언어에서 직접적인 상속을 지원하지 않지만, 개발자들은 몇 가지 기법을 사용하여 상속과 유사한 효과를 낼 수 있습니다. 이러한 기법 중 하나는 첫 번째 멤버로 기반 struct를 포함하는 것입니다. 예를 들어

typedef struct {
    int baseProperty;
} Base;

typedef struct {
    Base base;  // 'Base' struct를 첫 번째 멤버로 포함
    int derivedProperty;
} Derived;

이 방법을 사용하면, Derived 타입의 변수가 Base 타입의 속성에 접근할 수 있게 됩니다. 또한, 함수 포인터를 struct에 포함시켜 메서드와 비슷한 패턴을 구현할 수 있으며, 이를 통해 다형성을 흉내 낼 수도 있습니다.

typedef struct {
    void (*functionPointer)(void);
} StructWithFunction;

하지만 이러한 접근 방법은 실제 객체 지향 프로그래밍 언어에서 제공하는 상속의 모든 이점을 제공하지는 않습니다. 특히, 타입 캐스팅, 가상 메서드, 오버라이딩 같은 고급 객체 지향 기능을 모방하기에는 한계가 있습니다.

결론

C 언어에서 struct를 사용한 상속은 언어의 기본 기능을 넘어서는 일종의 창의적인 해결책이며, 실제 객체 지향 프로그래밍의 깊이와 유연성에는 미치지 못합니다. 그럼에도 불구하고, C 언어의 강력한 기능과 더불어 이러한 기법들은 여전히 유용하게 사용될 수 있습니다.

#include <stdio.h>

// 함수 선언
void myFunction(void) {
    printf("Hello, I'm a function pointed to by a struct!\n");
}

// 구조체 정의
typedef struct {
    void (*functionPointer)(void); // 함수 포인터 멤버
} StructWithFunction;

int main() {
    // 구조체 인스턴스 생성
    StructWithFunction myStruct;
    
    // 함수 포인터에 myFunction 함수의 주소 할당
    myStruct.functionPointer = myFunction;
    
    // 구조체를 통해 함수 호출
    myStruct.functionPointer();
    
    return 0;
}

========== 사족 ===========

처가댁(성환), 제주도 드론 샷 //이번 주는 이 포스트가 조회수 1위를 했다.

여행 카테고리는 꾸준한 듯. 당연히 프로그래밍 보다 인기가 좋닼ㅋㅋ

처가댁이랑 제주도에서 찍었었던...

 

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

스토리보드 이동 방법  (0) 2019.02.14
제주도 항공 촬영  (0) 2019.01.19
userDefault 활용  (0) 2019.01.16
Practical Swift  (0) 2019.01.14
iOS UI 기초 - Swift UI  (2) 2019.01.03

[이 문서는 계속 업데이트 됩니다.]

native 장치, 외부 라이브러리, 오픈소스, 쓰레드 작업 등등 은 userDefaut 가 좋다. 512KB 를 넘지 않는 선에서 써야 한다.

그건 10만자 라고 생각하면 기억하기 쉽고, 각각의 디바이스 이고 개별 저장소임을 감안할 때 앱에서 느낌은 거의 무한한 공간으로 느껴진다. 

  1. ASCII 문자 (영문 알파벳, 숫자, 기본 구두점): 1 바이트
  2. 대부분의 유럽 언어, 중동 언어, 아프리카 언어의 문자: 2 바이트
  3. 한글, 한자, 일본어 등 아시아 언어의 문자: 3 바이트
  4. 이모지 및 특수 기호: 4 바이트

512KB는 512 * 1024 = 524,288 바이트입니다.

만약 모든 문자가 ASCII라면, 최대 524,288 문자를 저장할 수 있습니다. 524,288 바이트 / 1 바이트 = 524,288 문자

그러나 모든 문자가 한글이라면, 최대 174,762 문자를 저장할 수 있습니다. 524,288 바이트 / 3 바이트 ≈ 174,762 문자 (소수점 이하 버림)

실제 상황에서는 다양한 문자가 혼합되어 사용되므로, 저장할 수 있는 정확한 문자 수는 문자의 구성에 따라 달라집니다. 대략적으로는 다음과 같이 추정할 수 있습니다:

  • 주로 ASCII 문자를 사용하는 경우: 약 500,000자
  • 주로 유럽어, 중동어, 아프리카어 문자를 사용하는 경우: 약 250,000자
  • 주로 한글, 한자, 일본어 등을 사용하는 경우: 약 170,000자
  • 이모지와 특수 기호를 많이 사용하는 경우: 약 130,000자

따라서 512KB는 상당히 많은 양의 텍스트 데이터를 저장할 수 있지만, 데이터의 성격에 따라 실제로 저장할 수 있는 문자 수는 크게 달라질 수 있습니다.

대림산업 이제는 바뀐 DL E&C 에서 담당했던 before Service 앱에서 13만건 이상 한 방에 싱크해야 하는 상황에서의 오프라인 싱크 앱 경험으로 sqlite 는 뻑난다. 파일 생성 역시나 안정적이지 못했다. UserDefault야 이미 13만 건 * 데이터 필드 개수 * 각 필드별 문자수 계산 하면 한계를 아득히 넘어 버리는 수치이기에 쓸 수 있지도 않았다. sql 에 저장하면 읽는데도 어마어마한 시간이 걸렸었다. 해결 방법은 시간적 공간적 분할 외엔 없었다. 시간은 CPU, 공간은 메모리... 결국... 내가 썼던 책 그대로의 내용이다.(세속적으로 말하면 기본기는 알려주나 경험적 지식은 스스로 터득하라는 것) 왜냐면, 시간이 지나서 안 사실이지만. 타이틀만 중요시하며 딱히 중요하지도 않은 지식을 공유하며 그것이 아닌 그 누군가에게도 고마워하지 않는 세상이라는 것을 알아버렸지 때문일까. 혹은, 그렇게 된 세상, 문화를 바로 잡기 위해서 필드의 지식은 필드에 그대로 남겨두고 싶어서일까. 그래도 공부 하고자 하는 이들을 위한 발자취는 남겨둔다. 덜 고생하시라고.

 

UserDefaults는 iOS 앱에서 간단한 데이터를 저장하고 검색하는 데 사용되는 편리한 메커니즘입니다. 그러나 모든 상황에 적합한 것은 아닙니다. UserDefaults를 사용하여 데이터를 저장하고 전송하는 것의 장단점과 제한 사항은 다음과 같습니다.

장점:

  1. 간편성: UserDefaults는 key-value 쌍을 사용하여 데이터를 저장하고 검색하는 간단한 방법을 제공합니다.
  2. 빠른 액세스: UserDefaults에 저장된 데이터는 빠르게 액세스할 수 있습니다.
  3. 영구 저장: UserDefaults에 저장된 데이터는 앱이 종료되거나 기기가 재부팅되어도 유지됩니다.

단점:

  1. 제한된 데이터 유형: UserDefaults는 주로 기본 데이터 유형(String, Int, Bool 등)과 일부 컬렉션 유형(Array, Dictionary)만 지원합니다. 사용자 정의 객체를 저장하려면 Codable 프로토콜을 준수해야 합니다.
  2. 제한된 저장 공간: UserDefaults는 대량의 데이터를 저장하기에 적합하지 않습니다. Apple은 UserDefaults에 저장되는 데이터를 약 512KB로 제한할 것을 권장합니다.
  3. 보안 고려 사항: UserDefaults에 저장된 데이터는 암호화되지 않으므로 중요한 정보를 저장하는 데 적합하지 않습니다.

제한 사항 (Limits):

  1. 데이터 크기: Apple은 UserDefaults에 저장되는 데이터를 약 512KB로 제한할 것을 권장합니다. 이 제한을 초과하면 앱의 성능에 영향을 줄 수 있습니다.
  2. 데이터 유형: UserDefaults는 주로 기본 데이터 유형과 일부 컬렉션 유형만 지원합니다. 사용자 정의 객체를 저장하려면 추가 작업이 필요합니다.

외부 라이브러리 및 API와의 상호 작용:

  • 외부 라이브러리나 API에서 받은 데이터를 UserDefaults에 직접 저장하는 것은 일반적으로 권장되지 않습니다. 대신, 데이터를 적절한 데이터 모델로 변환한 후 필요한 경우 UserDefaults에 저장하는 것이 좋습니다.
  • 이미지나 비디오와 같은 큰 데이터는 UserDefaults 대신 파일 시스템이나 Core Data와 같은 다른 저장 메커니즘을 사용하는 것이 좋습니다.

요약하면, UserDefaults는 간단한 데이터를 저장하고 전송하는 데 유용하지만, 대량의 데이터나 복잡한 객체를 다룰 때는 한계가 있습니다. 데이터의 유형과 크기에 따라 적절한 저장 메커니즘을 선택하는 것이 중요합니다.

 

@State private var udfirstArg = UserDefaults.standard.string(forKey: "CameraViewfirstArg")

var udfirstArg = UserDefaults.standard.string(forKey: "CameraViewfirstArg")

UserDefaults.standard.set(self.firstArg, forKey: "CameraViewfirstArg")

//            let savingLocation = "gs://" + (self.udfirstArg ?? "") + "/" + "230830.jpeg"

 

 

func makeUIViewController(context: Context) -> HjHCameraViewController {

        print("func makeUIViewController(context: Context) -> HjHCameraViewController {")

        UserDefaults.standard.set(self.firstArg, forKey: "CameraViewfirstArg")

        UserDefaults.standard.set(self.secondArg, forKey: "CameraViewSecondArg")

        UserDefaults.standard.set(self.thirdArg, forKey: "CameraViewThirdArg")

        

        let vc = HjHCameraViewController()

        vc.modalPresentationStyle = .fullScreen

        return vc

    }

 

 

 

 

//

//  HjhCameraView.swift

//  App

//

//  Created by Junho HA on 2023-04-30.

//

 

import SwiftUI

 

 

struct HjhCameraView: UIViewControllerRepresentable {

    

    let firstArg : String

    let secondArg : String //let secondarg = $item.businessNumber

    let thirdArg : String //처방월_년

    

    typealias UIViewControllerType = HjHCameraViewController

    

    func makeUIViewController(context: Context) -> HjHCameraViewController {

        print("func makeUIViewController(context: Context) -> HjHCameraViewController {")

        UserDefaults.standard.set(self.firstArg, forKey: "CameraViewfirstArg")

        UserDefaults.standard.set(self.secondArg, forKey: "CameraViewSecondArg")

        UserDefaults.standard.set(self.thirdArg, forKey: "CameraViewThirdArg")

        

        let vc = HjHCameraViewController()

        vc.modalPresentationStyle = .fullScreen

        return vc

    }

    

    func updateUIViewController(_ uiViewController: HjHCameraViewController, context: Context) {

        // Updates the state of the specified view controller with new information from SwiftUI.

        

    }

    

}

 

 

 

            Section {

                Toggle(isOn: $continuousTakePicture) {

                    Text("연속 촬영")

                }

                Button(action: {

                    print("EDIEDI")

                    let dateFormatter = DateFormatter()

                    dateFormatter.dateFormat = "MM_yyyy" // "MMMM yyyy" will give you the full month name and the year

                    

                    if let window = UIApplication.shared.windows.first {

                        let subject = "\($item.summary.wrappedValue)_\($item.owner_id.wrappedValue)"

                        let body = "_\($item.owner_id.wrappedValue)_거래처명:\($item.summary.wrappedValue)"

                        //                        let thirdarg = dateFormatter.string(from: date)

                        let thirdarg : String = String(month) + "_" + String(year)

                        print("hjhdate : \(dateFormatter.string(from: date))")

                        //                        let secondarg = dateFormatter.string(from: date)

                        let secondarg:String = $item.businessNumber.wrappedValue

                        window.rootViewController = UIHostingController(rootView: HjhCameraView(firstArg: $item.summary.wrappedValue, secondArg: secondarg, thirdArg: thirdarg))

                        window.makeKeyAndVisible()

                    }

                }, label: {

                    HStack {

                        Spacer() // 버튼 내부에서 텍스트를 중앙에 위치시키기 위해 사용

                        Image(systemName: "camera")

                            .imageScale(.large)

                            .foregroundColor(.white) // 아이콘 색상 조정

                        Text("EDI 촬영")

                            .fontWeight(.bold)

                            .foregroundColor(.white) // 텍스트 색상 조정

                        Spacer() // 버튼 내부에서 텍스트를 중앙에 위치시키기 위해 사용

                    }

                    .padding() // 버튼 내부 여백 추가

                    .background(LinearGradient(gradient: Gradient(colors: [Color.blue, Color.purple]), startPoint: .leading, endPoint: .trailing)) // 그라디언트 배경 적용

                    .cornerRadius(10) // 모서리 둥글게

                    .shadow(radius: 5) // 그림자 효과 추가

                })

                .frame(maxWidth: .infinity) // 최대 너비 설정

                

                // "SODN으로 자동 전송" 토글 상태에 따라 조건부 렌더링

                if settingActivated {

                    Button(action: {

                        checkCameraAccess()

                        self.isShowingImagePicker = true

                        //                        self.uploadState = .idle

                        DispatchQueue.main.asyncAfter(deadline: .now() + 1) {

                            self.uploadState = .idle

                            // 업로드 성공 후 필요한 UI 초기화 로직을 여기에 추가

                            // 예: 선택된 이미지를 초기화한다거나, 성공 메시지를 표시하는 등

                        }

                        

                    }) {

                        Text("갤러리에서 사진 선택")

                            .frame(maxWidth: .infinity)

                            .padding()

                            .background(LinearGradient(gradient: Gradient(colors: [Color.purple.opacity(0.8), Color.blue.opacity(0.8)]), startPoint: .leading, endPoint: .trailing))

                            .foregroundColor(.white)

                            .cornerRadius(10)

                            .shadow(radius: 5)

                    }

                    .padding(.horizontal)

                    .fullScreenCover(isPresented: $isShowingImagePicker, onDismiss: loadImage) {

                        // ImagePicker 뷰 표시

                        HjhImagePicker(selectedImage: $selectedUIImage)

                    }

                    

                }

            }

            

'Swift & Python 실무 > {APP} SOCANNER APP' 카테고리의 다른 글

스토리보드 이동 방법  (0) 2019.02.14
제주도 항공 촬영  (0) 2019.01.19
C의 struct와 Swift 의 struct  (0) 2019.01.19
Practical Swift  (0) 2019.01.14
iOS UI 기초 - Swift UI  (2) 2019.01.03

+ Recent posts