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