Post

Replies

Boosts

Views

Activity

Reply to Why unwind method doesn't work now in UIKit?
I found a solution to this issue. It needs to right-click the Exit icon. Then, by the left-click, drag the connection from the circle of the unwind method to the button on the screen. And in another window that appears, click action. And after clicking the button, a transition to the target view controller occurs, as well as data passing.
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’24
Reply to Constraints don't work (UIKit)
I have added the myView.translatesAutoresizingMaskIntoConstraints = false code line to my code. import UIKit class ViewController: UIViewController {     var myView = UIView()     override func viewDidLoad() {         super.viewDidLoad()         myView.frame.size.width = 100         myView.frame.size.height = 100         myView.backgroundColor = .green         view.addSubview(myView) myView.translatesAutoresizingMaskIntoConstraints = false         let margins = view.layoutMarginsGuide         myView.trailingAnchor.constraint(equalTo: margins.trailingAnchor).isActive = true     } } But now. i get a blank screen. Why is this happening?
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’22
Reply to Why unwind method doesn't work now in UIKit?
I found a solution to this issue. It needs to right-click the Exit icon. Then, by the left-click, drag the connection from the circle of the unwind method to the button on the screen. And in another window that appears, click action. And after clicking the button, a transition to the target view controller occurs, as well as data passing.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to Constraints don't work (UIKit)
I have added the myView.translatesAutoresizingMaskIntoConstraints = false code line to my code. import UIKit class ViewController: UIViewController {     var myView = UIView()     override func viewDidLoad() {         super.viewDidLoad()         myView.frame.size.width = 100         myView.frame.size.height = 100         myView.backgroundColor = .green         view.addSubview(myView) myView.translatesAutoresizingMaskIntoConstraints = false         let margins = view.layoutMarginsGuide         myView.trailingAnchor.constraint(equalTo: margins.trailingAnchor).isActive = true     } } But now. i get a blank screen. Why is this happening?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Mar ’22