Backgrounds and Overlays in SwiftUI | Bootcamp #9

  Рет қаралды 47,599

Swiftful Thinking

Swiftful Thinking

Күн бұрын

Пікірлер: 67
@jblee344
@jblee344 3 жыл бұрын
Underrated channel
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thanks JB! I just started ~2 months ago so I'm new to KZbin. Thanks for watching!
@slugbtye
@slugbtye Жыл бұрын
10/10, such a usefull demo, so far I'm really loving this series! Thank you for making it it :)
@olepetersen4460
@olepetersen4460 3 жыл бұрын
You really nailed this overlay stuff for me. Great, that you also showed how to place the modifiers in separate lines. Very thorough and helpful. Thanks again!
@yurialenccar
@yurialenccar Жыл бұрын
You have the gift of teaching. Thanks for these videos!
@leatof5540
@leatof5540 2 жыл бұрын
This youTube channel is so amazing, i found it late in my learning but in the perfect time to reboost me and to push my level to another step. Thank you so much for all of this, it's the first time i want to watch every single video of a channel. It will take time but i will do.
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
Haha thanks! I will look out for your comments as you progress through the playlists 😅
@benoit7222
@benoit7222 Жыл бұрын
@@SwiftfulThinking I had trouble understanding this concept. Thank you for the question and the detailed answer. You do a fabulous job on youtube
@kempsu
@kempsu Жыл бұрын
PSA: in a future (major) iOS version the ".overlay(_:alignment:)" will be deprecated. Same for the background. Use ".overlay(alignment: Alignment, content: () -> View)" instead: .overlay(alignment: .center) { Rectangle() .fill(Color.blue) .frame(width: 50, height: 50) }
@jinweixiang
@jinweixiang 4 ай бұрын
realy thank u
@root_pegasus
@root_pegasus Ай бұрын
Thanks for this, hope you see my comment Where did you see this change for the syntax?
@kempsu
@kempsu Ай бұрын
@@root_pegasus if I remember correctly Xcode was showing a warning and I just refactored the code accordingly.
@siddharthkamaria
@siddharthkamaria 3 жыл бұрын
Love the way you teach a concept in detail! I took your Firebase course on Udemy and it helped me a lot.
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thank you!! I have some even better courses coming soon :)
@thedrenkemp124
@thedrenkemp124 3 жыл бұрын
Wow! You make amazing video. I'll say before Christmas you will have 15,000 sub. all the course I brought on Udemy. And I learn way more here. lol. God bless man!! your are amazing
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Haha only 300 so far! Thanks for watching Thedren.
@easontang8932
@easontang8932 3 жыл бұрын
@@SwiftfulThinking and ur at 2 k right now!!! i say 100k by next year
@mystride
@mystride 2 жыл бұрын
100000000% agree. No iOS course on Udemy even comes close to this. Hope to find Nicks Jetpack Compose cousin one day.
@normalPlayerSeverEarth
@normalPlayerSeverEarth 3 ай бұрын
I didn't know we can design a cool icon like that with just background() and overlay(). Thank you for your great tutorial!
@Stevesvideoshelf
@Stevesvideoshelf 3 жыл бұрын
Thank you for helping me understand overlay!
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
😎 These are super powerful
@georgerevell5643
@georgerevell5643 Жыл бұрын
Loving this, love the intro music too lol
@ClintonSiegel
@ClintonSiegel 2 жыл бұрын
Each video is so helpful!! Thank you!
@AB-TheDevOpsGuy
@AB-TheDevOpsGuy 3 жыл бұрын
You are Awesome!! Subbed :)
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
ABHIJEET!! Thanks for the sub man :)
@Nunny25
@Nunny25 3 жыл бұрын
Excellent
@biffbiffson7350
@biffbiffson7350 9 ай бұрын
Now that was a fun video!
@jean-michelnogaro7471
@jean-michelnogaro7471 2 жыл бұрын
Travail énorme !! Merci 😍
@ericdouglas_
@ericdouglas_ 3 жыл бұрын
Great video! Many thanks for this bootcamp!
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Glad you enjoyed it Eric!
@Dorothyinstead
@Dorothyinstead 3 жыл бұрын
Hi Nick, why are some modifiers called with the . (dot) like .background() and others like LinearGradient() are called using capital letters? What is the rule on how I can remember when to use a dot and when to use capital letters to call a modifier on an element? Another thing I am trying to get my head around is when...say a Circle() is called why the .fill or .fit is applied outside of the parentheses and not immediately in the Circle() parentheses? Kind regards, Robert.
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Hi Rob! As for a "rule", honestly, I think you'll just get used it as you keep writing in SwiftUI. However, the real answer is that Swift is a type-safe language and the compiler can infer Types. So if the compiler knows exactly what type you're going to add, you can just use .(dot), however, if it's not 100% sure, we can declare a type. For example, when we add the foreground(__) modifier, the ONLY thing we can add inside is a Color, which is why we can type .red ... however if we look at the background(__) modifier, there are several different Types we can put in there (gradients, colors, other views, etc.), which is why we would need to use background(Color.red) and not background(.red).
@dugrut1325
@dugrut1325 2 жыл бұрын
Very Cool!
@magedmohmed4403
@magedmohmed4403 2 жыл бұрын
Backgrounds and overlays , Thank you
@andresraigoza2082
@andresraigoza2082 3 жыл бұрын
Amazing.! Thanks again
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thank you too!
@carmineloschiavo5864
@carmineloschiavo5864 2 жыл бұрын
Thank you for helping out . I am learning a lot this way even though there is no completed app at the end. These are important topics that you cover in these tutorials. I do have one question that caused me to stumble a little. I have Xcode 14 beta installed on my MacBook Pro and I cannot find color Literal to add the color image in the tutorial like you do. Am I missing something?
@jordandriebe
@jordandriebe 2 жыл бұрын
yeah i cannot find color literal as well. what is the replacement for this?
@chrisstromberg6527
@chrisstromberg6527 Жыл бұрын
@@jordandriebe It is no longer available.
@최승기-g8f
@최승기-g8f 3 жыл бұрын
Thank you!!! I have a question, how can I zoom up editor area?
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Hi, I use CMD and + to zoom in and out of the code (Editor -> Font Size -> Increase)!
@faikcoskuncakr7418
@faikcoskuncakr7418 2 жыл бұрын
Nice video and nice explanation. Thanks so much
@afdreadbrizgaming1436
@afdreadbrizgaming1436 3 жыл бұрын
For some odd reason a couple of options don’t show up for instance the color option to choose gradients doesn’t pop up in the drop down menu and the .background(View) has a compilation error that’s saying “Type ‘View.Protocol’ cannot conform to ‘View’ “
@SairamK-f1r
@SairamK-f1r 8 ай бұрын
Hi Nick, i am trying to learn swiftUI and i have a basic question. @2:02, why are you using background(Color.red) and not background(.red) ?? I guess my biggest pet peeve with SwiftUI is about not understanding when to use '.' dot notation versus when to prefix it. For example, .font(.title) works but background(.red) throws an error. Can you please explain the difference and when to use what format ?
@SwiftfulThinking
@SwiftfulThinking 8 ай бұрын
This is specific to each modifier. This is because .font can only ever have a Font type, so it is implied that we use .title to mean Font.title. However, a .background can have different types (you could use a color or a ZStack or many other things), so we need to specifically tell the compiler we mean to use Color type .red
@nlntamilnln
@nlntamilnln 2 жыл бұрын
scary coding things... you make it really easier
@mochamadnurkhayalkadafi7570
@mochamadnurkhayalkadafi7570 3 жыл бұрын
Nice tutorial, but i am wonder how to pass image overlays to another view with binding or state? because when I overlay image, the result does not with overlays.
@thyself125
@thyself125 2 жыл бұрын
Thank you for making these videos. I really enjoy them. Would you mind going a little deeper into Geometry Reader? I know you have a video on it but I’m am look for more advanced use of geometry reader. Thank you!
@Денис-ж3ф5р
@Денис-ж3ф5р 3 жыл бұрын
what if I want to have a fully transparent hole in the middle of my view, taking into account I have numerous layers?
@luv.matters
@luv.matters 2 жыл бұрын
How are you getting the same gradient colors filled in without typing it? Like when you type in Linear Gradient, it auto-filled what you first type out and not the default.
@ZhengCheng
@ZhengCheng 3 жыл бұрын
Thank you very much!
@vazzhh
@vazzhh Жыл бұрын
hello hello. when you use Color Literal in this xCode version. what is the name in Xcode version 15. I cant find
@ayad1856
@ayad1856 10 ай бұрын
Hi! you have to add this line of code --> let myColor = Color(#colorLiteral(red: 0.292, green: 0.081, blue: 0.6, alpha: 255)) or var myColor = Color(#colorLiteral(red: 0.292, green: 0.081, blue: 0.6, alpha: 255)) (it's the same thing! Not sure why they removed it or why it works with that line as i am a beginner. Then you have to call your variable in your fill modifier or color modifier shape or icon or anything, just write (Color(myColor)). Hope this was helpful
@scoutmastert.7181
@scoutmastert.7181 Жыл бұрын
since color literal isn't a thing anymore, what replaced it?
@btss2190
@btss2190 Жыл бұрын
I have the same issue. Looks like color Literal has been problematic in Xcode for quite a while. It works in some versions but not in Xcode 14.2. If you bring up the Inspector (top right hand corner of Xcode window) and click on the parent Circle() you can play with the Shadow custom color - but its not very friendly
@randlyce
@randlyce 3 жыл бұрын
Hai i;m trying to do this but for some reason the rectangles stays in place is there a bug here please help
@muhammadnasser2735
@muhammadnasser2735 3 жыл бұрын
same
@leatof5540
@leatof5540 2 жыл бұрын
I had the same problem but i found my mistake. The alignment need to be apply to the overlay an not to the frame so we need to write: .overlay(Rectangle() .fill(Color.blue) .frame(width: 50, height: 50), alignment: .topLeading ) and not: .overlay(Rectangle() .fill(Color.blue) .frame(width: 50, height: 50, alignment: .topLeading) )
@eng.taghridabdulaziz5688
@eng.taghridabdulaziz5688 Жыл бұрын
can't find color Litreal I use Xcod 14 would u help pleas?
@burachaisonthayanon4113
@burachaisonthayanon4113 Жыл бұрын
Someone gave a comment few clips back as to how to use it in 14. Go to menu bar and choose to Edit, then Show Color. Then choose a color you want, and drag the the color to inside the parenthesis of Color( ).
@azharuddinkhan117
@azharuddinkhan117 2 жыл бұрын
Thanks
@ajaydammalapati
@ajaydammalapati Жыл бұрын
How to use #colorLiteral in code 14
@MsharyQ17
@MsharyQ17 Жыл бұрын
Thanks for men
@JPkatukenda
@JPkatukenda 2 жыл бұрын
 THANKS
@knowledgeispower4953
@knowledgeispower4953 10 ай бұрын
sup bro..❣
@fruity_cereal_IDV
@fruity_cereal_IDV 2 жыл бұрын
4:37
@sergiobuitrago9880
@sergiobuitrago9880 4 ай бұрын
color literal is deprecared
VStack, HStack, and ZStack in SwiftUI | Bootcamp #10
21:37
Swiftful Thinking
Рет қаралды 43 М.
How to use inits and enums in SwiftUI | Bootcamp #13
19:30
Swiftful Thinking
Рет қаралды 42 М.
Thank you Santa
00:13
Nadir Show
Рет қаралды 49 МЛН
From Small To Giant 0%🍫 VS 100%🍫 #katebrush #shorts #gummy
00:19
System Icons, Multi-Color Icons, and SF Symbols in SwiftUI | Bootcamp #6
11:54
How to use gestures in SwiftUI - Flashzilla SwiftUI Tutorial 1/13
16:13
How to use ForEach loops in SwiftUI | Bootcamp #14
13:30
Swiftful Thinking
Рет қаралды 40 М.
SwiftUI Bar Chart with Customizations | Swift Charts
21:26
Sean Allen
Рет қаралды 27 М.
How to use @ViewBuilder in SwiftUI | Advanced Learning #9
24:01
Swiftful Thinking
Рет қаралды 27 М.
How to use Spacer in SwiftUI | Bootcamp #12
14:19
Swiftful Thinking
Рет қаралды 28 М.
SwiftUI Core Concepts: Overlay vs ZStack
8:16
CodeSlicing
Рет қаралды 3,2 М.
How to use NavigationStack in SwiftUI | Bootcamp #62
23:59
Swiftful Thinking
Рет қаралды 37 М.