Post

Replies

Boosts

Views

Activity

Reply to Persistent data with Core Data
Where exactly do you call saveProcedures() ? When you quit ? In a button action ? In a completion code ? Where exactly do you call loadProcedure() May be you could try to call loadProcedure() at the end of save, to reload all your data structures ? An advice: you'd better use consistent naming: all with or without ending "s"
Dec ’20
Reply to Pass Data between two View Controller
I fear you are doing it improperly. you create         let vc =  ThirdViewController() but the segue will instantiate another ThirdViewController. And you loose everything you have passed to vc which is deleted when exiting the func. So you should: define a prepare for segue func include the preparation code in it, but NOT create instance of ThirdViewController just call if let vc = segue.destination 		 override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 					if segue.identifier == "SegueID" { 							 if let destVC = segue.destination as? ThirdViewController { 										destVC.caption = caption	 										// Do the same with all properties 										destVC.fruitCaption = caption 										destVC.fruitSize = size 							 } 					} 		 }
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’20
Reply to Constraint Layout No Longer Available
I tested with Xcode 12.3. I effectively get the exact problem you have. And not only for top view, but for anyview included. It occurs as well if I include a new view (e.g. label) inside an existing. However, as soon as you create a constraint (control-drag to the safe area limit for instance), then inferred (constraints) will show. So there is a workaround for subviews, but not for main view. And the main view do not show the constraints relative to it anymore. There is no problem with Xcode 12.2 There is a bug to report here specific to 12.3 (or it is a change that do need to be explained).
Topic: UI Frameworks SubTopic: UIKit Tags:
Dec ’20
Reply to Do I need to design on Sketch for all iPhones & iPads?
Sketch is an independent app, not a developer tool for this forum. You should ask them directly. In addition, I do not understand your point. Why would ever sketch be needed to design an app ? I've developed a lot of apps, that work from iPhone SE to iPad 12.9, without even thinking of using Sketch. To design for multiple iOS devices formats, just use the layout tools of Interface Builder appropriately.
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’20
Reply to How do I close a window programmatically from a Button in SwiftUI?
If you have defined 		let myWindow:NSWindow? then call self.myWindow?.close() More details here: https://stackoverflow.com/questions/58494700/swiftui-on-mac-close-window-and-open-another-one To dismiss the sheet, 2 options: environment var binding to hold status of sheet as explained here: https ://www.hackingwithswift .com/quick-start/swiftui/how-to-make-a-view-dismiss-itself
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’20
Reply to New App
If you want to develop for yourself as a game, why not. But if you intent to put on the appstore, you probably should forget it. There is a serious risk of it being refused, because predicting lottery numbers is just a misleading promise… Anyway, what is the problem ? algorithm to predict ? There is no solution, prediction is not possible if the lottery is properly designed the app structure ? What is the point ? some specific code ? please show it
Dec ’20
Reply to Swift - Async calls in loop
My question is how, I can change my code, so the loop basically "pauses" until I fetch every detail information of the iterated object, add it into the dataSource Array and then continues with the next one? Why do you want this ? For display purpose ? Is it really a good idea to try to sync something which is essentially async ? But if you really need. loop: do you mean this loop ?      for var i in 0..<commentReplyArray.count { you could try to have a global var onGoing : Bool set it to false line 6 before self.fetchDetailsAboutCommentReply then wait until reset to true, line 18 (with some timeout to avoid a deadlock) and set to true after groupNotify. But I do not find it a very good design (it may also lead to a very slow user interface).
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’20