Post

Replies

Boosts

Views

Activity

Reply to Need tips on adding AutoLayout UIView programmatically with Safe Area
I have a UIView that i create with a XIB. I then want to add it on top of a parent, take up the whole screen but use the safe area i have set up constraints for in the xib.  I'm not sure I fully understand. Did you set constraint inside the UIView xib relative to safe area ? How did you do it ? I would do differently: don't have constraints inside the xib relative to Safe area Set constraints in code for UIView relative to Safe area by creating constraints programmatically.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’21
Reply to Simulator background color changed?
There are many other issues with the simulators ; In addition to the yellow background, I have alerts which frame is incompletely drawn, with fuzzy borders or whose texts is illisible… I filed 2 bug reports : Dec 15, 2020 at 6:01 PM – FB8941139. Xcode 12.3 display incomplete alerts In a view, I have an alert. The top left and right corners are now fuzzy: on about 30 pixels wide and 80 pixels high (but not uniformly on this whole rectangle), we don't see the alert background but the view that is behind; just as if those parts had ben snacked by some rodent… Dec 15, 2020 at 6:10 PM – FB8941145 Xcode simulator does not display alert correctly when removing App Xcode 12.3 (12C33) simulator iPhone 12 Pro Max - 14.3 iMac Catalina 10.15.7 When I delete the app from the iPhone, the top button "Edit home screen" is no more lisible (text black on black or transparent on black) I see you did the same (could you post FB reference, in case ?)
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’21
Reply to Xcode
You closed the thread by marking your answer as correct. So we all assume you are satisfied with it. Otherwise, the answer is : find the bug in your code… Have a good day.
Jan ’21
Reply to Detect Segue or Navigation
I don't understand why you need it. You could do it programmatically. In the destination controllers, test for self.navigationController in viewDidload:         print(self.navigationController == nil ? "not nav" : "nav") If the destination is in a navigation stack, it is not nil. If it comes from a "pure" segue, it will be nil. However, if the originating VC is in a navigation stack, it will not be nil. To differentiate in that case, you would need to add a property in the destination var comesFromSegue : Bool = false and set it true in the prepare for segue. Note: you could encapsulate all this into a UIViewController subclass, overriding viewDidLoad var comesFromSegue : Bool? // Must be set in prepare; we assume here that there are only 2 cases: segue of nav override func viewDidLoad() {         super.viewDidLoad() if comesFromSegue == nil { // Then it was NOT set in a prepare, but segue we could be in a navigation stack anyway comesFromSegue = self.navigationController == nil	// Do we really come from a navigation ? Otherwise, we assume it is segue } // else { comesFromSegue = true } as set in prepare }
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’21