Custom UIView Designed in Interface Builder .xib Xcode 4.6 – Part 1
New Xcode Project:
Original Xcode Project:
Learn how to create a custom UIView in Interface Builder and then load it into another UIViewController using .xib files. You can embed your own custom controls in different UIViewControllers.
Custom UIViewControllers are easy, but it’s a lot harder to design your custom UIView classes in an .xib file. I’ll show you how to connect it and load into another .xib or storyboard file. You’ll need to work with the initWithCoder method to make sure everything gets setup correctly.
Part 2:
Click Here To Subscribe and stay on top of iPhone and iPad app development for iOS 7.0 and iPhone 5S. Never Miss A Video!
Watch my introductory iPhone course programming course. Many of my students have designed their own iPhone apps and taught themselves iPhone programming with my help. Start watching 15 of my iPhone programming videos from my iOS 7 App Course for free:
I’ve taught thousands of people on Skillshare, Udemy, Kickstarter, and iPhoneDev.tv. My courses have over 4,000 students on Skillshare, 7,000 on Udemy, and 700+ backers on Kickstarter.
Blogs:
iPhone Blog, Code, and Tutorials:
Paul Solt’s Dev Blog:
App Blog:
Courses:
Learn to make iPhone apps:
Udemy:
Skillshare:
Skillfeed:
Kickstarter iPhone Project:
Contact:
YouTube Channel:
Twitter:
Facebook:
LinkedIn:
Google+:
Paul Solt’s iPhone Apps:
Nguồn: https://lonestarbbqgrill.com
Xem thêm bài viết khác: https://lonestarbbqgrill.com/game/
Hi, this video is very helpful! But i have a problem for custom uiview in XIB file that contain a tableview. My tableview was loaded in my VC, but i found that TableViewDelegate methods were not called. I checked tableview.datasource and delegate and they were already connected to my VC. But still, nothing happens (cellForRow:AtIndexPath and numberOfRowsInSection are still not called). I think the problem is with [self addSubview:self.view], but I'm not sure. Can you help me how to make Custom UIView with XIB, containing tableview in the customview. Thanks!
Hi, very helpful video. Is there a way to make the view size adopt to the view constraints in the story board, without setting it's size in the xib file?
You, Sir, are a genius.
There are so many half arsed, half baked, hacky and horrible "solutions" to this all over the web and stack overflow.
What you've got here isn't a solution. Its an explanation of why everyone else has been trying to solve the wrong problem. If you solve the right problem, as you do here, then there's no problem any more, because that's the right way to do it.
Brilliant 🙂 Not just because you've solved my problem elegantly, but you've opened up my thinking too. Thanks.
Did anybody manage to use a child class of WidgetView in the "setup" method? It would be useful to use a factory inside the method so that I can plug always a WidgetView view in a xib file but WidgetView's child class will be used under the hood.
Great! I've been messing with this for a half a day before I found your tutorial! Thanks!
Great video Paul! I just can't see why Xcode hasn't got better support for this. Like the ability to add your own custom components to the component palette… But for now this is the as good as it gets.
that's definitely what I was looking for 🙂 thanks paul!
Looking forward to it!
Wow. Totally surprised you don't have more comments or likes. This was a brilliant video! Well put together and great explanation. Subscribed.
Great tutorial. I has getting funky sizes at runtime until I added code to set the frame size in the WidgetView setup method.
CGRect newFrame = self.frame;
newFrame.size = self.view.frame.size;
self.frame = newFrame;
1st