Hello, Claude31!
I have been read the documentation - https://developer.apple.com/documentation/uikit/uistoryboard/3213988-instantiateinitialviewcontroller before diving into this implementation. I was searching for whats exactly the behaviour behind into this.
Besides, you don't understand my question and you just put the Docs and retrieve me another question.
If you want to help, I could to say thanks, really. You should ask before as well to answer generic way.
By the way, thanks for feedback about paste code. But you don't help with your reply.
Cheers.
Post
Replies
Boosts
Views
Activity
Hello, Claude31.
I'm not disrespecting the developers. I would never do that.
I just say that you don't understand my question again because you have been say:
"Note: you tagged as Interface Builder. Not sure you are searching in the right direction. have a good day."
I'm using interface builder for a test only...
So sorry for all inconvenience.
Have a nice a day for you too.
Cheers.
Hello, Claude31.
But this implementation that I have been done envolves Storyboard - https://developer.apple.com/documentation/uikit/uistoryboard/3213988-instantiateinitialviewcontroller and have a relationship with interface builder. You don't understand again.
Besides, for a test only, without a biggest project and not merge conflicts, what's the problem for storyboards?
Interface Builder can be either XIB/nib or Storyboard. Latter of which is the more recent (and recommended) method provided by Apple.
By the way, I have understand without your help.
Have a nice day for you too.
Cheers.
Hello! I think did u mean IBOutlets? I can't, because my on the project our team are using only View Code without Storyboards or xibs. By the way, Storyboards is a great way too. I was working with that on the last project.
Cheers!
Also Help
https://developer.apple.com/documentation/uikit/nslayoutanchor
I solved for my self. If help the somebody with the same doubt, I made this solution below
private lazy var containerView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.black
view.translatesAutoresizingMaskIntoConstraints = false
return view
}()
... viewDidLoad() ...
view.addSubview(containerView)
containerView.centerXAnchor.constraint(equalTo: self.view.centerXAnchor, constant: 0).isActive = true
containerView.centerYAnchor.constraint(equalTo: self.view.centerYAnchor, constant: -120).isActive = true
containerView.widthAnchor.constraint(equalToConstant: 250).isActive = true
containerView.heightAnchor.constraint(equalToConstant: 125).isActive = true
That's possible to change the size of the view with CGRect or using with NSLayout approaching.
https://developer.apple.com/documentation/uikit/view_layout
Cheers!!