HomeОбразованиеRelated VideosMore From: Mark Moeykens

Reusable Custom Popups - Part 1 (iOS, Xcode 9, Swift 4)

711 ratings | 42645 views
Part 1 This video series covers how to create a reusable custom popup in a separate view controller and access it from anywhere in your project. In this case, we have a popup with a date picker. In the following videos I will be covering: * How to pass data into the reusable popup. * 3 different ways in which to pass information from the reusable popup back to the view controller that opened it. * Memory leaks and how to check for them and fix them. And, of course, you will be learning other handy tips along the way. Create reusable popups today! 🛠 Project Files on Patreon: https://www.patreon.com/posts/16031272 ✴️ Patreon: http://www.patreon.com/bigmountainstudio Facebook: http://www.facebook.com/bigmountainstudio Code Blog: http://swiftquickstart.blogspot.com/ Twitter: https://twitter.com/bigmtnstudio GitHub: https://github.com/bigmountainstudio Want to buy me a coffee or a beer? ☕️ 🍻 ✊🏼 Venmo: @MarkMoeykens ✴️ Patreon - For $3-$25 you get a bunch of cool projects that I teach on YouTube and that I teach outside of YouTube: http://www.patreon.com/bigmountainstudio #markmoeykens #bigmountainstudio #iosdevelopment
Html code for embedding videos on your blog
Text Comments (132)
J McLovin (25 days ago)
Great tut, Mike. If you wanted to make a reusable view controller to display a message to the user from anywhere in the app, how would you do it without creating segues from all view controllers to the custom pop up? Thanks!
Mark Moeykens (21 days ago)
Hey, McLovin, In my latest series (Itinerary App Series) I do this with some of the screens. You want to basically instantiate your reusable viewcontroller and then call present it. Something like this will do: let storyboard = UIStoryboard(name: "ReusablePopupViewController", bundle: nil) let vc = storyboard.instantiateInitialViewController()! present(vc, animated: true)
Tenly2009 (27 days ago)
Video is called “Reusable Custom Popups” so I don’t get why it spends a minute saying “you could also do it this way” and demonstrating a non-reusable pop up. I think it would be a better video if that irrelevant tangent was completely cut out. In general, I don’t like instructional videos that spend too much time discussing/demonstrating the wrong way to do things. I do prefer your videos to most others - so this comment is meant to be constructive. Thank you for making all these videos.
Mark Moeykens (21 days ago)
Hi, I'm sorry, I don't do any private tutoring. I've pretty much over-allocated my time with 4 jobs and a family. 😃
Tenly2009 (27 days ago)
Mark Moeykens Do you do any private tutoring? I have an app I’ve been working on (as a hobby mostly) for about a year now. It’s a utility of sorts that I’ve shared with about 8 people. The app works, and they all love it - but I’m not happy with it and want to re-write parts of it. Specifically, I have 2 custom views that I reuse throughout the app but I’m pretty sure I made some rookie mistake when I created them - or when I try to use them - because I often have to do all kinds of stupid little things to make them render properly in collection views, table views, etc... If your time is not too expensive, I’d like you to take a look at how I’ve built the custom UIView and explain to me where I went wrong and ideally how to fix it... or, in lieu of payment, maybe you could use this exercise as the subject of a future video tutorial...? Oh yeah - I don’t use storyboards, so it’s all stored in 2 .swift files.
Mark Moeykens (27 days ago)
Thank you, I appreciate the feedback! 👍🏼
Thanks for the tutorial. Do you know how can I do this using a .xib file?
Noah Schmidt (2 months ago)
Hi Mark, I'm having a very strange issue(s). The first being, when I go to segue by tapping the button, the tab bar turns white and that's it. I can't see or interact with any part of the pop up View. The second is I have a Theme class set, so my app can alternate in between dark and light mode. Whenever I go to specify what items on the popup view should be governed by the Theme class (which I do the exact same way as all the other view controllers) my app always crashes. Running Swift 4.2 on Xcode 10
Reema Alhassan (2 months ago)
i need to do the same what you did for the date picker but not when the user press the button. i have a beacon so when the user enter the area he will see a pop up i made that in the code : let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let QuestionViewController = storyBoard.instantiateViewController(withIdentifier: "Questionscene") as! QuestionViewController self.present(QuestionViewController, animated: true, completion: nil) and it works fine except the background i couldn't make it (over current context ) do you know how can i do that?
Mohammad Yunus (3 months ago)
amazing man!!! thanks
Mark Moeykens (3 months ago)
Oh good, you watched it! Hope this series is helpful.
Joe Emenaker (4 months ago)
On Lynda.com, this bit of learning would take 3 hours and cost $50.
Joe Emenaker (4 months ago)
​+Mark Moeykens Well, it's not _that_ much. Looks like it's $30/mo (not sure if that's access to the entire library, though). Still, though, their videos strike me as a little dry and uninspired. What I think puts your videos a few notches above theirs are: the pacing is higher, you show a few different ways to accomplish something, you do these little 1-2 minute tangents (where you go "Oh, you guys want to see something neat?". For someone short-attention-span like myself, those little digressions give my brain break from the main topic of the video), and, most importantly, you show the quick ways to give your app _really_ slick effects (I'm thinking of the Tinder-like card swiping. The ease with which you made the animated slide-up sharing menu is the kind of stuff that makes someone one of those fabled "10x" programmers).
Mark Moeykens (4 months ago)
Wow! I didn't realize how much that costs!
Coding Gyan (5 months ago)
you are really amazing sir , i am from india , i have already youtube channel , i started my youtube channel to teach poor student that can't afford online Bootcamp and online course , please sir ,you have a great knowledge please teach us any complete project from sketch (form idea to complete app to publish apple app store) ,you have a great knowledge , and you know how to share knowledge, please teach us........
Mark Moeykens (5 months ago)
Thank you! I am in a middle of a series right now that starts from the very beginning of app development. You can find it here: https://www.youtube.com/playlist?list=PLHDMmeIMXj8UV9xqF7Mr2Puh8xehDCy-O
Serxhio Al (5 months ago)
Hey Mark, your content is amazing, this whole series about the reusable popoup and passing data through different ways is so precious! I personally don't use storyboards but you made it so easy to follow along and I actually converted everything you said to a Programmatic approach! If someone would like the source code (only for this video), I'll be glad to share:) Once again Thank you Mark!
Mark Moeykens (5 months ago)
Thanks, Serxhio, that means a lot to me.
Myulz J (5 months ago)
goddamn i hate storyboards
Mark Moeykens (5 months ago)
Myulz J, I would love to hear your main complaint on Storyboards. I have connections with the Xcode team and I can share with them your suggestions for improvements.
chrispy_wa (6 months ago)
Great advise on the theory of why there are instances where unwrapping does not help you to debug your code. I've learned more than one thing today so it's an awesome day.
Mark Moeykens (5 months ago)
Ha ha, glad to hear it! 🙌
Tom David (6 months ago)
Hello Mark. Thanks for the tutorial. I'm a newbie and your approach is very clear and simple as compared to the other videos. Other videos just want to showcase how smart they are not taking into consideration of the basics in app development. :) A question on segues, how do you create segues where the "Animates" checkbox is not checked by default. Or is there a trick where you configure a View Controller, when called to load, will not animate? Perhaps a similar approach to your technique where you configure the View Controller Presentation setting to Over Current Context and not on each segue. Thanks.
Mark Moeykens (6 months ago)
Thanks, Tom! Regarding your question, are you talking about when you want to perform the segue in code and you don't want the animation? Because it sounds like you know how to do it inside the interface builder's attribute inspector (unchecking the animation checkbox manually). From what I can tell, it looks like there's no actual property for "Animates" in the attribute inspector. Instead it looks like you have to create a custom subclass of the UIStoryboardSegue and when navigating set false for animation (https://stackoverflow.com/questions/16209113/push-segue-in-xcode-with-no-animation). Example: import UIKit /// Present the next screen without an animation. class ModalNoAnimationSegue: UIStoryboardSegue { override func perform() { self.sourceViewController.presentViewController( self.destinationViewController as! UIViewController, animated: false) } }
王蔚瑄 (6 months ago)
Hi Mark, thanks for this great video! I agree with "don't always write safe code". But I also curious about when will you use "if let". Can you talk more about that? Thanks a lot!
jonathan3087 (6 months ago)
Thanks for the great video. One question, how would I get the popup to slide in from the side instead of from the bottom. I'm really trying to create a slide in menu like in one of your other videos, but I need it to be in a separate viewController, so that it is reusable throughout my app. Thanks for any help or suggestions in advanced.
jonathan3087 (6 months ago)
Mark Moeykens Great thanks for the ideas, I'll research those ideas. Also I'll will be on the lookout for you upcoming videos. Keep up the good work.
Mark Moeykens (6 months ago)
You're welcome, Jonathan. Unfortunately there's no easy way to do it. Xcode doesn't provide us with a transition for it to come in through the side, just up from the bottom (default). I have some ideas though you could try. Sliding in from the side is the default animation when using a Navigation Controller. So you might want to look into using a Navigation Controller but hide the nav bar on top. My other idea would be to build a custom transition using UIViewControllerAnimatedTransitioning. This is a bit more advanced. I'll probably be teaching this topic in a future video for the Itinerary App Series I'm currently in the middle of. But that could be a few weeks off still.
Os Loren (7 months ago)
The best tutorial on popups !, You're the best! Thank you very much!!!
Mark Moeykens (7 months ago)
Ha ha, you're welcome! Hope you are learning a lot. 👍😀✊
leumasdiderot (7 months ago)
GRRRREAT!!! This was exactly what I needed right now for my project.... many many thanks!! 🙏
Mark Moeykens (7 months ago)
You're welcome! 🤘🏼
orium dev (7 months ago)
hi! that about landscape, how to manage popup height then ?
yankabelarus (7 months ago)
is it possible to (adjust segue maybe) show another fullscreen viewcontroller for landscape?
Mark Moeykens (7 months ago)
Oh man, popups are tough when it comes to landscape. We struggle with this at work. Especially on the iPhone SE. It's worse when you need to see the keyboard and the popup at the same time. Eventually we just lock portrait for popups as landscape didn't give our users a good experience and they would just turn the phone to portrait anyway.
He Ro (7 months ago)
Hi Mark, great videos and content. Do you have any advice for someone who is self-taught iOS programming and trying to get a Junior iOS Developer position in the near future?
Mark Moeykens (7 months ago)
Hello! Well, as someone who has hired a lot of developers in the past I can tell you that the only thing I'm looking for is someone who can do the job. It doesn't matter if you are self-taught or have the best or most expensive education. No amount of school can guarantee the individual will be a good developer. So what I'm looking for is someone that can do the job (and get along with the rest of the team). It's that simple. So what you need to do is prove to future employers that you can do the job with something on your resume. You can do this by collaborating with some friends on an app,, creating your own app and putting it on the App Store or maybe talk to your current employer and convince them to allow you to build an app for them. Maybe you will have to build it after work hours but at least you can put that on your resume.
별자리TV (7 months ago)
How to let it dismiss by click any part outside it?
Mark Moeykens (7 months ago)
I usually use a button that fills the screen. Here's an example from another series: https://youtu.be/DmWv-JtQH4Q?t=7m55s
Rajat Chaudhary (7 months ago)
another Awesome Video :)
Mark Moeykens (7 months ago)
Thanks for watching, Rajat. ✊🏼
Marl Atkins (8 months ago)
I wish I found you when I started this endeavor. This is easily the best tut on Apple dev I've seen so far. GREAT JOB!!
Mark Moeykens (7 months ago)
Wow, thanks, Marl! I'm glad my videos help! 😃 👍
Vlad Podvoiskyi (8 months ago)
where is result?
Mark Moeykens (8 months ago)
This is part of a YouTube Playlist. Here are the rest of the videos: https://www.youtube.com/playlist?list=PLHDMmeIMXj8VErZQxkeUnBadPaFxEL4kl
Nacho (8 months ago)
Can you please recommend me a custom UI Book without using Interface Builder?
Mark Moeykens (8 months ago)
Hi Ignacio, unfortunately I don't know of a book for coding UI. ☹️ But you might be interested in my colleague's YouTube channel where he specializes in coding UI. His name is Brian Vong and his channel is here: https://www.youtube.com/channel/UCuP2vJ6kRutQBfRmdcI92mA/featured
Kaiseration (9 months ago)
Nice tutorial, thanks a lot. I will subscribe you, and hope you will continue your great works! All the best.
Mark Moeykens (9 months ago)
Thanks, Kaiser! I just recorded another 3 videos last night. So you should start seeing more coming out soon.
Vipul Chauhan (9 months ago)
Excellent video with nice presentation.
Mark Moeykens (9 months ago)
Thank you, Vipul!
Muhammed Yaseen (9 months ago)
Great video! But you could definitely make it smaller!
Muhammed Yaseen (9 months ago)
Mark Moeykens :-)
Mark Moeykens (9 months ago)
Thanks! Yeah, I know what you mean! Sometimes I describe things too much!
Muhammed Yaseen (9 months ago)
Lovely video! Keep it up!
Mark Moeykens (9 months ago)
Thanks, Muhammed 😀
Josh R (10 months ago)
I just love this video. There is so much information provided. Thank you Mark.
Mark Moeykens (10 months ago)
You're welcome, Josh. Glad you liked it!
Sam WD (10 months ago)
Mark, you are one of the best teacher, the way you explain the things is outstanding. i wish if you could make a course on udemy. even though i have started the iOS swift three months ago but haven't learned anything yet to make any practical application. cause the real world programming is really difficult for example data model etc, i wish if you could come up with a course for us. also my most requested course of firestore or firebase would be the dream come true.
Mark Moeykens (10 months ago)
Thanks for your feedback, Sam. I appreciate it! I wish I could dedicate more time to making these tutorials but it's hard enough to come out with a video a week sometimes! I got a lot going on. I have a new series I've been working on that you might be interested in. It's the "Itinerary App Series". Only about 10 videos into it but it'll probably be 30 by the time I'm done.
Alireza aj (11 months ago)
your channel is Greeeeaaat ! thank you so muuch for time that spend teaching us.
Mark Moeykens (11 months ago)
You're welcome, Alireza. It's my pleasure.
Phani M (11 months ago)
Hi , Am not able to refactor the popup UIViewcontroller to a different storyboard. When i select UIViewController and then Editor->Refactor to storyboard a copy of the new storybaord is created in Base.Iproj but i dont see that in the left hand project navigation in Xcode and the UIviewcontroller is still showing in the Main.storyboard. Any help appreciated. Thanks!
surjeet rajput (11 months ago)
Hi Mark, really liked you tutorial. I have a question . How to create popover from nib or without using storyboard ?
Mark Moeykens (11 months ago)
Hi Surjeet, I haven't used a nib for a popup but that's an interesting idea. I have a couple videos where I display a view inside a VC for a popup: UIView as Popup: https://youtu.be/k-GvIqh5Xcs UIView in Scene Dock: https://youtu.be/WnlPZbSnlLI And Brian Advent has a video on displaying a nib in your VC: https://youtu.be/tvQxXoV527w?t=5m46s
Martin Schneider (11 months ago)
Thank you Mark.. great video! That's exactly what I was looking for!
Mark Moeykens (11 months ago)
That's great, Martin. Glad I could help!
Amanda Taillacq (11 months ago)
Hi Mark, I'm new to iOS and Swift programming, so I find very helpful all your videos. I have a questions. It is possible to call the popup without any segue? Like if it were a message with OK or Cancel options. Thank you and keep the good work!!
Mark Moeykens (11 months ago)
Yes, Amanda, I show how to do this later in the video. Take a look around 21:25 to see the code. That code does not use a segue.
TrollBronze (1 year ago)
yo, alot of other people telling me to move away from storyboards and do everything in code. what is your thoughts? thanks.
Mark Moeykens (1 year ago)
I get this question a lot. And I've been down both roads. I started leaving storyboards and I found out it was because there were things I just didn't want to take the time to learn. So instead I set out to clear up those questions or recurring problems I had with layout, merge conflicts, size classes, etc. And I did answer all of them and now I feel no need to abandon storyboards. Quite the opposite happened, now I love storyboards and got so good at them I can prototype with ease and speed. The honest truth was I was just too lazy to find out answers at first! But realizing my own shortcomings I figured others must have these problems too. So my shortcomings became a source of topics for videos! I found this to be the case with two of my coworkers as well. They were running into problems with storyboards and wanted to abandon them. So I sat with each individually and found out the exact reason why they wanted to abandon them and in each case there were only about 2 very specific problems or things they didn't know or understand. We cleared it up and they've never had a problem since. So when someone suggests to you to move away from storyboards they may have been suffering from some problem that I and my coworkers had suffered from too. Ask them specifically what it is they don't like or don't know about storyboards and you might be able to help them out! I created a lot of tutorials with storyboard tips and try to lend insight when common problems come up in my videos. I also LOVE this article of how this one developer works with storyboards too: https://medium.cobeisfresh.com/a-case-for-using-storyboards-on-ios-3bbe69efbdf4 I plan on using some of his tips in my current series I'm recording. I hope this helps! Feel free to share any problems or uncertainties or things they don't understand. I would love to help out my fellow developers! We're a small community and it's good to lend everyone a hand now and then.
Smart LIGA (1 year ago)
Absolutely agree with "if let" and "!" unwrappers. It's better to know where your app crashes because of nil instead then just let it go. I was glad to hear that someone with pro experience have the same opinion as my.
Mark Moeykens (1 year ago)
Ha ha, yeah, I think this opinion has formed a long time ago as a developer. I found sometimes it's better not to have error handling (or nil checking) where something should NEVER have an error or a nil and if it does error, I want to know about it right away and fix it!
All Swift Developer (1 year ago)
Love this series so far! Great explanation!
Mark Moeykens (1 year ago)
Thank you! Hope you like the rest. :)
MasteRock87 (1 year ago)
Also, it would add a lot if we change the transition style for the date popup  into 'Cross Dissolve', it would make it more user friendly :)  Thanks for the awesome presentation, keep it up
Mark Moeykens (1 year ago)
Yeah, I like that transition as well. Thanks!
zain developer (1 year ago)
Mark Moeykens Please make video on size classes , you are best teacher
Keith Bamford (1 year ago)
Hi Mark Great video thanks...I have a question, I have created a UICollectionViewController which includes a nested collectionView (one collection view in the cell of another!) in code and would like to present a popUp when the user clicks a cell of the nested collectionView, in CollectionView didSelectItemAt but unfortunately a UICollectionViewCell class does contain the present(viewControlerToPresent:...) method. Any ideas how I could present popup other than re-creating  the collectionView in a storyboard and using perform(segue)?
Keith Bamford (1 year ago)
Figured out the solution, used delegate/protocol pattern to get the viewController to call present(popup)...works perfectly
Sebastián González (1 year ago)
Great video! How you dismiss the modal when tapping outside?
Sebastián González (1 year ago)
Thanks!
Mark Moeykens (1 year ago)
Thanks, Sebastián! Well what I do sometimes is just use a button behind the UIView of the popup. I expand it so it's always full screen and when tapped just call dismiss.
Christophe Poulin (1 year ago)
Great video, learned a lot! Thanks!
Mark Moeykens (11 months ago)
Awesome, I'm glad. 😃
Tarun Sharma (1 year ago)
Hi ! I loved your prototypes tutorial. I'd learned great things from you. Look at this project, https://dribbble.com/shots/2790457-Tubik-Studio-Healthy-Food-App Thanks
S V (1 year ago)
Hi Mark, probably the best and easy to understand tutorials for a beginner like me! You should make an udemy course or something like that! Really great work explaining and teaching! Thank you, keep up the awesome work man!
Mark Moeykens (1 year ago)
That's awesome, I'm glad you liked it. I always try to keep the beginner in mind and explain everything in case the person is new. I figured if they are advanced they can watch the video at 2X speed. I totally keep thinking about a Udemy course. I will have to come up with a course outline. 😄
x x (1 year ago)
Such great tutorials with an experienced developer like you are very unique on youtube. Great job! :)
Mark Moeykens (11 months ago)
Thank you for you kind words!
Raja Sivagaminathan (1 year ago)
Very well done!
Manjula P Reddy (1 year ago)
Neatly explained the storyboard reference
Mark Moeykens (1 year ago)
Thank you, Manjula. I'm glad you liked it. 😀
Megala nathan. P (1 year ago)
Hi Mark really your videos are awesome, if you can please upload code in GitHub. its more helpful
Easy Digest (1 year ago)
Hey Mark. I LOVE they way you explain code and how you don’t expect your viewers to know the basics. This helps so much! Keep them coming please!
Easy Digest (1 year ago)
Yes, seriously! You should consider making a course. I would buy it! You explain so well! Anyway, thanks and I hope you're have a great week!
Mark Moeykens (1 year ago)
Yeah, that's what I feel is good with YouTube because I can't tell who the viewer will be. So I like to start basic and figure more advanced people can speed up the video or use the arrow keys to skip ahead in the video. Ha ha, that's what I do anyway, I watch most videos at 2X speed and then slow it down when I get to something I'm not familiar with. 😀
Sigor Ezz (1 year ago)
I noticed you didn't use any auto layout (by pinning) but only used the auto resizing. Do we only use one or the other or do we use both?
Sigor Ezz (1 year ago)
Ok makes sense! Thank you for the quick reply!
Mark Moeykens (1 year ago)
Great question, Sigor! As of Xcode 8 you can now use both. Before you could only use one or the other. What I find myself doing is starting with Autoresizing and getting as far as I can. It's fast and efficient and in some cases easier, especially when you want to set items to percentages of the screen (example: you want an image to always be half the size of the screen). Then when I can't get what I need from autoresizing, I switch to constraints. For example, you definitely need constraints if you want to stretch out a Stack View. Here's a quick video I made for more info on Autoresizing: https://youtu.be/pI-yolo9NrM
Michael Harden (1 year ago)
Hey mark I’ve been trying to figure out for a long time now how to move navigation bars, and have views on top of a navigation bar layer. So like if I were to have a side popout menu, how could I have it on top of the navigation bar layer when the menu opens and also how could u move the navigation bar over for example if I were to want the nav bar to slide to the right or left when the menu opens. I’m not sure if that made since or not if not I would be glad to clarify. You don’t have to respond I was just thinking it could be a good video for your navigation bar series you are doing. I know I would learn a lot from it. Also i Love the fresh new content. Glad your back to the YouTube game
Carlos Linares (1 year ago)
Hey Mark, great video. I was thinking about the force unwrapping at the end and I think is a good idea of the optional chaining (maybe with guard statement to avoid the identation) and call the fatalError function to crash with elegance and show to appropied message
bennyty (1 year ago)
@Mark It is simply a function that is guaranteed to never return. It will unconditionally print a message and stop/crash your program. In my opinion, it is better to force unwrap it in this case; the auto-generated error message is good enough. fatalError() certainly has its place.
Mark Moeykens (1 year ago)
Hey Carlos, I'm not familiar with the fatalError function. What is that?
Awesome video Mark! After watching this part, I immediately applied it on one of our company projects. Saved me a lot of time copying and pasting everything lol! Thanks! Looking forward to your new videos.
Mark Moeykens (1 year ago)
That's so awesome, Mark! Glad the tutorial helped!
Tophy Zhang (1 year ago)
thanks for let me lean so much from your video! And i have an question for you here. I create and clean new project with single view by swif4. there is only one button in first view , and i hope to present another view by touch this button. i written the code like: let todovc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "TodoViewController") ,,, then when i type the code: self.persent(... Xcode didn't give me any tips but an error : Value of type 'ViewController' has no member 'persent'... I free very confus because from your video, UIViewController do have method called 'persent', right? Holp can have your reply! Thanks again!
Mohammad Tahir (1 year ago)
Awesome
Mark Moeykens (1 year ago)
Thanks, Mohammad!
shingetzu88 (1 year ago)
Hi Mark, great video. This is the first time I've seen storyboard reference used so I learned something new again. Thank you. I do have some questions though. 1. When would it be ideal to use storyboard ref? Im thinking your selectTime storyboard could have been included in the main storyboard. What is the advantage of separating it? 2. From what I have learned in segues, its best practice to always have an identifer. Just wondering if that's true or not because you didnt use any here and it still worked. 3. For opening the VC via code, how come you didnt use a storyboard ID? That's another thing that was taught to me and wondering if its needed and when its needed? Is it because it is the initial view controller so we dont need to instantiate it and call the storyboard ID? Thank you so much!
Mark Moeykens (1 year ago)
I'm glad you liked the video! Let me see if I can answer your questions. You have some great questions by the way. 1. a. When you get a lot of scenes on one storyboard your Xcode will start to slow down. So fewer scenes equals better performance when developing. b. Also if you are working on a team it can make it tough to figure out which storyboard has the scene you or your team member is looking for. So if you name your storyboards and view controllers the same name, it makes it super simple to find things. Like: LoginViewController.storyboard and LoginViewController.swift. Easy! c. Say you are on a team. Two developers work on the same storyboard (one file) and commit it. When they merge that storyboard they could have conflicts which can be pretty difficult to resolve. Having the scenes in separate storyboards reduces this problem. 2. Segue Identifiers are totally optional but in the next video (https://youtu.be/gZHB0nPYIJE) you will see where an identifier comes in handy. 3. I would have had to use a storyboard ID if that popup was not the initial view controller. Since it was the initial view controller then iOS knows which view controller I want. In this case there will only be one view controller on that storyboard so I know that it will ALWAYS be the initial view controller. There's no chance it would change and the code would break in the future. Hope this makes sense. :)
Selcuk Bakkal (1 year ago)
Very good Tutorial! Thank you
Mark Moeykens (1 year ago)
Thanks, Selcuk!
Crack The Code (1 year ago)
Very good video, but couldn't one just use a container view (with a view controller) and reuse the view in there?
Crack The Code (1 year ago)
I have done it before, a container view can have it's own view controller and everything, and has lots of customization! Also, you can have it show in multiple views, showing the same content everywhere.
Mark Moeykens (1 year ago)
You know, I never thought of using the container view for a popup. I don't see why that wouldn't work. Interesting idea!
w0mbles (1 year ago)
This was very good. Thank you.
Mark Moeykens (1 year ago)
Thanks! I'm glad you liked it. 😀
But I don't think it's a good idea to show the grey background of the pob up view controller vertically. Can you just make it appear gradually like fade in or something like that where the pop up still be shown vertically. Is that possible ?
Mark Moeykens (1 year ago)
You're welcome!
Mark Moeykens thank you so much
Mark Moeykens (1 year ago)
It certainly is possible and in my test project I had it set that way but forgot to apply it while recording the new project. Here is what you do: 1. Open the popup view controller in the storyboard and select it. 2. In the Attributes Inspector pane there is a property called "Transition Style". Change it to "Cross Dissolve". That should do it!
jlstr (1 year ago)
Absolutely Beautiful! And I was just looking at Reusability patterns myself, Well done, keep it up Mr. Moeykens!
jlstr (1 year ago)
No, Thank You!
Mark Moeykens (1 year ago)
Thank you, Mr. Kenobi!
Rylan Evans (1 year ago)
Great stuff!
Rylan Evans (1 year ago)
Haha. For the record. I left that comment 5 minutes into the video! I watch all your stuff all the way through! 😃
Mark Moeykens (1 year ago)
Rylan, did you even watch the whole video? I just made this public! Ha ha ha, I'm just giving you a hard time, man. 😂
Raimonds Ķeris (1 year ago)
Thanks Mark. I just have learned something completely new for me in Swift.
Mark Moeykens (1 year ago)
Hello, Portugal! Thanks, Hugo. I'm glad you like my videos. 🙂
Hugo Santos (1 year ago)
Hi Mark, you are the best teacher I have in youtube.Thanks for the time you spend making then.They inspire me so much.Best regards from Portugal
Mark Moeykens (1 year ago)
That's awesome, Raimonds!

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.