Post

Replies

Boosts

Views

Activity

Reply to How to read a local value correctly both in Combine's sink scope and in the scope that Combine's sink was defined?
What you show in the log does not match exactly the code. I would expect: globalNum: 1 completion: ($0) // Is it ? localNum in caller of .sink: 1 received: Optional("") // But here $0 is always "" local value: (localNum) // is it ? localNum in .sink: 1  Where do you get unexpected result ? Here ?           print("local value: \(localNum)")
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to XCode console flooded with "Invalid timestamps for HID response delay" messages on a hello world app
I tested a simple MacOS app, with storyboard, with Xcode 13.0ß4, with MacOS11.5. I do not get those messages, just a few Metal warnings : 2021-08-01 18:12:49.944683+0200 Simple MacOS test[11072:1323345] Metal API Validation Enabled 2021-08-01 18:12:50.073140+0200 Simple MacOS test[11072:1323345] MTLIOAccelDevice bad MetalPluginClassName property (null) 2021-08-01 18:12:50.074332+0200 Simple MacOS test[11072:1323345] +[MTLIOAccelDevice registerDevices]: Zero Metal services found I found references to the problem since 2017 when using Cordova. Is it your case ? h t t p s : / / github.com/immersive-web/webvr-polyfill/issues/201 Otherwise, that could mean that you have timestamps out of sync. Do you have some antivirus installed ? Hope this could help: https://discussions.apple.com/thread/251314646
Aug ’21
Reply to How to compare dates from two view controllers (Core Data and Swift)?
Code is not formatted in comments, making it hard ro read. 1. let model = Calendar(context: context) 2. print(model.dateSaved) 3. if model.dateSaved == dateFromFirstView { 4. print("dates are identical ",model.dateSaved," ",dateFromFirstView) 5. } else { 6. print("dates are not identical ",model.dateSaved," ",dateFromFirstView) 7. } 8. 9. @IBAction func datePickerChanged(_ sender: Any) { 10. let dateFormatter = DateFormatter() 11. dateFormatter.dateFormat = "dd-MM-YYYY" 12. dateFromFirstView = dateFormatter.string(from: datePicker.date) 13. } 14. 15. @IBAction func datePickerChanged(_ sender: Any) { 16. let dateFormatter = DateFormatter() 17. dateFormatter.dateFormat = "dd-MM-YYYY" 18. strDate = dateFormatter.string(from: datePicker.date) 19. print(strDate) 20. } So model is a variable for the Entity, dateSaved is an attribute of the entity and it is a string (as I use a date formatter that converts the date from a date picker into a string). dateFromFirstView is also a string. The thing is that I added a print but the if else statement only gets triggered once so if I change the date on the datePicker the if else statement doesn't get triggered.  Then I store the strDate as dateSaved in Core Data. I want the if else statement to get triggered whenever I select a new date on the date picker but it only works one time. Some questions about this code: datePickerChanged is defined twice. Is it just a copy and paste error ? In which is the code from lines 1 to 7 ? If it is in viewDidload, that's normal to be called only once. What you could do is keep model as a global in your class keep dateFromFirstView as a global in your class create a func to test: func compareDates() { if model.dateSaved == dateFromFirstView { print("dates are identical ", model.dateSaved," ", dateFromFirstView) } else { print("dates are not identical ", model.dateSaved," ", dateFromFirstView) } } replace lines 3 to 7 with compareDates() call it in datePickerChanged @IBAction func datePickerChanged(_ sender: Any) { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "dd-MM-YYYY" dateFromFirstView = dateFormatter.string(from: datePicker.date) compareDates() }
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Localized App Info values are reset to English on app release
However, each new version requires us to set the same values again. Is this a known issue, and are there any known workarounds? It is not a bug, it is a design decision, to force to update subtitle for each new version of an app. If that's a problem, file a bug report for enhancement request. Workaround is not to forget to re enter subtitles. Note: I've found a good practice: I created a text document with all the fields required in AppStore Connect, with entries in any language. I have all information in one place. I update this file with new entries for the new release. Doing so, less risk to forget something ; and I can copy and paste from text file to AppStore Connect.
Aug ’21
Reply to Value of type 'Text' has no member 'searchable'
You can use conditional statement : if #available(iOS 15.0, *) {    Text(data.name)                 .font(.custom("Helvetica Neue", size: 14))                  .searchable(text: $searchText) } else {    Text(data.name)                 .font(.custom("Helvetica Neue", size: 14)) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to What language is the "unbrella" keyword from?
Aren't there extra curly braces ? framework module SwiftyJSON { umbrella header "SwiftyJSON.h" export * module * { export * } } AFAIK, That's C declaration statements. https://releases.llvm.org/3.3/tools/clang/docs/Modules.html#umbrella-directory-declaration See also: https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_objective-c_into_swift This may clarify as well: https://developer.apple.com/forums/thread/42737 https://clang.llvm.org/docs/Modules.html#link-declaration
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to How to read a local value correctly both in Combine's sink scope and in the scope that Combine's sink was defined?
What you show in the log does not match exactly the code. I would expect: globalNum: 1 completion: ($0) // Is it ? localNum in caller of .sink: 1 received: Optional("") // But here $0 is always "" local value: (localNum) // is it ? localNum in .sink: 1  Where do you get unexpected result ? Here ?           print("local value: \(localNum)")
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Value of type 'Text' has no member 'searchable'
That's only available for iOS 15, hence Xcode 13.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to XCode console flooded with "Invalid timestamps for HID response delay" messages on a hello world app
I tested a simple MacOS app, with storyboard, with Xcode 13.0ß4, with MacOS11.5. I do not get those messages, just a few Metal warnings : 2021-08-01 18:12:49.944683+0200 Simple MacOS test[11072:1323345] Metal API Validation Enabled 2021-08-01 18:12:50.073140+0200 Simple MacOS test[11072:1323345] MTLIOAccelDevice bad MetalPluginClassName property (null) 2021-08-01 18:12:50.074332+0200 Simple MacOS test[11072:1323345] +[MTLIOAccelDevice registerDevices]: Zero Metal services found I found references to the problem since 2017 when using Cordova. Is it your case ? h t t p s : / / github.com/immersive-web/webvr-polyfill/issues/201 Otherwise, that could mean that you have timestamps out of sync. Do you have some antivirus installed ? Hope this could help: https://discussions.apple.com/thread/251314646
Replies
Boosts
Views
Activity
Aug ’21
Reply to How can I migrate Swift 3 applications to Swift 5 in 2021?
I do it differently, directly from XCode 12. See my detailed explanation here: https://developer.apple.com/forums/thread/685565?answerId=682858022#682858022
Replies
Boosts
Views
Activity
Aug ’21
Reply to No such module ***** coming in every 3 to 4 week.
Which module ? Always the same ?
Replies
Boosts
Views
Activity
Aug ’21
Reply to Swift 3 to 5 conversion / apple silicon MacBook
I understand the pain, even though compiler helps a lot in fixing. Note that Xcode message to use Xcode 10.1 is misleading. No need to use older Xcode to convert. You can do it directly in XCode 12 or Xcode 13. See my detailed explanation here: https://developer.apple.com/forums/thread/686256
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to How to declare a TableColumn with nullable field?
Could you post complete code, so that we can try ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to The forum is spammed ?
Yes, that happens from time to time. The best way is to notify of spam, by hitting the Report an issue button (the ! button at the lower right in the image below):
Replies
Boosts
Views
Activity
Aug ’21
Reply to Why Does NSTextField Have Extra Vertical Space When Deployment Target is 10.13 or Earlier?
There seems to be a solution by subclassing NSTextFieldCell, as you mentioned. Hope this will provide some hints: https://stackoverflow.com/questions/11775128/set-text-vertical-center-in-nstextfield As for reason of issue, could it be due to a change in default system font ?
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to How to compare dates from two view controllers (Core Data and Swift)?
Code is not formatted in comments, making it hard ro read. 1. let model = Calendar(context: context) 2. print(model.dateSaved) 3. if model.dateSaved == dateFromFirstView { 4. print("dates are identical ",model.dateSaved," ",dateFromFirstView) 5. } else { 6. print("dates are not identical ",model.dateSaved," ",dateFromFirstView) 7. } 8. 9. @IBAction func datePickerChanged(_ sender: Any) { 10. let dateFormatter = DateFormatter() 11. dateFormatter.dateFormat = "dd-MM-YYYY" 12. dateFromFirstView = dateFormatter.string(from: datePicker.date) 13. } 14. 15. @IBAction func datePickerChanged(_ sender: Any) { 16. let dateFormatter = DateFormatter() 17. dateFormatter.dateFormat = "dd-MM-YYYY" 18. strDate = dateFormatter.string(from: datePicker.date) 19. print(strDate) 20. } So model is a variable for the Entity, dateSaved is an attribute of the entity and it is a string (as I use a date formatter that converts the date from a date picker into a string). dateFromFirstView is also a string. The thing is that I added a print but the if else statement only gets triggered once so if I change the date on the datePicker the if else statement doesn't get triggered.  Then I store the strDate as dateSaved in Core Data. I want the if else statement to get triggered whenever I select a new date on the date picker but it only works one time. Some questions about this code: datePickerChanged is defined twice. Is it just a copy and paste error ? In which is the code from lines 1 to 7 ? If it is in viewDidload, that's normal to be called only once. What you could do is keep model as a global in your class keep dateFromFirstView as a global in your class create a func to test: func compareDates() { if model.dateSaved == dateFromFirstView { print("dates are identical ", model.dateSaved," ", dateFromFirstView) } else { print("dates are not identical ", model.dateSaved," ", dateFromFirstView) } } replace lines 3 to 7 with compareDates() call it in datePickerChanged @IBAction func datePickerChanged(_ sender: Any) { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "dd-MM-YYYY" dateFromFirstView = dateFormatter.string(from: datePicker.date) compareDates() }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Subtitle is not showing in other App Stores different from US
I may misunderstand your question. You have to set the Name and Subtitle of the App in every language your propose in Appstore Connect. Otherwise it will not show. Note also that Subtitles are cleared when you create a new version of the app. You have to reenter them all.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Localized App Info values are reset to English on app release
However, each new version requires us to set the same values again. Is this a known issue, and are there any known workarounds? It is not a bug, it is a design decision, to force to update subtitle for each new version of an app. If that's a problem, file a bug report for enhancement request. Workaround is not to forget to re enter subtitles. Note: I've found a good practice: I created a text document with all the fields required in AppStore Connect, with entries in any language. I have all information in one place. I update this file with new entries for the new release. Doing so, less risk to forget something ; and I can copy and paste from text file to AppStore Connect.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Value of type 'Text' has no member 'searchable'
You can use conditional statement : if #available(iOS 15.0, *) {    Text(data.name)                 .font(.custom("Helvetica Neue", size: 14))                  .searchable(text: $searchText) } else {    Text(data.name)                 .font(.custom("Helvetica Neue", size: 14)) }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Lines numbering in Code Block
Any news from the FB ?
Replies
Boosts
Views
Activity
Aug ’21
Reply to What language is the "unbrella" keyword from?
Aren't there extra curly braces ? framework module SwiftyJSON { umbrella header "SwiftyJSON.h" export * module * { export * } } AFAIK, That's C declaration statements. https://releases.llvm.org/3.3/tools/clang/docs/Modules.html#umbrella-directory-declaration See also: https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_objective-c_into_swift This may clarify as well: https://developer.apple.com/forums/thread/42737 https://clang.llvm.org/docs/Modules.html#link-declaration
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21