How to Build a Custom Tab Bar in SwiftUI

Sdílet
Vložit
  • čas přidán 9. 10. 2022
  • Watch me build a custom tab bar in SwiftUI based on a custom UI that was designed in Figma.
    This lesson is just one of the 30+ lessons that's inside our "How to Build a Chat App" course on CWC+, so if you want to learn more, make sure to explore the links below!
    🚨 SPECIAL CWC+ OFFER FOR CZcams:
    👋 Our "Launch Your First App" program will help you build up your iOS skills to publish your very own feature rich app even if you’re a beginner starting from scratch. cwc.to/youtubeoffer
    WEEKLY UPDATES VIA EMAIL:
    ✉️ Every Saturday, receive an email digest of new content - cwc.to/newsletter
    CONNECT:
    🌍 Website - codewithchris.com
    😺 GitHub - github.com/codewithchris
    📸 Instagram - / codewithchris
    🐦 Twitter - / codewithchris
    ABOUT CODEWITHCHRIS:
    We are dedicated to teaching the fundamentals on how to make an app. This is important if you’re trying to land an iOS job, be a freelancer, increase or start a business with an app idea. On this channel and our website, you'll find a ton of free resources and tutorials to aid you on your journey to learn iOS development. Many people have learned to code and build apps on their own! cwc.to/reviews
    DID THESE LESSONS HELP YOU?
    Please let us know! - fans.codewithchris.com
    #iOSTabBar #TabBar #SwiftUI

Komentáře • 51

  • @CodeWithChris
    @CodeWithChris  Před 23 dny

    👋 Our "Launch Your First App" program will help you build up your iOS skills to publish your very own feature rich app even if you’re a beginner starting from scratch. cwc.to/youtubeoffer

  • @random-sounds
    @random-sounds Před rokem +9

    Hi Chris, been your subscriber years ago (probably 4, 5). I just wanted to thank you for creating free content for all of us. If it hadn’t been for you, I wouldn’t be able to land a junior iOS job back then. My career started from your channel, and I can't thank you enough. I wish you the best of luck, and stay healthy. ❤

    • @CodeWithChris
      @CodeWithChris  Před rokem +2

      Wow! This means so much to Chris and the whole team! :) Thank you so much for learning with us! We wish you the best of luck too and stay healthy always! :) - Pat

  • @mintaddict4927
    @mintaddict4927 Před rokem

    Thanks for the useful tutorial.

  • @swiftuiforkids4768
    @swiftuiforkids4768 Před rokem

    Hi Chris! I love your videos! This is not at all related to this video, but it is just a question about an error that keeps happening in my code. It is not a systematic error, it is in the code somehow. The problem is whenever I make a navigation view and then I make a navigation title, the title does not show up for some reason. If you can, please reply to this message with your solution. Thanks!

  • @nlaspina
    @nlaspina Před 5 měsíci

    Hi Chris,
    Thanks so much for the video; I watch so many of yours eagerly. I built the custom tab bar and it works just as you have shown in the video but weirdly you didn't actually show the tab bar actually switching between tabs. I would've thought these would have gone hand in hand with the video. Could you please give me some guidance as to how to make it a functioning tab bar?
    Cheers, Nic

    • @CodeWithChris
      @CodeWithChris  Před 5 měsíci +1

      Hello Nic!
      We apologize for any confusion caused by the video on creating a custom tab bar. You're right; demonstrating the tab bar's functionality in switching between tabs would have been a useful addition. we appreciate you pointing this out.
      For guidance on making your custom tab bar fully functional, I recommend checking out a video by Swiftful Thinking: czcams.com/video/FxW9Dxt896U/video.html.
      Please be aware that this content is geared more towards intermediate learners and may include some advanced concepts. If you come across any terms or concepts that are unfamiliar, I encourage you to look them up. This approach will enhance your understanding and help you effectively implement the functionality in your project.
      Again, thank you for your feedback!
      -- Joash

  • @snossnosson6513
    @snossnosson6513 Před rokem +7

    Do you have any tutorials on how to actually link the tabbuttons to open their respective viewpages?

    • @williamb1301
      @williamb1301 Před rokem +1

      Did you end up finding any tutorials? I’m looking for the same thing

    • @HiJackBloo
      @HiJackBloo Před rokem

      looking for the same thing…

    • @williamb1301
      @williamb1301 Před rokem

      @@HiJackBloo I found a decent one by Sean Allen “SwiftUI Tab Bar…”
      He uses the storyboard tho (I used my iPad and playgrounds so that wasn’t as helpful)

    • @williamb1301
      @williamb1301 Před rokem +1

      @@HiJackBloo also “swiftful thinking” has one using the “TabBar()” function… which is slightly different that what these other videos use but might be easier and more straightforward

    • @HiJackBloo
      @HiJackBloo Před rokem

      @@williamb1301 thanks will look into it

  • @twizzlestix9309
    @twizzlestix9309 Před 9 měsíci

    Hi Chris- still learning SwiftUI and your videos have been super helpful. I’m trying to understand why this method is better than using tabview? Getting super confused what the best method is for approaching the bottom nav.
    😮 never mind- guess it pays to read other comments, you’ve already explained below

    • @CodeWithChris
      @CodeWithChris  Před 9 měsíci

      I'm glad you found it! Thanks for watching! - Iñaki

  • @ingridbkkedal5687
    @ingridbkkedal5687 Před rokem

    Thank you for the good tutorial! My nav bar will not move down on the screen, and only lays in the middle, would you have any tips as to fix this?

    • @CodeWithChris
      @CodeWithChris  Před rokem +1

      We suggest posting on our CodeCrew forum so that our tech support staff can help you. Just visit this link codecrew.codewithchris.com - Pat

  • @kiliankunkel4414
    @kiliankunkel4414 Před rokem +3

    Can you maybe explain how you coded the custom fonts? Nevertheless very nice video!

    • @CodeWithChris
      @CodeWithChris  Před rokem

      Yes, this is the next video in the series: czcams.com/video/4PI04Yj3Ngs/video.html
      @AdrienVillez

    • @kiliankunkel4414
      @kiliankunkel4414 Před rokem

      @@CodeWithChris What I meant is the Helpers/Fonts file, where you specify Fonts globally, so that I don't have to type it for every Text manually (the file at 05:46). It would be highly appreciated, if you could help me, I can not find infos for that anywhere! :/

  • @SOK-gn6hw
    @SOK-gn6hw Před rokem +1

    hey which keyboard are you using ? Sounds look good.

    • @muncho404
      @muncho404 Před měsícem

      sounds don't look, they sound

  • @sergioqcostas
    @sergioqcostas Před rokem

    Hide the nav bar and you’re gonna be my idol, lol.

  • @TheRealBlueBeanie
    @TheRealBlueBeanie Před rokem +1

    Thank you for the tutorial! Can you please make advanced tutorials for SpriteKit? It would be a new frontier that I think you would excel at!

    • @CodeWithChris
      @CodeWithChris  Před rokem

      Thanks for watching! You can leave tutorial recommendations here codecrew.codewithchris.com :) - Pat

  • @ElianasJourney
    @ElianasJourney Před rokem

    hi, is it possible tab bar with webview?

  • @akkhitech
    @akkhitech Před 10 měsíci

    Hi Chris,
    this is such a great tutorial. though, I have a question of how we can create views to serve each tab without rerendering each time a button is pressed? lets say, i'm editing text in one tab, secondly, go to another tab and then want to go back to the first tab to continue editing. How could we make the first tab keep all the thing i left before going to the second tab?
    Thank you

    • @CodeWithChris
      @CodeWithChris  Před 10 měsíci +1

      Hello @akkhitech, Thanks for watching and sending your message here. Unfortunately we can't provide it for you in the comment section here, but you can try joining and posting in our community: cwc.to/codecrew
      --Joash

    • @akkhitech
      @akkhitech Před 10 měsíci

      @@CodeWithChris got it. thank you very much.

  • @istanbulbeyefendisi1410
    @istanbulbeyefendisi1410 Před rokem +2

    I watching u first time. but I feel like i learned a lot watching u. can u put the Turkish subtitle this video pls?

    • @CodeWithChris
      @CodeWithChris  Před rokem +1

      I'll do one better, I'm gonna add Turkish subtitles everywhere! :)
      @AdrienVillez

  • @adeby
    @adeby Před rokem +4

    What's next? How do I use this tapbar to switch between views?

  • @danielduggin2898
    @danielduggin2898 Před rokem

    What tool are you using to reference the tab bar you want to build?

    • @CodeWithChris
      @CodeWithChris  Před rokem +1

      The tab bar was designed on Figma. We’re using Figma to check the UI Design’s specific properties so we can translate it to code accurately. - Pat

  • @jizhou749
    @jizhou749 Před rokem

    Hi, Chris, when I type ".font(Font.chatHeading), it shows me wrong, Type 'Font' has no member 'chatHeading'. Could you tell me how to fix this problem? Thank you.

    • @CodeWithChris
      @CodeWithChris  Před rokem

      Hi Ji Zhou! For technical issues, we recommend posting them on our CodeCrew forum so that our tech support staff can help you out. Just visit this link codecrew.codewithchris.com. Thank you! - Pat

    • @jizhou749
      @jizhou749 Před rokem

      @@CodeWithChris Thank you.😄

    • @RostislavRyzhkov
      @RostislavRyzhkov Před rokem

      THis is not default parameter for fonts, he created own extensions for fonts

  • @gamerstheater1187
    @gamerstheater1187 Před rokem +1

    Wait, how do I have it so that the buttons send me to different views?

    • @CodeWithChris
      @CodeWithChris  Před rokem

      We recommend posting on our CodeCrew forum so that our tech support staff can help you. Just visit this link codecrew.codewithchris.com - Pat

  • @petryuk2002
    @petryuk2002 Před rokem

    The problem is that when you open up the keyboard it will shift up the entire tab bar up

  • @katecosta571
    @katecosta571 Před 11 měsíci

    In what situation would you create a custom Tab Bar instead of using a TabView?

    • @CodeWithChris
      @CodeWithChris  Před 11 měsíci

      Hello, @katecosta571!
      While SwiftUI's built-in `TabView` provides convenient, out-of-the-box functionality for creating tabbed interfaces, one of the reasons why you might choose to create a custom Tab Bar instead is
      **Customized Appearance**: If you need to customize the appearance of the Tab Bar beyond what is available in `TabView`, you would need to create a custom Tab Bar. For instance, you might want to change the color, shape, or size of the Tab Bar, or add unique animations and transitions.
      In general, creating a custom Tab Bar is more work and requires a deeper understanding of SwiftUI. However, it provides greater control and flexibility over the appearance and behavior of the tabbed interface. As with most development decisions, whether or not to create a custom Tab Bar will depend on your specific needs, the complexity of your project, and your willingness to trade off development time for increased control and customization.
      Hope this help.
      --Joash

  • @gamerstheater1187
    @gamerstheater1187 Před rokem +1

    Who else is here cause of their computer class?

  • @alexvaiman4966
    @alexvaiman4966 Před 3 měsíci

    sorry but as someone who just implemented a tab bar just recently, I can say that impl real production grade tab bar, is not an easy task... and the logic looks different, real tab manager honors swift life-cycle, and maintain states, most "easy to do" tab managers, do one of them .

  • @IhonahanBuitrago
    @IhonahanBuitrago Před rokem

    Then this is useless: in the majority of projects you will find custom designs therefore this example is useless since working with SF symbols are way too different to work with assets design provide.

  • @shyanneearl5891
    @shyanneearl5891 Před rokem +1

    Hi, I saw your video on CZcams and would love to hear from you, hope we have a chance to work together

    • @CodeWithChris
      @CodeWithChris  Před rokem

      Hello Shyanne. You can find us and our students in our Community (codecrew.codewithchris.com/). We do not work directly with people to code and make apps for them at the moment. Our focus is on teaching. We have a bunch of students who, I'm sure, would love to work on a side project as freelancers. If your goal is to have an app made, you can learn to code it by yourself with us here on youtube and on www.codewithchris.com or you can go to some platforms like Fiverr or others to hire some developers.
      @AdrienVillez

    • @shyanneearl5891
      @shyanneearl5891 Před rokem

      @@CodeWithChris Hello, we are not trying to write an app, what we need is to work with you and let you help us promote it