Post

Replies

Boosts

Views

Activity

Reply to push or local notification
the notifications appear when the app get new post from url It depends on what precisely means the app get new post from url. If you mean your app retrieves some post from the url with your code while your app is running, you can use local notifications.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Failed to produce diagnostic for expression when creating a list view in SwiftUI
In your code, Playlist is Identifiable, but the Element type of playlist.songs is not. Try adding this extension to Song: extension Song: Identifiable { var id: String {Name} //- Please change this, if you know something better for `id` } (Or else, you can add id: parameter to ForEach.) Swift compiler cannot find the right initializer of ForEach when the Element is not Identifiable, but at least it should show some sort of errors on line 12. You can send a bug report to Apple using the Apple's Feedback Assistant, or you can choose bugs.swift.org as suggested.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Reset Values After A Calculation + Picker Selection
when I change the picker options, it internalizes the user input and doesn't allow the user to change inputs anymore. Sorry, but I do not understand this part. Do you want to update the value shown in timeOutput automatically? Or do you just want to set default values to fields and pickers? If the latter, you just need to call a function which resets values to default: @IBAction func btnCalcClicked(){ //The code below this is to perform the necessary air calculations. //... //Outputs the time allowed for the dive, in minutes, based on all factors input. resetValues() } func resetValues() { allowedTime = 0 consumptionAir = 0 volumeAvailable = 0 //... picker.selectRow(0, inComponent: 0, animated: false) pickerCyl.selectRow(0, inComponent: 0, animated: false) } If this is not what you mean, please try to explain what you want to do again.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Use of AutoreleasingUnsafeMutablePointer in Swift
This is the Obj-C implementation in the demo.app provided by Zebra Based on the sample code in Objective-C, you need to set an instance of NSMutableArray before you call sbtGetAvailableScannersList(_:). Please try something like this: var availableScanners: NSMutableArray? = NSMutableArray() scanner?.sbtGetAvailableScannersList(&availableScanners)
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to KMLViewer (Map Kit): MKPointAnnotation text not displayed
I would never have gotten that idea - that the documentation on MapKit - MKMapView - is so misleading...  Archived documentations will never be updated, even if they contained inappropriate description. But the latest documents will give you some hints: MKMarkerAnnotationView - https://developer.apple.com/documentation/mapkit/mkmarkerannotationview ... Setting the Visibility var titleVisibility: MKFeatureVisibility The visibility of the title text rendered beneath the marker balloon. ... You can try something like this: let marker = MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: nil) marker.displayPriority = .required marker.titleVisibility = .visible //- _annotationView = marker
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to push or local notification
I mean I get data from server by API the data take time to load I want to refresh data automatically in background I may not be understanding what you mean yet, but it would work. Though, I have never tried to do background tasks with SwiftUI.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Swift App UI Button Scope
Don't you remember what I wrote before? Ignore the word scope in the error message and find what you need to define. When you get an error message like Cannot find 'signIn', it is signIn that you need to define, not Button. But your code currently shown does not make sense. Line 27...29: Text are not appropriate for WindowGroup Line 47: You cannot write Button at the toplevel of the code Line 51...59: Button is a predefined type in SwiftUI, it is not what you need to define
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Error: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions.
Path Progress and Courses are different Views. mClass is an array of classes  If somethings was wrong about them, an error would be shown on barHome. Please show the definitions of them if you want to fix your issue. Or if the SOLVED mark is not a mistake and you really have solved your issue, please share your solution.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’21
Reply to Tab bar item localization
Here is an example. LevelsViewController is a view controller that is displayed when tapping a tab bar item. UITabBarController collects tabBarItems of the content view controllers just after they are initialized. It is too late in viewDidLoad or viewWillAppear. Try something like this: override func awakeFromNib() { super.awakeFromNib() tabBarItem.title = "LevelsVC-TabBarItem".localize() } Or required init?(coder: NSCoder) { super.init(coder: coder) tabBarItem.title = "LevelsVC-TabBarItem"//.localize() } In this scenario, you have no need to subclass UITabBarController.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to App Validation - Got Bad bundle identifier because of application extension bundle id format
As far as I read the message, and not contain more than one period . after the application's bundle ID The bundle identifier com.company.name.product.mobile.Share.External.Information is clearly against it. (And I have never found such an identifier in any of the articles explaining Share Extension.) or it should be like "com.company.name.product.mobile.shareexternalinformation". I haven't tried it myself, but it matches the description in the message, only one period . after the application's bundle ID.
May ’21