Post

Replies

Boosts

Views

Activity

Reply to Banner notifications
Logically, the decision to make notification persistent is left as user decision https://stackoverflow.com/questions/47195376/is-there-any-api-so-we-could-handle-ios-persistent-push-notification-via-code-o So, in your app, you could propose user to change its settings, explaining the added comfort he/she will get with persistent notifications. Or, try to get the notifications in your app and let user see them from there, with getDeliveredNotifications getDeliveredNotifications(completionHandler:)     Returns a list of the app’s notifications that are still displayed in Notification Center.  Declaration     func getDeliveredNotifications(completionHandler: @escaping ([UNNotification]) - Void) Parameters     completionHandler     The block to execute with the results. This block may be executed on a background thread. The block has no return value and takes the following parameter:  notifications     An array of UNNotification objects representing the local and remote notifications of your app that have been delivered and are still visible in Notification Center. If none of your app’s notifications are visible in Notification Center, the array is empty. Also have a look here: https://stackoverflow.com/questions/18944883/create-a-persistent-notification-in-ios
Topic: App & System Services SubTopic: Core OS Tags:
May ’21
Reply to UIPickerView button not worked
You cannot add any image in the forum, so bad ! Picker view has 2 buttons "Done" and "Cancel". You mean 2 Text ? Is it SwiftUI ? When user press Done or Cancel, a gray rounded rect popup view(with text "Done" or "Cancel" which user pressed) appeared and disappeared soon like toast message. Could you show the full code so that we can try to reproduce ?
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to bundle identifier
The bundle identifier is created automatically by Xcode. If your question is for declaring a new app in AppStore: Go to Certificates, Identifiers and profiles Select Register an App ID Bundle ID is like com.myCo.myApp : you will find in Xcode TargetsGeneral
May ’21
Reply to Refresh value in text label from JSON
You request the JSON data, so that cannot be done automatically. You have several options: create a timer (frequency 10s ? 60 s ? depends on the data nature) to regularly call for loadData as you did in viewDidLoad and thus update labels you could also tigger by user:              with a refresh button on the view              or when user taps on the table have the server push you notifications and process when receiving. For the first solution, don't forget to kill the timer when you leave the view
May ’21
Reply to MKMapView: How do I set mapType? (beginner question)
There is no conenience init for MKMapView that let you declare the mapType as an init parameter. You should thus write: import MapKit class KMLViewerViewController: UIViewController, MKMapViewDelegate { let map = MKMapView() // etc. ... override func viewDidLoad() { super.viewDidLoad() map.mapType = .hybridFlyover } } Note that map.mapType = .hybridFlyover must be inside a func ; it cannot be at the class level just after etc… Unless you declare it as a computed var: var map : MKMapView { let aMap = MKMapView() aMap.mapType = .hybridFlyover return aMap }
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Change localization of UIDatePicker in iOS 14
users can change localization on the fly without restarting You should do it by opening the apps settings and let user select the language : func openSettings() { guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else { return } if UIApplication.shared.canOpenURL(settingsUrl) { UIApplication.shared.open(settingsUrl, completionHandler: nil) // { (success) in } }
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Error loading Storyboard
Thanks for the feedback. Problem is that XCode 11.7 won't let you publish on the appstore. You should try: change the name of your XCode (11.7) to XCode11 for instance to keep it as a development version. Then Reload XCode 12 (at least 12.4 or 12.5 if you are curious enough), from downloads/more Check if it works now. In anycase, don't forget to close the thread.
May ’21
Reply to Banner notifications
Logically, the decision to make notification persistent is left as user decision https://stackoverflow.com/questions/47195376/is-there-any-api-so-we-could-handle-ios-persistent-push-notification-via-code-o So, in your app, you could propose user to change its settings, explaining the added comfort he/she will get with persistent notifications. Or, try to get the notifications in your app and let user see them from there, with getDeliveredNotifications getDeliveredNotifications(completionHandler:)     Returns a list of the app’s notifications that are still displayed in Notification Center.  Declaration     func getDeliveredNotifications(completionHandler: @escaping ([UNNotification]) - Void) Parameters     completionHandler     The block to execute with the results. This block may be executed on a background thread. The block has no return value and takes the following parameter:  notifications     An array of UNNotification objects representing the local and remote notifications of your app that have been delivered and are still visible in Notification Center. If none of your app’s notifications are visible in Notification Center, the array is empty. Also have a look here: https://stackoverflow.com/questions/18944883/create-a-persistent-notification-in-ios
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to API Request timeout issue
Could you show the code where the error occurs. May be you have a network issue.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to UIPickerView button not worked
You cannot add any image in the forum, so bad ! Picker view has 2 buttons "Done" and "Cancel". You mean 2 Text ? Is it SwiftUI ? When user press Done or Cancel, a gray rounded rect popup view(with text "Done" or "Cancel" which user pressed) appeared and disappeared soon like toast message. Could you show the full code so that we can try to reproduce ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to 'iPhone unsupported OS version'
I’m running macOS Catalina  Is that the final correct answer ?
Replies
Boosts
Views
Activity
May ’21
Reply to bundle identifier
The bundle identifier is created automatically by Xcode. If your question is for declaring a new app in AppStore: Go to Certificates, Identifiers and profiles Select Register an App ID Bundle ID is like com.myCo.myApp : you will find in Xcode TargetsGeneral
Replies
Boosts
Views
Activity
May ’21
Reply to Refresh value in text label from JSON
You request the JSON data, so that cannot be done automatically. You have several options: create a timer (frequency 10s ? 60 s ? depends on the data nature) to regularly call for loadData as you did in viewDidLoad and thus update labels you could also tigger by user:              with a refresh button on the view              or when user taps on the table have the server push you notifications and process when receiving. For the first solution, don't forget to kill the timer when you leave the view
Replies
Boosts
Views
Activity
May ’21
Reply to Having strange trouble with touchesMoved, need help.
You don't call super.touchesMoved. Try to add it at beginning. Do you override all the other touches func ? Apple doc says: If you override this method without calling super (a common use pattern), you must also override the other methods for handling touch events, if only as stub (empty) implementations.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to ITMS-90809: Deprecated API Usage
Do you use other packages ? Did you do an option clean Build Folder ? So, you added the Additional mtouch arguments ? You should contact Microsoft (see the blog reference) to ask for more help.
Replies
Boosts
Views
Activity
May ’21
Reply to How to best handle this localization scenario?
Creating a String extension is a nice and swifty way to do this. Good continuation.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to MKMapView: How do I set mapType? (beginner question)
There is no conenience init for MKMapView that let you declare the mapType as an init parameter. You should thus write: import MapKit class KMLViewerViewController: UIViewController, MKMapViewDelegate { let map = MKMapView() // etc. ... override func viewDidLoad() { super.viewDidLoad() map.mapType = .hybridFlyover } } Note that map.mapType = .hybridFlyover must be inside a func ; it cannot be at the class level just after etc… Unless you declare it as a computed var: var map : MKMapView { let aMap = MKMapView() aMap.mapType = .hybridFlyover return aMap }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Having strange trouble with touchesMoved, need help.
I cannot access the URL, (after removing the spaces)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to iOS Printing Duplex without PrintInteractionController
Why don't you do this AFTER selecting the printer ?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Change localization of UIDatePicker in iOS 14
users can change localization on the fly without restarting You should do it by opening the apps settings and let user select the language : func openSettings() { guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else { return } if UIApplication.shared.canOpenURL(settingsUrl) { UIApplication.shared.open(settingsUrl, completionHandler: nil) // { (success) in } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Error loading Storyboard
Thanks for the feedback. Problem is that XCode 11.7 won't let you publish on the appstore. You should try: change the name of your XCode (11.7) to XCode11 for instance to keep it as a development version. Then Reload XCode 12 (at least 12.4 or 12.5 if you are curious enough), from downloads/more Check if it works now. In anycase, don't forget to close the thread.
Replies
Boosts
Views
Activity
May ’21
Reply to Change localization of UIDatePicker in iOS 14
No, you access to your app settings only.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21