How to Create a Custom Tab Bar in SwiftUI - Step by Step for Beginners (2023)

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ย. 2024

ความคิดเห็น • 31

  • @silicon_mind
    @silicon_mind ปีที่แล้ว +7

    Great tutorial, thank you!
    If anybody stumbles on the same issue, in my case to make the capsule animation between tabs work, I had to wrap the button action in a withAnimation block:
    Button {
    withAnimation {
    tabSelection = index + 1
    }
    }

  • @SentimentalMo
    @SentimentalMo ปีที่แล้ว +1

    Subscribed. Will watch this in a few hours in the morning.

  • @gregh528
    @gregh528 ปีที่แล้ว +1

    Great tutorial thanks. Love you teaching style.

  • @yugeras
    @yugeras ปีที่แล้ว +1

    Thanks a lot! Nice video and I liked the way you explain without any haste. Most videos from others are as if they are always in a hurry :)

  • @AromaVerma-c1t
    @AromaVerma-c1t ปีที่แล้ว +1

    Thanks a lot! Nice video and I liked the way you explain.

    • @a_swiftly_tilting_planet
      @a_swiftly_tilting_planet  ปีที่แล้ว

      Thank you so much. Hopefully I can be informative and do some live streams during the week of WWDC23.

  • @AkimboFennec
    @AkimboFennec ปีที่แล้ว +1

    Custom tabs for sure.

    • @a_swiftly_tilting_planet
      @a_swiftly_tilting_planet  ปีที่แล้ว

      If you like custom tab views this takes a slightly different approach.
      th-cam.com/video/gJyjpyBWAEo/w-d-xo.html

  • @chel.mckayla
    @chel.mckayla ปีที่แล้ว +2

    Great video!! Extremely helpful!!
    Although I was trying to add a different photo to each page, and I'm not quite sure how to do it. I have tried doing it using TabView but it gets rid of all the icons. Any suggestions on how I can fix that?

    • @a_swiftly_tilting_planet
      @a_swiftly_tilting_planet  ปีที่แล้ว +2

      Just make a new SwiftUI View and add it to the ContentView inside the TabView like this:
      TabContentViewOne() // Add a better View name here.
      .tag(1)

  • @comgahanhphuc
    @comgahanhphuc 3 หลายเดือนก่อน +1

    thanks for video 😍

  • @NineVoltDigitalCinema
    @NineVoltDigitalCinema ปีที่แล้ว +1

    Audio is sounding better! Did you change up your mic placement, or doing some editing in post?

  • @CS-gs2eo
    @CS-gs2eo 4 หลายเดือนก่อน

    Nice tutorial! Thank you! I have a small question: what does .tag() mean and work in your code?

    • @a_swiftly_tilting_planet
      @a_swiftly_tilting_planet  3 หลายเดือนก่อน

      It’s a unique identifier for the tab view.

    • @BillBoneta-o5k
      @BillBoneta-o5k 2 หลายเดือนก่อน

      ​@@a_swiftly_tilting_planetgood

  • @gopalakrishnans6192
    @gopalakrishnans6192 9 หลายเดือนก่อน

    Great video! , if we using custom tabview how we can persist the navigation state because if i switched the bottom tabs the navigation state gets reset

    • @a_swiftly_tilting_planet
      @a_swiftly_tilting_planet  8 หลายเดือนก่อน

      Good question, I'd have to look at the code again and think about it.

  • @emilrifahi
    @emilrifahi ปีที่แล้ว

    This is really great, using it for a project. However as overlay, I cant hide the customtabbar when I navigate into a nested View.
    Example: HomeView() contains a NavigationView and several different navigation Links
    In my MainView() I have a Tabview than includes HomeView and other views. When I select the Home tab in the tabbar, and then press a navigationLink, I enter a nested View with the overlay (Customtabbar) still still visible.

    • @emilrifahi
      @emilrifahi ปีที่แล้ว

      Would really appreciate feedback/ solutions on how I can hide the overlay of the tabview as well. Thanks!

    • @a_swiftly_tilting_planet
      @a_swiftly_tilting_planet  ปีที่แล้ว

      Sorry for the delay, but hopefully this live stream answers your question.
      Live Coding: Hide Custom TabView in SwiftUI
      th-cam.com/users/livebGSp2kRsawQ?feature=share

  • @TrânBảo-x2k4q
    @TrânBảo-x2k4q ปีที่แล้ว +1

    Can I add 6 items on the tab bar??

    • @a_swiftly_tilting_planet
      @a_swiftly_tilting_planet  ปีที่แล้ว +1

      Building out a custom tab bar would allow you to put as many that can fit on screen, or if you really wanted to you could make a scrolling tab bar.

  • @vittyfiorentini238
    @vittyfiorentini238 ปีที่แล้ว

    Hi, updating xcode to 14.3 i receive the log "[PipelineLibrary] Mapping the pipeline data cache failed, errno22" when adding the MapView in the viewcontroller. I Receive this error only when i test on a real device not in the simulator. Can i fix it ? Is a common problem? Thanks for the time I appreciate so much.

    • @a_swiftly_tilting_planet
      @a_swiftly_tilting_planet  ปีที่แล้ว

      I haven’t run into this problem, so I’m not sure how I would fix it. Probably check out the Apple Developer forms or stack overflow. See if it’s something others have run into.