I'm new to iOS and Xcode.
I can't figure out how to design a separated view and make it be added into the main UIViewController using storyboard.
I did different approaches..
- Just grab an UI object from right-bottom corner window in the xcode, and then put it onto any space area of storyboard. But I can't drop the UI object like the way with xib.
- Add a new UIViewController. Add a view into the
UIViewController
. In the main ViewController.m, I get the new UIViewController
instance in the viewDidLoad, and then [self.view addSubview:newUIViewController.view]
. But I can't see the added view.
- I created a new xib file. And add a view into it. I also try to get the instance in the main
ViewController
. And addSubview
with the xib's view. But it also failed.
Is there a correct way or any working solution to do so?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…