Post

Replies

Boosts

Views

Activity

Reply to Anyone successful in moving small to medium apps to SwiftUI?
I would not, now, move any sizeable app to SwiftUI. What we read in all forum posts shows how complex it is to get fine tuning of UI. So either your UI is very generic (page display, segues, update views when data change…), then SwiftUI may do the job; but if you need to gert precise control on display and interaction, I would stay with UIKit. Situation may improve in the next 2 years.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to UICollectionView Inside of UItableViewCell no horizontal scrolling
i can't scroll in horizontal direction a UICollectionView What is the exact behaviour ? do you see the full content wrapping around on next lines ? Or part of the collection remains hidden on the right ? What happens when you click and drag in order to scroll ? Any change on the table cell ? Did you read this ? https ://ashfurrow. com/ blog/ putting-a-uicollectionview-in-a-uitableviewcell-in-swift/
Mar ’21
Reply to SwiftUI Date Picker is Problematic
I think it is linked to the locale. Did you try to set locale (see https://stackoverflow.com/questions/58610557/swiftui-datepicker-displaying-language-in-english-only): DatePicker(…) .environment(\.locale, Locale.init(identifier: "us")). // Or the locale you want Have a look at the solution presented here : https://stackoverflow.com/questions/59051670/change-selected-date-format-from-datepicker-swiftui
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to How to readd a notification observer
Where do you reset removeOberver to false ? Are you sure this is even executed ? Add a log: if removeOberver == false { print("Re-add notification") NotificationCenter.default.addObserver( self, selector: #selector(Myclass.deviceTapped), name: Notification.Name("bluetoothRecievedNoticicationName"), object: nil) } Note: may be there is a typo in bluetoothRecievedNoticicationName (bluetoothRecievedNotificationName) It is in fact a better practice to define name in extension: extension Notification.Name {      public static let kBTReceiveNotification = Notification.Name("bluetoothRecievedNotificationName") }
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Best practice for storing repeating dates in CoreData
Another way to do it. Instead of storing a full list of dates, you could also only store the start and endDate and the repeat factor. That would be a more compressed form. And decompress in an array of dates (as in the code above) when you need to use. Instead of saving the array, you would save a struct containing startDate endDate repeats Have a look here on how to code this: https://stackoverflow.com/questions/37876275/how-do-i-store-a-swift-struct-in-core-data-on-ios
Topic: App & System Services SubTopic: General Tags:
Mar ’21
Reply to Guideline for developing 3D simulation software
That is an ambitious project if you are a beginner. Do you master Swift, Mac API ? I would recommend not to try to do it in SwiftUI. I personally think it is not mature enough for such development. Have a look at SceneKit https://developer.apple.com/scenekit/ and RealityKit https://developer.apple.com/documentation/realitykit/creating_3d_content_with_reality_composer This tutorial may be worth reading as well (even though for iOS): https ://www.raywenderlich. com/376-3d-apple-games-by-tutorials-updated-for-swift-4-and-ios-11
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to TableView relsoaddata from textField on the same viewController with TableView
Please better format the code you post: override func viewDidAppear( animated: Bool) { super.viewDidAppear(animated) loadData() // this is my function that queries and reloads data } I have also a textField from which a message is captured updates the database and calls loadData() as follows: @IBAction func composeButton( sender: Any) { //inputAlert() if (feedInputField.text != "" ) { let reqType = Int(reqTypeIndex.text ?? "") ?? 0 AddFeedbacks(message: feedInputField.text ?? "", taskId: idTask?.text ?? "", atype: reqType) loadData() feedInputField.text = "" } } func r_feedback(rtaskId: String) { var singleFeed = myFeedback() self.arrayOfFeedback.removeAll() queryFeedback(taskId: rtaskId).findObjectsInBackground { (objects, error) in if let objects = objects { if (objects.count 0) { for eachFeed in objects { singleFeed.feedDate = eachFeed.createdAt! singleFeed.userNameFrom = eachFeed["UserNameFrom"] as? String singleFeed.feedMessage = eachFeed["TaskFeedback"] as? String singleFeed.atype = eachFeed["AType"] as? Int self.arrayOfFeedback.append(singleFeed) } } else { singleFeed.feedDate = nil singleFeed.userNameFrom = "" singleFeed.feedMessage = "" singleFeed.atype = nil } self.fTableView.reloadData() } } } What is AddFeedbacks ? Note: name should start with lowerCase. Problem : When the app first loads, it loads existing messages in the database. And if I add a new message from the feedInputField, the tableView is not updated but if I added a second message, it then displays both messages. From there, it starts updating normaly. The issue is only when i load the app and after that it works. Problem could be that addFeedbacks executes in another thread asynchronously. And completes after you reload.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’21