Create Side Menu in App (Swift 5, Xcode 14) - 2023 Beginners

  Рет қаралды 36,997

iOS Academy

iOS Academy

Күн бұрын

In this video we will learn how to build a side menu in your app using Swift 5 and Xcode 11. We will also look at changing the controlelr after selecting a menu item in the side menu and customizing it.
💻 Source Code: / iosacademy
🎥 Subscribe for more: kzfaq.info?su...
😎 Like my teaching style? Check out some of my most popular courses!: courses.iosacademy.io
👉🏼 Connect (personal LinkedIn) / afraz-siddiqui
🚀 Follow on LinkedIn / ios-academy
Like my teaching style? Learn to build the TikTok iOS App with my recent course! ios-academy.teachable.com/p/b...
#swift #iOSDeveloper #sidemenu
Join the iOS Academy Community: iosacademy.io/
** Get Skillshare free for 2 Months and learn iOS
www.skillshare.com/r/user/afraz
** Manage all your investments from app earnings on Betterment!
bit.ly/3eBwlI9
** Grow your own KZfaq tech channel with TubeBuddy:
www.tubebuddy.com/iosacademy

Пікірлер: 115
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Enjoy my teaching style? Learn to build the TikTok App from scratch with my course! ios-academy.teachable.com/p/building-tiktok-for-ios
@binihalex8097
@binihalex8097 4 жыл бұрын
I noticed that you, just like me, can't continue coding unless you make it aesthetically pleasing. Great tutorial. Just what I needed for the app I'm building. Oh! and I SMASHED the like button.
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Hahaha i gotta make my code look perfect! Thanks so much!
@joshuamcdowell2721
@joshuamcdowell2721 4 жыл бұрын
Finally finished the tutorial after a few hours. Brand new to swift, and coding, and I must say you have such a logical progression when you are going through your lesson! You are quick but fluid in the lessons. My favorite part is when you go back to code you built before and re-format it so that it looks more clean and it becomes more efficient and it is simple to understand why it is easier. I haven't subscribed to anyone in about 8 years. Liked and subscribed. Thank you!
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Glad I can help! Thank you!
@aleynaaktas9528
@aleynaaktas9528 10 ай бұрын
Very nice video, thank you very much! 🙏
@jng88
@jng88 3 жыл бұрын
Thank you very much. I was exactly looking for this.
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Youre welcome
@eihabahmad
@eihabahmad 4 жыл бұрын
Very nice, thank you very much
@iOSAcademy
@iOSAcademy 4 жыл бұрын
You’re welcome, don’t forget to subscribe
@richie7596
@richie7596 3 жыл бұрын
For anyone whose storyboard layouts are not appearing when changing viewControllers, instead of instantianting them like: private let exampleController = ExampleViewController() Try adding a Storyboard ID to the storyboard layout you are trying to show and instantiate it like this: private let exampleController:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "yourStoryboardID") as UIViewController That worked for me, the rest of the code is the same.
@charrosea4054
@charrosea4054 Жыл бұрын
Thank you @richie7596 this was the missing piece for me! Amazing tutorial @iOSAcademy
@aymanomara8468
@aymanomara8468 3 жыл бұрын
thanks a lot dude for your effort really this helps me so much
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Youre welcome
@Andreylight2012
@Andreylight2012 2 жыл бұрын
Спасибо!!!
@ugoval4082
@ugoval4082 3 жыл бұрын
Just what I needed!!! I can't figure out how to hide the navbar, and I'm also having issues increasing the width. any idea how I should handle it??
@RubenGarza12
@RubenGarza12 Жыл бұрын
Great video! My question is (and I'm totally new to XCode/Swift) I want one of the buttons in the menu to open let say a page to add user information. Is there a tutorial for that?
@ramonbullock6630
@ramonbullock6630 3 жыл бұрын
Cool content!!
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Thanks
@Traptrickerplays
@Traptrickerplays 4 жыл бұрын
nice vid!
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Thanks
@sitbackandrelax9551
@sitbackandrelax9551 2 жыл бұрын
First off, this is awesome. Thank you! I do have a question though... I am trying to navigate further on each pane. For example, after you click on home, I might want to click on a button on the home screen that goes to another screen, but I want it to be able to go back to home. How do I do that?
@tny7390
@tny7390 3 жыл бұрын
can you do a slide down menu? like same thing but pushes the view down instead of to the right
@errinwright
@errinwright 3 жыл бұрын
Now what if we want to have the Info bring us to another viewController? Do you have a video for that?
@ANILKUMAR-vv1fz
@ANILKUMAR-vv1fz 4 жыл бұрын
Thanks for Very Great video. advance sideMenu Vc
@iOSAcademy
@iOSAcademy 4 жыл бұрын
You’re welcome, make sure to subscribe
@ANILKUMAR-vv1fz
@ANILKUMAR-vv1fz 4 жыл бұрын
@@iOSAcademy i subscrbed your channel . Iam Watching videos Regualarely
@intatlikitpolchaloon7814
@intatlikitpolchaloon7814 3 жыл бұрын
I install followed in this clip ,but cannot import SideMenu in ViewController class. It's only to be import Pods_SideMenu. However other pods can install
@pineowenn
@pineowenn 3 жыл бұрын
how can i put this on just a select few view controllers?
@plusvn92
@plusvn92 3 жыл бұрын
I saw your source code, all your controllers in left menu are present at same time?
@phillip3355
@phillip3355 4 жыл бұрын
Amazing video my friend, I have a fundamental question, does the other VC’s being passed into the side menu have to be child VC’s? Or can they all be their own individual controllers?
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Thanks, Child VCs are individual controllers. There are other approaches but I find this to be the cleanest
@avneetsingh2010
@avneetsingh2010 3 жыл бұрын
Sir how can we implement side bar after login screen?
@softwaredeveloper9402
@softwaredeveloper9402 2 жыл бұрын
This side is hella smart fr
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Thanks
@letskrishjourney
@letskrishjourney 3 жыл бұрын
Please post json parsing post method and display the value in table view
@iOSAcademy
@iOSAcademy 3 жыл бұрын
I have many JSON parsing videos
@simonlee2182
@simonlee2182 4 жыл бұрын
Bad, I cannot follow your instruction to do the next step that use the child controller to switch the view controller to "info" and "setting" with new VC and linked class file. What is the problem about that? The menu is not work and the navigation bar is gone after clicking the side menu item. Is it not the good way to handle the side menu which using coding to transit the VC in the menu?
@briannamcburney3009
@briannamcburney3009 3 жыл бұрын
Can I use this method and still design the controllers in storyboard? I'm new to swift and designing completely in the backend is still a struggle
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Yes, however, desigining in code will give you more control
@shadowriter1
@shadowriter1 4 жыл бұрын
Great Tutorial! Is there any way to remove the white tab bar space at the top of the side menu? Thanks
@jimfinnegan6535
@jimfinnegan6535 4 жыл бұрын
Hi Neelay. I think the following may help to remove the white tab bar that I think you are referring to. override func viewDidLoad() { super.viewDidLoad() let menu = MenuController(with: ["First","Second","Third"]) menu.delegate = self sideMenu = SideMenuNavigationController(rootViewController: menu) sideMenu?.leftSide = true *sideMenu?.setNavigationBarHidden(true, animated: false)*
@joshuamcdowell2721
@joshuamcdowell2721 4 жыл бұрын
@@jimfinnegan6535 Thanks Jim! I was working on that one for a couple hours. Cheers!
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Yep, just remove the status bar as shown below
@Oleh77ak
@Oleh77ak 3 жыл бұрын
hello i have issue with my Terminal, when i open Terminal and when im at the "pod init" part it says -bash: pod: command not found, do i have to make some settings?
@OphicialMusic
@OphicialMusic 3 жыл бұрын
install $ sudo gem install cocoapods, first then you have to generate your project, close the project, then add $ pod init
@jestinsaji8246
@jestinsaji8246 2 жыл бұрын
how to add contents in each viewcontrollers
@pineowenn
@pineowenn 3 жыл бұрын
Hey! I’m building an app that I want to build a side menu without a navigation bar, would i be able to do that?
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Yes, just set the nav bar to hidden
@rajeshkrishnan6060
@rajeshkrishnan6060 4 жыл бұрын
Thanks for the tutorial. I have a question on using Interface builder for the view controller created (Info or Settings). I created a view controller via storyboard and linked the class to the InfoViewController. Anything created on the storyboard is not translated to the views. How do I change the code so that the storyboard inputs will be reflected on the screen?
@jimfinnegan6535
@jimfinnegan6535 4 жыл бұрын
Hi Rajesh. I have only been coding for a little bit. I have the same question. The storyboards so far are easier for me to follow. One possible solution, I do not know how efficient it is, would be to not use the child view controllers. Instead once the "Info" (or whatever items you have in the menu side bar) is tapped to create a transition to that view controller. Then create a back button on that "Info" view controller which is a segue back to the navigation controller that controls the menu view controller.
@errinwright
@errinwright 3 жыл бұрын
I have this problem too. Been trying to do this for the past Week
@errinwright
@errinwright 3 жыл бұрын
Have you figured this out yet? I think it might have something to do with adding a child, but i dont know how to do that.
@Sportsplayer4Life13
@Sportsplayer4Life13 3 жыл бұрын
May someone please answer this question? Thank you!
@errinwright
@errinwright 3 жыл бұрын
@@Sportsplayer4Life13 I think you need to not use the side menu "case" items. You must instead use buttons and CTRL+drag them into the storyboard controllers that you are linking to. Using Buttons is just what I resorted to.
@dana.hq9
@dana.hq9 4 жыл бұрын
If I’m inside a side menu view controller and I need to move to a new view controller how I can do that? I tried to perform segue bu I have an error said (my side menu view controller) has no segue named (.....) can you help me
@thevitruvianman9781
@thevitruvianman9781 4 жыл бұрын
I think you might have to tell the new view controller that it'll need to accept segue type.
@mahmoudmelegi1501
@mahmoudmelegi1501 4 жыл бұрын
last part not working with me maybe cuz I'm using push navigation controller for a move between my screens?
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Yes, you need to use child VCs as pushing will look strange with a navigation VC container
@vanwolfowl9069
@vanwolfowl9069 4 жыл бұрын
How do you pass data in the side menu? When it instantiate to another view
@iOSAcademy
@iOSAcademy 4 жыл бұрын
delegates!
@Brillig2
@Brillig2 2 жыл бұрын
When you import UIKit, you no longer need to import Foundation, since that is included in UIKit.
@iOSAcademy
@iOSAcademy 2 жыл бұрын
Correct
@raquelcruz5219
@raquelcruz5219 4 жыл бұрын
Hi, thanks for the tutorial. Can you please teach how to insert icons in each line of the menu? I'm trying to find it and it's not easy to implement it. Thanks :)
@raquelcruz5219
@raquelcruz5219 4 жыл бұрын
Sorry :) I already found a way to insert the icons, but now I'm trying to insert padding (space) between lines. Can you help me with that?
@ruinedtouch
@ruinedtouch 3 жыл бұрын
hi can you send a link how you inserted icons in each line of the menu?
@raquelcruz5219
@raquelcruz5219 3 жыл бұрын
@@ruinedtouch Hi sorry for the late reply, I just saw your answer, do you still need help?
@ruinedtouch
@ruinedtouch 3 жыл бұрын
@@raquelcruz5219 no problem after i searched more i found it and i sent the job but i also curious about your solving can you tell?
@raquelcruz5219
@raquelcruz5219 3 жыл бұрын
@@ruinedtouch I created a variable var Images = ["logoWhite","subscribe","send","share-1"] with the images. then created a function: override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return min(menuItems.count, Images.count) } and then inserted the cell path on the override func tableview, like this: override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) cell.textLabel?.text = menuItems[indexPath.row].rawValue cell.imageView?.image = UIImage(named: Images[indexPath.row]) //cor dos textos das labels cell.textLabel?.textColor = .white cell.backgroundColor = darkColor return cell }
@BalaaLyf
@BalaaLyf 3 жыл бұрын
Please do sub menu this side menu
@gakkieNL
@gakkieNL 4 жыл бұрын
Are the pods you work with your own, or made by others?
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Both, mostly third party very popular ones
@gakkieNL
@gakkieNL 4 жыл бұрын
iOS Academy thanks! I’m learning still and prefer to do as much as possible myself, and thus stay away from pods atm. Would be cool to actually learn the functionality of these pods and be able to do it by myself...
@binihalex8097
@binihalex8097 4 жыл бұрын
The pod i installed was from cocoapods.org/. It worked perfectly. I didn't know you could develop one by yourself. Wouldn't it be awesome if @iOS Academy showed us how?
@BalaaLyf
@BalaaLyf 3 жыл бұрын
Please do drop down list in side menu
@iOSAcademy
@iOSAcademy 3 жыл бұрын
On my list!
@BalaaLyf
@BalaaLyf 3 жыл бұрын
Do more videos to related present trending apps
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Will do!
@shahidhaalla1123
@shahidhaalla1123 3 жыл бұрын
@@iOSAcademy I need sidemenu when I click cell it's collapse sub menu when I click submenu cell it will go to VC
@satyamdwivedi4067
@satyamdwivedi4067 3 жыл бұрын
How to connect any storyboard to the sidemenu options?
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Make a storyboard with an associated view controller class and add it as a child view controller
@selvavigneshnagarajan6409
@selvavigneshnagarajan6409 3 жыл бұрын
Storyboard layouts are not appearing when changing viewControllers. How to make them appear. Please guide me through this.
@nas7148
@nas7148 3 жыл бұрын
same
@ryanandrewbiugos2826
@ryanandrewbiugos2826 3 жыл бұрын
@@nas7148 do you have a solution for this ? I have the same issue
@cem890
@cem890 4 жыл бұрын
Can't we fix the blackness that appears on the navigation bar when the menu opens?
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Yep you can, its a status bar tweak
@milkistayn2641
@milkistayn2641 3 жыл бұрын
@@iOSAcademy how do you do it though
@jonKempEsq
@jonKempEsq 4 жыл бұрын
Great guidance mate, definitely a good idea for those learning to do the first video and then repeat using this updated version
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Yep, agreed. Glad you liked it!
@jonKempEsq
@jonKempEsq 4 жыл бұрын
@@iOSAcademy is there a tutorial you have made (or that you'd recommend) to assist in taking this to the next step by adding relevant data to the side menu options i.e settings etc.?
@joshuamcdowell2721
@joshuamcdowell2721 4 жыл бұрын
I have the same question. I'm trying to move onto the next step to edit the pages. I've done your other tutorials and linked a new storyboard view controller to the primary view controller in the didSelectMenuItem, but it makes the next page pop up as my storyboard. What are the next steps to change our new view controllers using storyboard?
@Sportsplayer4Life13
@Sportsplayer4Life13 3 жыл бұрын
@iOS Academy please help with this question.
@raquelcruz5219
@raquelcruz5219 3 жыл бұрын
@@jonKempEsq Hi Jon, did you get to know how to insert data to the side menu options?
@atomichades9529
@atomichades9529 3 жыл бұрын
Just FYI - great tutorial however, your nav could be implemented differently to be more resource efficient: Within your didSelectMenu Item switch: extension: Then lastly a var:
@karank6046
@karank6046 4 жыл бұрын
how to change background colour
@iOSAcademy
@iOSAcademy 4 жыл бұрын
Change background of table & cells
@drewmcclennon7606
@drewmcclennon7606 3 жыл бұрын
anyone know why 'MenuControllDelegate' doesnt work?
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Did you assign it!
@ronarooney1
@ronarooney1 4 жыл бұрын
I am getting this error Thread 1: Exception: "must pass a class of kind UITableViewCell"
@Peterchentwentyone
@Peterchentwentyone 3 жыл бұрын
I think you got to look onto the line "tableView.register(UITableViewController.self, forCellReuseIdentifier: "cell")" I changed 'UITableViewController' to 'UITableViewCell' and it runs perfectly :)
@AndrewwTheo
@AndrewwTheo 3 жыл бұрын
zsh: command not found pod
@iOSAcademy
@iOSAcademy 3 жыл бұрын
your CLI needs to be updated to use ssh instead of zsh
@BalaaLyf
@BalaaLyf 3 жыл бұрын
When we clicked sidemenu it will go drop down
@nurlanakylbekov7266
@nurlanakylbekov7266 3 жыл бұрын
IS THERE ANY TUTORIAL WHICH SHOWS, HOW TO CREATE 'SIDE MENU' WITHOUT ANY DEPENDENCY??
@iOSAcademy
@iOSAcademy 3 жыл бұрын
I dont think so but I can make one!
@jsedlacekjr
@jsedlacekjr 3 жыл бұрын
Checkout my custom made side menu on GitHub. github.com/JamesSedlacek/SideMenu
@cfasol
@cfasol 3 жыл бұрын
Excuse me, but you have used xcode 11.5 not 12
@iOSAcademy
@iOSAcademy 3 жыл бұрын
Haha yeah i updated the title