SwiftUI Segmented Control Tutorial | iOS 14 | Xcode 12.4

preview_player
Показать описание
In today's video I show you how to use the a Segmented Control in SwiftUI. In SwiftUI, a Segmented Control is a variation of a PickerView where you apply the SegmentedPickerStyle. I also show you how to customize the colors of the segmented control. This tutorial was created in Xcode 12.4.

If you like my teaching or presentation style, I've started creating my own courses:

Twitter:

Link to my book - How I Became an iOS Developer:

Check out my podcast, iOS Dev Discussions:

Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):

Ray Wenderlich Books:

Ray Wenderlich Videos:

Paul Hudson's Hacking With Swift:

Learn Advanced Swift Here:

Links to my iOS Dev Setup & iOS Dev Book Recommendations

#swift #softwaredeveloper #iosdeveloper
Рекомендации по теме
Комментарии
Автор

If you enjoy my teaching/presentation style, I've started creating my own courses at seanallen.teachable.com. You can watch the first ~10% of each course for free to get a feel for them.

seanallen
Автор

You can do the .appearance() changes in the onAppear closure for a View in your body. Then in the onDisappear closure, you can revert back to defaults. This essentially gets around the appearance being changed globally.

For cleaner code, you can move these appearance changes into private funcs and call those in onAppear/Disappear

jstar
Автор

your videos are always so helpful, thank you!! youre great at explaining everything

amaliemorch
Автор

lol Im here 3 years later and mannn Apple still hasn't added modifiers for the segment control, anyways thank you Sean. Very helpful!

sherlly
Автор

I started last summer learning Swift and app development ( wonderful Journey) . I really love your channel . Now I am spending 90% of my time programming and learning ( thanks to COVID, yes it maybe the only Good thing that it gave me time ) Thank you Sean for this wonderful channel . Keep on the good work 👍

Jeckyl
Автор

great video, i love the style of having the code already typed out so more time is spent on explaining the code. thanks!

karaokedeconstruction
Автор

Thank you so much, Sean! Always very helpful tutorials!

martinhassani
Автор

Hello, with a Picker you can only select ONE item. Is there a View that allows the selection of MULTIPLE items?

LebenWerden
Автор

Great video. What if we want to add a custom color instead of .yellow? Color("customColor") isn't working

christianmoreno
Автор

May I get the link to the starter project please

mugaberichard
Автор

Thank you so much Sean, excellent content. It is really easy to understand.

davidjimenezquiroga
Автор

Cool! Could you add a property on the Hero view to allow for the shadow color to change with light/dark mode? I'm guessing that light/dark mode switch triggers a re-draw?

toastrecon
Автор

Thank you Sean... I don't know which side...?-)) both sides is same... good lesson

Mahadev-xu
Автор

Love the video. Super helpful for something I have been trying to figure out for a while. Curious if there is a way to just style one specific picker instead of changing the style of all UISegmentedCotrol like you said at 7:05. Once again loved the video and the channel!

zaniad
Автор

Hi Sean : why when I create struct ChosenHeroView, swift 5 warning with message : function declares an opaque return type but has no return statement in its body ?..??

anhhanry
Автор

Спасибо мне была приятна такая подача материала
Удачи тебе

Смотритель-ую
Автор

very cool. Just what I needed to get the ForEach working. Now, in my case, I want the Segmented Control to control the filtering of a list. Any suggestions?

DavidNitzscheBell
Автор

Hi Sean, this video was really helpful! I was wondering if you could do a video on how to create buttons in SwiftUI that are shaped like a country for example.

anvithkakkera
Автор

he said "start from the bottom like drake" 😂😂😂😂😂

cookiesupmusic