FYI: @Enviroment(\.presentationMode) will be deprecated, use this instead: @Enviroment(\.dismiss) var dismissScreen and you will call it in the action of your button as a function, like this: dismissScreen().
@jakemoore3008 Жыл бұрын
Thank you! I love that I can ALWAYS come into the comments when I get a "deprecated" warning, and someone awesome like you has explained the new methods!
@DannyBoy4436 ай бұрын
Also, he never (previously) explained the environment wrapper.
@maguirer3 жыл бұрын
28 videos in, and you finally called a backslash a backslash! 🥳 Really enjoying the videos so far, Nick!
@SwiftfulThinking3 жыл бұрын
Haha sorry Bob! I didn't even realize until someone had commented that I was saying it wrong 😔 I'm still getting used to coding while talking out loud. Thanks for watching though!
@bhagyashingale56633 жыл бұрын
Update - You can now call multiple sheet modifiers or use conditionals within one
@ahmedmohamedyousef80782 жыл бұрын
PresentationMode is Deprecated, we can use @Environment(\.dismiss) var dismiss or @Environment(\.isPresented) var isPresented
@ShowMeLova10 ай бұрын
Thank you Nick! It is extremely fascinating to learn Swift UI with you❤
@iAmDavidA2 жыл бұрын
It looks like the presentation mode has been deprecated since iOS 15. To go about dismissing do: @Environment(\.dismiss) var dismiss And then call dismiss: dismiss()
@muhammedturk_222 жыл бұрын
Thank you for this information.
@sai29892 ай бұрын
thanks
@lisbettegomez Жыл бұрын
This is sooo excited!!! hahah I just jumped from my bed when you crate the second screen and it worked hahaha
@SwiftfulThinking Жыл бұрын
Haha nice! 🚀🦊
@dugrut13252 жыл бұрын
this was amazing, i have so many ideas, no longer limited to one screen apps
@ConfidentlyRong-jo5yt5 ай бұрын
Loving it! Thanks man!
@SwiftfulThinking5 ай бұрын
You are cruising through the playlist! 🚀
@ConfidentlyRong-jo5yt5 ай бұрын
@@SwiftfulThinking Still can't believe it's FREE!
@bbulliard2 жыл бұрын
So well done! You are the best! Will provide you some coffee! Bob
@SwiftfulThinking2 жыл бұрын
Thank you Bob!
@parthpatel9096 Жыл бұрын
i just loved the way u make things easy to under stand amazing!😊
@dugrut13252 жыл бұрын
Great video... again! The 'bulb' is starting to glow, not as dim!
@julianm08080810 ай бұрын
Hey nick thanks for your video I had figured it out my issue hopefully
@abdullahalnutayfi81033 жыл бұрын
Hello, I added switch statement inside sheet, and it works perfectly
@SwiftfulThinking3 жыл бұрын
I would be careful haha
@yassirbisteni92735 ай бұрын
Hi, which is the video for the advanced fullscreen conditionals?, thanks!
@hakobghlijyan Жыл бұрын
hello , I want to implement a transition to the second screen, which is located in another file. how to do it? .sheet
@WattsnabbAB3 ай бұрын
What is the best practice use when I want to present fullscreencover on 50% of the first screen?
@bobbynwm Жыл бұрын
Nick, do you know how would we call or create that sort of popup window that comes for few secs and disappears afterwards ? For eg. when you Love a song in Apple Music, you will see that popup with ultraThinMaterial background that comes up for few secs and goes away afterwards.
@SwiftfulThinking Жыл бұрын
You could just do a simple ZStack and toggle a local Boolean value. Set it to true and add a delay for setting it back to false!
@magedmohmed44032 жыл бұрын
Thank you for your helpful tutorial 🤎🤎
@njasow52347 ай бұрын
I noticed at 9:00 when the sheet pops up, the view underneath it also slides down revealing a white sliver above both views. Do you know how to get rid of this? or at least change the color of it?
@leneil46 Жыл бұрын
Excellent video
@ZhengCheng3 жыл бұрын
@Environment should have a separate video @Enviroment(\.presentationMode) var presentationMode is confusing
@SwiftfulThinking3 жыл бұрын
Hi Zheng, great idea. I will try to discuss the @Environment soon!
@ChromeBreakerD Жыл бұрын
@SwiftfulThinking Is this still accurate at 10:35? I conducted tests on conditional logic in Sheets, and it appears to be functioning correctly. I also examined your statement that "the sheet generates the content when the view loads," but it didn't happen instantly for me. Instead, it initialized only when I opened the sheet. It seems like Sheets might exhibit lazy behavior in this regard. I would appreciate your feedback, as this has left me somewhat perplexed.
@SwiftfulThinking Жыл бұрын
It may have been updated to be Lazy in recent versions of SwiftUI. I will have to check, but I wouldn’t be surprised. We have seen similar updates for other modifiers too. Generally, lazy is better 👍
@quarrlk6 ай бұрын
to dismiss the sheet in SwiftUI 15, is it ok to just toggle the isPresented variable in the sheet content?
@hashemakkad6439 Жыл бұрын
Hi, thanks for this great videos, I'm watching one by one since Bootcamp # 1 For this one I've made exactly like what you did here and it's working fine, but out of curiosity I've tried another way and it worked just fine as well, it's by using Binding property wrapper as you explained in the video # 22, and it's doing the same thing without the need to use @Environment. But I'm not sure if this could be done in real Apps. Or would it make a conflict with something else.
@SwiftfulThinking Жыл бұрын
Either works… Binding requires you to pass the Binding directly… whereas the Environment can be pulled from any child view (it can be easier to access in a deeper View hierarchy)
@gccount10 ай бұрын
Update: from the developer documentation, right now you need only to toggle the isPresented, then sheet dismissed, magically .
@supriyodey32582 жыл бұрын
How to change transition in fullScreenCover. I want the transition from leading
@DannyBoy4436 ай бұрын
Does Nick ever explain ignoreSafeArea?
@SwiftfulThinking6 ай бұрын
Here kzbin.info/www/bejne/lWGxdX6uq8uaapIsi=T_aaSQlhHeNKpr2N and here kzbin.info/www/bejne/pn-Yi4CMlJihpqcsi=MHKNvbnaz7l-y_-y
@DannyBoy4436 ай бұрын
@@SwiftfulThinking Thank you!
@julianm08080810 ай бұрын
Nick how's it going, please someone can share with the code of the class because I am having an error that says Invalid redeclaration of 'SecondScreen' time 05:41
@sai29892 ай бұрын
// // Display pop-up Sheets and FullScreenCovers.swift // SwiftUI Part 2 // // Created by mac on 9/18/24. // import SwiftUI struct Display_pop_up_Sheets_and_FullScreenCovers: View { @State var showSheet: Bool = false var body: some View { ZStack{ Color.orange.opacity(0.4) .edgesIgnoringSafeArea(.all) Button(action: { showSheet.toggle() }, label: { Text("Button") .foregroundColor(.black) .font(.headline) .padding(20) .background(Color.white.cornerRadius(20)) }) .sheet(isPresented: $showSheet, content: { SecondScreen() }) } } struct SecondScreen: View{ @Environment(\.dismiss) var dismiss var body: some View{ ZStack(alignment: .topLeading){ Color.red.opacity(0.4) .edgesIgnoringSafeArea(.all) Button(action: { dismiss() }, label: { Image(systemName: "xmark") .foregroundColor(.red) .font(.largeTitle) .padding(20) .background(Color.red.opacity(0.2).cornerRadius(20)) }) } } } struct Display_pop_up_Sheets_and_FullScreenCovers_Previews: PreviewProvider { static var previews: some View { Display_pop_up_Sheets_and_FullScreenCovers() SecondScreen() } } }
@zackyilahiazmi42692 жыл бұрын
Hello, when you apply sheet, i can notice the background instead of green there is white color on border, can you specify this white color and turn into another color?
@MarcelQT Жыл бұрын
What’s the difference here between using a full screen cover vs a navigation stack and link to a new page?
@hanzhechang29063 жыл бұрын
Hi, how if i use binding in secondScreen? pass the showSheet boolean into secondScreen and set back to false?
@software-turtle Жыл бұрын
Is using @Binding instead @Environment to close sheet wrong?
@seanwei90672 жыл бұрын
You are the best, could you tell me how to add transition on .fullScreenCover?
@riceegg79503 жыл бұрын
NIce job, It is very helpful, thanks man
@SwiftfulThinking3 жыл бұрын
Thank you for watching man!
@lolrie Жыл бұрын
Hey Nick - how did you select the entire block of code at 4:40? Is there a hotkey for it? Thanks!
@ChibiBlasphem Жыл бұрын
Cursor was already at the bottom of the block he used Shift + click tu select :)
@praveenkumar-yj5mm Жыл бұрын
showSheet is @State propery wrapper, but you are using it as bindable while presenting the sheet with $showSheet. How is this possible without defining it as @Binding.?
@SwiftfulThinking Жыл бұрын
This is the magic of SwiftUI 👍
@bbulliard3 жыл бұрын
Great video
@soufianebenkhaldoun8493 жыл бұрын
thank you for everything Nick, you solved a lot of questions that I had (forza Italia)
@SwiftfulThinking3 жыл бұрын
Haha forza!!! 😂 Glad you're enjoying the vids!
@bbulliard3 жыл бұрын
I see you have saved all boot camps in 1 swift file. Is there a way i can download all 50 bootcamps in that file?
@SwiftfulThinking3 жыл бұрын
Hey Bob! Yes, the source code is available on my Github: github.com/SwiftfulThinking
@senamahadzi57163 жыл бұрын
Would use of Enums be a good option to show different sheets?
@knowledgeispower495310 ай бұрын
Nice bro...🤗
@yumindev3 жыл бұрын
When you dismiss the sheet, what about the value of "showSheet" in the parent view ? Does it become false or stay being true ?
@BlackLightning0Games2 жыл бұрын
Using Text("\(showSheet.description)") I can confirm that when the sheet is dismissed the value returns to "false"
@onezen2 жыл бұрын
Thanks a lot!
@yuchen35872 жыл бұрын
It seems that I can build an entire app based on this series lol
@SwiftfulThinking2 жыл бұрын
You wouldn’t be the first 😂🥳🔥
@perrinmatias3 жыл бұрын
Nice!
@SwiftfulThinking3 жыл бұрын
:)
@Денис-ж3ф5р3 жыл бұрын
brilliant
@최승기-g8f3 жыл бұрын
Thank you!!!
@SwiftfulThinking3 жыл бұрын
You're welcome 최승기 !
@kingcopones52053 жыл бұрын
Hi! does sheet and full-screen cover supports dark theme?