Post

Replies

Boosts

Views

Activity

Reply to What is the best way to localize a iOS App project?
You have detailed tutorials describing the process. Here is one of them: h t t p s : / / w w w.hackingwithswift.com/example-code/uikit/how-to-localize-your-ios-app 1 - Localize everything via my project's main.storyboard 2 - Localize programmatically aka ViewController.swift Approach 1 is much preferable. A few steps: use NSLocalizing everywhere in code Add languages : select project name in navigation panel select Project > Info select Use Base internationalization add languages with the + button  3. Select storyboard In the File inspector, click the languages you want to support you will immediately see the change in the File browser panel on the left:  4. Select Main (english) and translate. But with that, I'm not sure how to reload a new feature, in case I change sth on the base storyboard.  5. Now, when you add objects in storyboard, you have to complete those files. you can do it using Export / Import localisation from the Product Menu (recommended) You can do it another way: add entry manually in the file ; for instance if you add a button, copy a similar entry: /* Class = "UIButton"; normalTitle = "Go Tab 1"; ObjectID = "40k-P5-pRD"; */ "40k-P5-pRD.normalTitle" = "Go Tab 1"; And replace what needs to be: ObjectID = "-xx-" in "40k-P5-pRD.normalTitle", as well as the comment Adapt the text Take care not to remove the semi colon  6. See tutorial to localize Strings
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’21
Reply to Possible convert [CKRecord] to [CKRecord.ID : Int]?
Thanks for the code. Comments are messing code presentation, it is better to post in a new reply: @Published var checkedInProfiles: [CKRecord.ID: Int] = [:] func getCheckedInCounts() { ckController.database.fetchCheckedInProfilesCount(with: RecordType.profile) { (results, moreComing, error) in DispatchQueue.main.async { [self] in checkedInProfiles = results } } } So I assume you get the error in checkedInProfiles = results Most likely, results in fetchCheckedInProfilesCount is a [CKRecord], hence a mismatch. Could you confirm by showing fetchCheckedInProfilesCount func ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’21
Reply to ProgressBar with DispatchQueue
maybe there was a way to have remote functions "use" or "pass" messages into or out-of the ViewController Yes there are several ways: by delegation : that's the most appropriate by notification: very easy. Just have the otherViewController subscribe to a notification and post one from ViewController. But take care if you need very short response time. even with a direct reference of the other viewController inside ViewController (not the cleanest way) Before detailing, what do you mean by  ViewController as it is currently remote ? which controller is on screen when you update ?
Topic: UI Frameworks SubTopic: AppKit Tags:
Nov ’21
Reply to Delegation in Swift
Type is NSProgressIndicator . a function not declared within the ViewController class. Where is it declared ? In another VC ? Then see following for delegation. If just in another class, but not a VC, call the func as OtherClass.thefunc() - That's not delegation. You can read this (old) thread with my answer: https://forums.developer.apple.com/thread/111569 Here is the pattern. This was to update a UITextField but could be adapted to other objects and to AppKit easily. You have VC1 and VC2 ; you want to update a field in VC1 when you change a text in VC2. Declare a protocol protocol UpdateVC1 { func updateName(newName: String) } Declare that VC1 conforms to it, and implement it: Set the delegate property of VC2 when you segue class VC1: UIViewController, UpdateVC1 { @IBOutlet weak var userNameField: UITextField! func updateName(newName: String) { userNameField.text = newName } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let destination = segue.destination as? VC2 { destination.delegate = self } } } In VC2 declare a delegate property: class VC2: UIViewController { var delegate: UpdateVC1? Then, when you change the field with name, invoke the delegate delegate?.updateName(newName: name)
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’21
Reply to Black screen before splash screen
It is on device I suppose ? . PNG and sizes are ok How large ? Did you try to copy image in xcassets ? Does it make a difference ?
Replies
Boosts
Views
Activity
Nov ’21
Reply to Possible convert [CKRecord] to [CKRecord.ID : Int]?
Could you show the code where the error occurs ? Where are you using '[CKRecord]'
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Can't extract Xcode_12.5.1.xip file
Would external drive be an issue (I have Xcode_12.5.1.xip on external drive)? Usually, yes. You need to do this on the boot drive.
Replies
Boosts
Views
Activity
Nov ’21
Reply to AppStore doesn't show preview pictures of app
It is surprising it works on other iPhone with same iOS version. So iOS is not the cause. Best advice here is to contact support. In the meanwhile could you give an example of such apps ?
Replies
Boosts
Views
Activity
Nov ’21
Reply to How I can localize array?
Could you explain what you want ? Get each country in its local ? "Afghanistan" -> "Афганистан" "Greece" -> "Ελλάδα" how did you get this array which is not in alphabetical order ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to What is the best way to localize a iOS App project?
You have detailed tutorials describing the process. Here is one of them: h t t p s : / / w w w.hackingwithswift.com/example-code/uikit/how-to-localize-your-ios-app 1 - Localize everything via my project's main.storyboard 2 - Localize programmatically aka ViewController.swift Approach 1 is much preferable. A few steps: use NSLocalizing everywhere in code Add languages : select project name in navigation panel select Project > Info select Use Base internationalization add languages with the + button  3. Select storyboard In the File inspector, click the languages you want to support you will immediately see the change in the File browser panel on the left:  4. Select Main (english) and translate. But with that, I'm not sure how to reload a new feature, in case I change sth on the base storyboard.  5. Now, when you add objects in storyboard, you have to complete those files. you can do it using Export / Import localisation from the Product Menu (recommended) You can do it another way: add entry manually in the file ; for instance if you add a button, copy a similar entry: /* Class = "UIButton"; normalTitle = "Go Tab 1"; ObjectID = "40k-P5-pRD"; */ "40k-P5-pRD.normalTitle" = "Go Tab 1"; And replace what needs to be: ObjectID = "-xx-" in "40k-P5-pRD.normalTitle", as well as the comment Adapt the text Take care not to remove the semi colon  6. See tutorial to localize Strings
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to View pops automatically when in navigation view
Could you show the definition of your root view ? What do you expect by setting to nil ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Possible convert [CKRecord] to [CKRecord.ID : Int]?
Thanks for the code. Comments are messing code presentation, it is better to post in a new reply: @Published var checkedInProfiles: [CKRecord.ID: Int] = [:] func getCheckedInCounts() { ckController.database.fetchCheckedInProfilesCount(with: RecordType.profile) { (results, moreComing, error) in DispatchQueue.main.async { [self] in checkedInProfiles = results } } } So I assume you get the error in checkedInProfiles = results Most likely, results in fetchCheckedInProfilesCount is a [CKRecord], hence a mismatch. Could you confirm by showing fetchCheckedInProfilesCount func ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to How to submit auto to appstore
"auto app", do you mean CarPlay ?
Replies
Boosts
Views
Activity
Nov ’21
Reply to How to submit images in review process
used Shift, Command, 4 and Space bar  That's not the right way. It does not create the right size format. When app running in simulator, just type cmd-S to get a correct screen capture, in png format. This can be imported directly.
Replies
Boosts
Views
Activity
Nov ’21
Reply to ProgressBar with DispatchQueue
maybe there was a way to have remote functions "use" or "pass" messages into or out-of the ViewController Yes there are several ways: by delegation : that's the most appropriate by notification: very easy. Just have the otherViewController subscribe to a notification and post one from ViewController. But take care if you need very short response time. even with a direct reference of the other viewController inside ViewController (not the cleanest way) Before detailing, what do you mean by  ViewController as it is currently remote ? which controller is on screen when you update ?
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to running Simulators with pre iOS 12 versions?
The simplest would be to keep a version of older Xcode and run from there.
Replies
Boosts
Views
Activity
Nov ’21
Reply to ZStack Issue
I tried to reproduce, but no problem here. What is your Xcode version ? Could you post the code as text, so that we can try it ?
Replies
Boosts
Views
Activity
Nov ’21
Reply to Delegation in Swift
Type is NSProgressIndicator . a function not declared within the ViewController class. Where is it declared ? In another VC ? Then see following for delegation. If just in another class, but not a VC, call the func as OtherClass.thefunc() - That's not delegation. You can read this (old) thread with my answer: https://forums.developer.apple.com/thread/111569 Here is the pattern. This was to update a UITextField but could be adapted to other objects and to AppKit easily. You have VC1 and VC2 ; you want to update a field in VC1 when you change a text in VC2. Declare a protocol protocol UpdateVC1 { func updateName(newName: String) } Declare that VC1 conforms to it, and implement it: Set the delegate property of VC2 when you segue class VC1: UIViewController, UpdateVC1 { @IBOutlet weak var userNameField: UITextField! func updateName(newName: String) { userNameField.text = newName } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if let destination = segue.destination as? VC2 { destination.delegate = self } } } In VC2 declare a delegate property: class VC2: UIViewController { var delegate: UpdateVC1? Then, when you change the field with name, invoke the delegate delegate?.updateName(newName: name)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21