Combining Storyboards and XIBs in Xcode

Posted on Nov. 12, 2013

You're zipping along prototyping your app using Interface Builder and storyboards. But now you want to reuse a scene all over the place. What do you do? Combine the power of storyboards and XIBs by mixing them!

You could segue from many different areas, but unless the view controller behaves quite similarly, you'll soon run into issues with IBOutlet and IBAction mappings. The best solution? Use a XIB for those tricky areas.

Learning iOS? Subscribe to my iOS articles, tips and tutorials.

You could also have the same Controller.h and Controller.m files, but build the scene in Interface Builder multiple times. But this is a pain to maintain and error-prone.

How do we do this? Quite simple actually. As always, a few assumptions first:

  1. We're using a UITableViewController somewhere in the storyboard.
  2. When we click on a cell of the above table, we want to segue to our custom view controller. However, don't set up any segues related to this yet.

First off, create your new view controller, making sure it subclasses UIViewController and that you tell Xcode to use a XIB. Let's call it CustomViewController. Feel free to add buttons and labels to your XIB. Connect outlets and actions as necessary.

Now head over to your main storyboard. Add an empty UIViewController onto the canvas and change the identity to CustomViewController. Now here's the key part: using the document outline1, find the View listed under Custom View Controller. Highlight it, and delete it.

And that's it! Now the storyboard will load your custom XIB whenever it segues to this view.

So what are the advantages? You can create segues back from this view to other parts of the storyboard. Granted, you'll have to call them manually, but this is a huge advantage.

Try it: control-drag from your placeholder controller in the storyboard back to the UITableViewController. Highlight the created segue, and in the Attribute Inspector, rename it to backToTable. Then in an IBAction method inside CustomViewController, call:

[self performSegueWithIdentifier:@"backToTable" sender:self];

Moreover, if all these controllers are embedded in UINavigationController, you'll get all these segues for free!

  1. That's the side bar on the left when using Interface Builder. 


Pieter E.June 6, 2014, 5:40 p.m.

Thank you for this great blog post. I tried your solution and it works excellent when using one single xib file. But adding multiple Views, based on your blog post, crashes the application every time. Do you have any idea how to solve this? Thank you in advance for your response.

silviogutierrezJune 9, 2014, 8:32 p.m.

I'm afraid I'm not sure how to address this. Thanks for reading.

BadruMarch 16, 2015, 9:59 a.m.


Alex ZakJune 23, 2015, 12:52 p.m.

Hey, I tried to follow your steps, but it seems like storyboard in not loading my VC's xib, but rather showing an empty, transparent view... did you ever encounter such a behaviour? any suggestions?

Team ExtremeJune 18, 2019, 7:12 p.m.

Get Used Motorcycles For Sale from Team X-Treme at the very best price in houston.

sophia jamesOct. 21, 2019, 9:16 a.m.

Admissions are open, Join NOW junior golf camps

Kiara KeastFeb. 27, 2019, 10:34 a.m.

The chain f the consumption is filled for the occupation of the challenges. All the issues have been defend for the movement of the for all matters. The hosting is done for the authority of the parts for the humans.

star19March 7, 2019, 10:13 a.m.

I was wondering what is really on this picture, good things that it is discuss below the picture. Now I know what is the painting all about. Thanks for sharing.
Cgc admission
top agriculture college in Punjab

Ethereum Code crypto bot reviewSept. 30, 2019, 1:29 p.m.

To start, according to the bot’s website, Bitcoin wealth software is based on a Blockchain Revolutionary Technology and Artificial Intelligence. It is through this high-tech innovation that the bot is able to provide highly profitable trading signals. Ethereum Code crypto bot review

hijMarch 28, 2019, 11:18 a.m.

Apple products are revered for its quality, precision and great design. SRSG started its operations as Apple technology partners in the year 1997.
MacBook pro reseller in kolkata
iMac reseller delhi
ipad air reseller in bhubaneswar

dsdsdMay 6, 2019, 5:33 a.m.

Par conséquent, la manière d'éliminer efficacement les préoccupations des clients en matière de vente est une connaissance et une compétence qui doivent être maîtrisées par le vendeur. replique montre Parce que les vendeurs intelligents savent que si vous ne pouvez pas éliminer fondamentalement les préoccupations de vos clients, la transaction sera difficile à obtenir. audemars piguet montre La raison pour laquelle les clients sont vigilants et inquiets au sujet des vendeurs peut être qu’ils ont été victimes de tromperies lors de leurs expériences précédentes ou qu’ils ont acheté des produits pour se décevoir eux-mêmes.

JustinJune 7, 2019, 3:44 p.m.

Thank you for sharing these detailed about Combining Storyboards and XIBs in Xcode. .I truly like your post and amazing blog. I was extremely satisfied to discover this site. I needed to thank you for this extraordinary read!! Homestyle Loan

Deep sea atlanticnaJune 14, 2019, 5:25 p.m.

Eat the delicious Kingfish today at one of our hotels. We offer many more wild-caught seafoods from the deep sea. Visit our site for more information.

WalsmithJuly 25, 2019, 9:59 a.m.

Whether it's recommended Assignment writing services uk, I'm just curious if there are folks who try this. I'm interested in both writing and drawing, so I'd love to be able to do both. If there are people who've effectively drawn storyboards for their lively film screenplays, could you deliver me an example?

AmandaJuly 26, 2019, 6:38 a.m.

Merge Conflicts in Version Control. It’s always a painful experience when multiple developers are working on a project as it almost always leads to merge conflicts in storyboards. I have not heard this Can Someone Do My Essay For Me from many developers, but faced this issue in one of my projects. Using a huge storyboard leads to very slow loading for the application. Splitting it into multiple storyboards solved the issue for me.

liamAug. 6, 2019, 6:36 a.m.

I cannot even think what I would have done if there was no It has helped me so much as now I am able to merge all of the pdf files on the internet.

kevinAug. 8, 2019, 9:26 p.m.

ISP Bharat Sanchar Nigam Limited (BSNL) is the pioneer telecom in India, and the policies were further modified to introduce ISPs in the market, Several companies (Bharti Airtel, Reliance Jio Aircel, ACT, Vodafone, Idea Cellular) joined the Indian market, and BSNL Teleservices provides the best information on all telecom and infra services provided by BSNL, and the telephone density in the sector has increased more day by day.

bodyboss reviews and resultAug. 12, 2019, 3:32 p.m.

Bodyboss Reviews and Here is my before and After Results. BodyBoss Reviews: Everything you know must know before buying-Taking care of your body is a responsibility which is indispensible. ... You need good sleep, lots of water, a healthy diet and a fitness program that you can follow bodyboss reviews and result

dbsAug. 16, 2019, 9:49 a.m.


jamesAug. 25, 2019, 5:07 p.m.

It was a very good post indeed. I thoroughly enjoyed reading it in my lunch time. Will surely come and visit this blog more often. gai goi

kevinSept. 1, 2019, 6:26 p.m.

Thanks so much with this fantastic new web site. I’m very fired up to show it to anyone. It makes me so satisfied your vast understanding and wisdom have a new channel for trying into the world.

mtomSept. 3, 2019, 3:30 p.m.

I am glad to read this post, it’s an impressive piece. I am always searching for quality posts and articles and this is what I found here, I hope you will be adding more in future. Best barber shop Birmingham

kevinSept. 4, 2019, 3:41 p.m.

I ‘d mention that most of us visitors are really endowed to exist in a fabulous place with very many wonderful individuals with very helpful things.

Sumitsingh72Sept. 5, 2019, 10:19 a.m.

Shiftinindia packers and movers in Delhi is the solid and expert movers and packers local time in pune , packers and movers in company , moving cost estimator calculator , packers and movers in Pune charges

mtomSept. 26, 2019, 2:49 p.m.

I’m new to your blog and i really appreciate the nice posts and great layout..-”\"‘

susan mayerSept. 9, 2019, 2:58 a.m.

Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. things to do

donSept. 12, 2019, 7:41 a.m.

Kindly enhance all ios developers the design of the page and make the page the best. The best compilation of all these topics helps readers a lot. The best topics really help users to get more ideas through this page very easily.

forexsteam.comSept. 13, 2019, 1:48 p.m.

Forex Steam is a 100% automated trading solution. With over 25 years of experience in the Forex market our team has put together a system that provides long term growth in a low risk environment.

mtomSept. 14, 2019, 12:52 p.m.

you have a very excellent weblog here! if you’d like to make some invite posts in my small weblog? 사다리사이트

This is a great blog” and i want to visit this every day of the week .   Hair salon for men

selfieSept. 18, 2019, 11:26 a.m.

Welcome to the world of gaming, where life is fast paced and interesting. There is always an adventure waiting for you online.
cheap csgo accounts

molly jonesSept. 25, 2019, 10:58 a.m.

We have acknowledged many open ways to unite our designing capacity with within structure of our assignments. Thusly empowering us to make a rich congruity between our fantasies of the outside feel of the structure and that of the interior system, where the capability of the structure and its tenants can keep up perfect value and comfort.

As expert architectural consultants in dubai Over our 30 years of substance in the area publicize, we have pulled in the best capacities in the business. Our errand gathering is made out of attempted facilitators, sum surveyors and adventure bosses, all of whom have ended up being skilled in dealing with the significant government authorities and thusly achieving speedier taking care of events for achieving supports. The people from our endeavor bunch in like manner have extraordinary client changing capacities, which become noteworthy to our clients' assistance during the last periods of the structure stages.

jennieSept. 27, 2019, 3:02 a.m.

Your style is really unique in comparison to other people I've read stuff from. Many thanks for posting when you've got the opportunity, Guess I'll just book mark this blog 토토사이트

mtomSept. 29, 2019, 2:47 p.m.

I recently wished to value an individual all over again. I don’t know things i would have labored on even without the individuals creative ideas shown by an individual directly on these kinds of difficulty. It had been the particular scary issue in my circumstances, nonetheless , seeing ab muscles experienced strategy a person taken care of it took me to be able to weep more than pleasure. Really happy for the program and also really hope you comprehend such a congrats that you will be completing educating women and men making use of your webblog. I am sure you haven’t encounter anyone. black friday erbjudande

Pretty! This was a really wonderful post. Thank you for your provided information. calculer distance entre deux villes

Felix PlastererOct. 3, 2019, 12:42 p.m.

Greetings, I have to say it was a truly nice experience for me and my brother when we called in at your web site. I hope you don't mind if I congratulate you on the superior quality of the work you've accomplished here and also to send you good luck as you move on going forward. It was enjoyable to browse your internet site and I'll without doubt be dropping by again before long to ascertain exactly how you're getting on. All the best and with a bit of luck I will no doubt see you here once again in a little while - Felix Plasterer

IDN PokerOct. 11, 2019, 4:02 p.m.

Kronospoker Situs Judi Online, IDN Poker, IDN Poker Mobile, Agen Poker Terpercaya Indonesia untuk permainan Poker Online, Domino Qiu Qiu, Ceme Keliling, Capsa Susun dan Super10

Roy stewardOct. 21, 2019, 11:41 a.m.

Well after combining the storyboards and xibs xcode the interface could be complicated! news blog

davidmalanOct. 22, 2019, 12:21 p.m.

A storyboard is like a canvas where you can put .xib files. betternet review

james thomasOct. 23, 2019, 7:24 a.m.

This is very interesting! Great information and it is also very well written. I will bookmark and comeback soon. 안전놀이터

mtomNov. 9, 2019, 3:38 p.m.

Normally I do not read article on blogs, but I would like to say that this write-up very forced me to try and do it! Your writing style has been surprised me. Thanks, quite nice article. 밸런스작업

mtomNov. 16, 2019, 12:59 p.m.

We are a group of volunteers and starting a new scheme in our community. Your web site offered us with valuable info to work on. You’ve done an impressive job and our entire community will be grateful to you. Barbers New York

mtomNov. 17, 2019, 12:17 p.m.

When I originally commented I clicked the -Notify me when new surveys are added- checkbox and after this each time a comment is added I recieve four emails with the exact same comment. Could there be in whatever way you’ll be able to remove me from that service? Thanks! Barber shop near Victoria

mtomNov. 17, 2019, 12:17 p.m.

I work for a company that is wanting to e-mail some of our media contacts from our Press Release blog posts. The main problem I am running into is finding a service that doesn't require opt-in. Does anybody have any suggestions?. Barber Paddington

mtomNov. 20, 2019, 2:48 p.m.

My husband and i ended up being very cheerful when Ervin could finish off his investigation through the ideas he came across from your weblog. It is now and again perplexing to simply happen to be giving out key points which others could have been trying to sell. So we know we have you to be grateful to because of that. The explanations you made, the straightforward web site navigation, the friendships you help foster – it is many fabulous, and it’s helping our son and the family know that this idea is fun, and that’s incredibly vital. Thanks for all the pieces! pay day loan consolidation

Some truly excellent articles on this internet site , thankyou for contribution. 사다리조작

katedaisyNov. 22, 2019, 8:57 a.m.

It looks very good, I always have to ask, thank you for your information wuxiaworld

RobertaNov. 22, 2019, 6:30 p.m.

IDM 6.35 Crack [Preactivated]

Web Download Manager IDM Crack and fix are the most requesting programming for Download recordings, reports, and programming. The idm crack is accessible in connection underneath and you didn't have to enroll web download supervisor since it is preactivated form.

Web Download Manager life time Registration

Web download supervisor know as IDM have 30 days time for testing. We got an answer for this and repack the web download supervisor. Along these lines, we make it enlistment free implies you didn't have to enlist it. No time for testing for idm, no enlistment required, no fix or crack required. Simply download and introduce it and appreciate forever time. IDM full crack

Each new form is accessible for download in Preactivated. So at whatever point you need to download the most recent form simply return on this site and in download crack is you will locate another and refreshed adaptation of IDM.

How to sidestep IDM patch?

There is no 30 days preliminary in this variant. Simply introduce and feel free of pressure of 30 days or some other issue. There are quantities of ways individuals use for 30 days preliminary. A large portion of them may work incidentally download crack yet there's no single strategy to carry out that responsibility. Individuals utilize crack, fix and sequential numbers yet flop after each new update.

Step by step instructions to introduce IDM serial key

Simply watch the total video for establishment guide of IDM

Windows 8.1 Activator

bandicam crack

4k video downloader crack

windows 7 professional product key

cleanmymac crack

avast license key

office 2013 product key

cracking software

crack software

mtomNov. 28, 2019, 9:30 a.m.

“I am a big fan of this web site would like to go on updated” Ziemassvetku davana

Custom Research Paper Writing ServicesNov. 28, 2019, 12:38 p.m.

If handling your Custom Research Paper Services and it seems difficult considering the intensive nature of studying programs, hire Custom Research Paper Writer from Legitimate Custom Research Paper Company.

mtomDec. 5, 2019, 7:49 a.m.

Great site, determined several something totally new! Subscribed RSS for later, aspire to see more updates exactly like it. 420 Teleport

mtomDec. 5, 2019, 8:31 a.m.

This web-site can be a walk-through rather than the information you wished about it and didn’t know who must. Glimpse here, and you’ll definitely discover it. Ash Catchers

Aw, this is an incredibly nice post. In thought I would like to put in place writing like this moreover – spending time and actual effort to create a good article… but exactly what do I say… I procrastinate alot through no indicates seem to get something accomplished. Carb Caps

sfssfDec. 11, 2019, 7:49 a.m.

The third venue comes in the form of the Cavern Pub; open daily from 11am with a staggering amount of Cavern and rock memorabilia on display, including live music every night that won’t cost you a penny.

popchatDec. 13, 2019, 1:50 a.m.

I think you should explain it in a more understandable and detailed manner, anyway I can get information from your article, thank you! jigsaw puzzle

Archibald PlasterfullDec. 22, 2019, 11:22 p.m.

Howdy once more it was actually a really exceptional adventure for me and my buddy when we called in at your blog. I hope you don't mind if I praise you on the superior quality of your work and additionally to wish your team the best of luck with everything as you progress from now on. It was obviously a pleasure to look at your blog and I'll surely be stopping by once more to find out how you are doing. Take care and with a bit of luck I shall doubtless see you here once again in the very near future - Archibald Plasterfull

goal kenDec. 31, 2019, 9:23 a.m.

Your share is the great knowledge I have gathered, you are an important person I admire, thank you basketball legends

paulJan. 11, 2020, 11:07 a.m.

AP Junior Lecturer Previous Papers are given on the official page @ by the recruitment board of Andhra Pradesh Public Service Commission (APPSC). So, the candidates who have applied for this recruitment can download the APPSC JL Model Paper 2020 along with Solutions from the main page.

mtomJan. 15, 2020, 1:09 p.m.

Hi, I just ran across your weblog via Bing. Your viewpoint is truly pertinent to my life right now, and I’m really pleased I discovered your website. Enail Kit

Aaron HomesJan. 27, 2020, 4:30 p.m.

Hello there, I should say it was a genuinely marvelous experience for me when I looked around your blog. I just wanted to congratulate you on the level of quality of the work and additionally to send your team good luck with it as you advance as time goes on. It was unquestionably a pleasant adventure to view your internet site and I will surely be dropping by again to find out precisely how you're progressing. Cheers and with a bit of luck I will see you here again soon - Aaron Homes

Subhan HandyJan. 30, 2020, 4:22 p.m.

Howdy once again it was actually a totally great experience for me when I checked out your site. I hope you don't mind if I applaud you on the superior quality of the work you have accomplished here and also to send your team all the best with everything as you proceed in the future. It obviously was a pleasure to check out your site and I shall most certainly be calling back again to find precisely how you are growing. Thanks a bunch and if luck is on my side I shall doubtless see you here again shortly - Subhan Handy

Edward PaintFeb. 5, 2020, 5:18 p.m.

Howdy, I must say it was a genuinely wonderful experience for me when I dropped by at your web site. I just needed to applaud you on the superior quality of the work and additionally to send your team the very best of luck with everything as you proceed down the road. It definitely was enjoyable to look at your site and I will certainly be stopping by again before long to find precisely how you're getting on. Thanks and I shall see you here before long - Edward Paint

Ayan LocksFeb. 8, 2020, 10:40 a.m.

Hi again it turned out to be a very awesome experience for me and my mother when we eventually called in at your quality web site. I just wanted to applaud you on the superior quality of the work and also to wish you bon chance as you develop in the future. It was a hoot to browse your website and I shall naturally be dropping by once more to see just how you're doing. Thanks and I will see you here once more before I kick the bucket - Ayan Locks

Denis DjweddingFeb. 11, 2020, 11:57 p.m.

Howdy, it turned out to be a very incredible experience for me and my dad when we dropped by at your blog. I hope you don't mind if I congratulate you on the level of quality of the work and to wish you bon chance with everything as you proceed as time goes on. It was a hoot to check out your web site and I shall certainly be stopping by once more to ascertain just how you are doing. Thanks a bunch and I'll no doubt see you here again for my next visit - Denis Djwedding

Jim SteveFeb. 27, 2020, 2:41 p.m.

test [url=http://test/]gahn[/url]

mtomFeb. 25, 2020, 6:39 a.m.

Written by the director and also Chris Henchy, I’ll even go as far as to say that this among the best comedic scripts since last year’s The Hangover. get your hands on some CBD

An impressive share, I just given this onto a colleague who was doing a little bit evaluation on this. And he in reality ordered me breakfast due to the fact I discovered it for him.. smile. Consequently allow me alter that: Thanks for the deal with! Having said that yeah thanks for spending the time to chat about this, I really feel strongly about it and adore reading additional on this topic. If possible, as you turn into expertise, would you mind updating your weblog with additional details? It?s quite useful for me. Giant thumb up for this internet page publish!

Nasim Laser CenterMarch 6, 2020, 7:23 a.m.

Your share is the great knowledge I have gathered, you are an important person I admire, thank you laser hair transplant in lahore

mtomMarch 6, 2020, 10:47 a.m.

This is the right weblog for everyone who is hopes to check out this topic. You already know a lot its practically challenging to argue along (not too I really would want…HaHa). You definitely put a fresh spin over a topic thats been discussing for some time. Excellent stuff, just fantastic! 389poker

Fantastic guide! Chatting about how treasured the entire digesting. I hope to learn from way more away from you. I know you’ve awesome look and additionally view. I happen to be very much contented using data. score88poker

Casper WindowMarch 10, 2020, 6:39 p.m.

Hello, I should say it was a truly amazing adventure for me personally when I looked around your site. I hope you don't mind if I compliment you on the high quality of your work and to send your team the best of luck with everything as you develop as time goes on. It was enjoyable to browse your internet site and I will probably be calling back once again to discover exactly how you're developing. Thanks a lot and with a bit of luck I shall no doubt see you here once again shortly - Casper Window

mtomMarch 11, 2020, 9:28 a.m.

Very well written article indeed, thank you so much for sharing such information with us. cbd gummies

mtomMarch 18, 2020, 3:11 p.m.

Have you ever thought about creating an e-book or guest authoring on other sites? I have a blog based upon on the same subjects you discuss and would love to have you share some stories/information. I know my visitors would value your work. If you are even remotely interested, feel free to shoot me an e mail. All Video Downloader

Treat Assignment HelpMarch 20, 2020, 12:18 p.m.

TreatAssignmentHelp is dedicated to provide online Perl Assignment Help for students who is perusing degree or diploma courses in universities. We have 24/7 Customer live support where you can discuss about your troubles with our specialized writers. We pioneer the Marketing Dissertation Help due to the flair and subject expertise of our pool of writers who promise to deliver 100% plagiarism free papers.

mtomMarch 21, 2020, 12:49 p.m.

Oh my goodness! an incredible article dude. Thanks a ton Nonetheless We’re experiencing trouble with ur rss . Do not know why Can not enroll in it. Will there be everyone finding identical rss dilemma? Anybody who knows kindly respond. Thnkx 안전놀이터

Hi there everyone, basically showing up to point out that the article is quite interesting, whilst there happen to be some fairly odd feedback. vvs pens

ps5 release dateMarch 23, 2020, 8:06 a.m.

This is a great thing, I think everyone feels this information is very valuable, thank you basketball legends

Euan BoileryMarch 23, 2020, 11:48 p.m.

Good day, it was actually a genuinely exceptional experience for me and my buddy when we eventually called in at your blog. I hope you don't mind if I commend you on the high quality of the work you have completed here and additionally to wish you good luck with everything as you move on into the future. It was a hoot to surf your site and I shall undoubtedly be calling back again shortly to find out exactly how you're progressing. Thank you and if luck is on my side I shall see you here once again in the near future - Euan Boilery

Lucille F. ParhamMarch 24, 2020, 4:26 a.m.

Amazing! This just came in minutes ago and you've already made a post about it! Way to go for keeping us updated daily. I most definitely will recommend this to others. Subway Surfers online game

mtomApril 5, 2020, 7:37 a.m.

This web site is often a walk-through for all of the knowledge you wanted with this and didn’t know who to inquire about. Glimpse here, and you’ll definitely discover it. 라이브스코어중계

Generally I do not read post on blogs, however I wish to say that this write-up very compelled me to take a look at and do so! Your writing style has been surprised me. Thank you, very nice article. cbd marketing


Post New Comment