Using Sheets, Transitions, and Offsets to create a popover in SwiftUI | Bootcamp #29

Поділитися
Вставка
  • Опубліковано 18 лис 2024

КОМЕНТАРІ • 82

  • @AZMerf
    @AZMerf 3 роки тому +10

    Videos like this are very useful to understand different methods to do the same thing and which circumstances are best for each method.

  • @williamwildsmith5162
    @williamwildsmith5162 2 роки тому +3

    Excellent Nick. This has really helped me.
    I like your videos - they are digestable snippets.

  • @edwarddeen9823
    @edwarddeen9823 Рік тому +2

    now that maybe you guys could use this:
    @Environment(\.dismiss) var dismiss
    and add these codes in the Button's action:
    dismiss.callAsFunction()
    cause presentionMode is about to deprecate.
    By the way, really loves your tutorials Nick, hope you continue with that!~
    Best regards.

  • @heshamabdo6024
    @heshamabdo6024 2 роки тому +5

    Compared to paid courses, this course is better

  • @markme7092
    @markme7092 3 роки тому +4

    Your all video are good. And contains deep details

  • @gccount
    @gccount 9 місяців тому

    This video is very practical, such as add or remove subview , which is essentially
    different with UIKit

  • @luigivampa9780
    @luigivampa9780 3 роки тому +4

    Hey, I've just found your channel and now I'm binge-watching it :) good work!

  • @haidersalih287
    @haidersalih287 3 роки тому +2

    man you are my favorite , thank you so much and I hope we can help you like you did for us

  • @andrejkling3886
    @andrejkling3886 3 роки тому +2

    Excellent lesson...

  • @DavidKrcek
    @DavidKrcek 4 місяці тому +1

    Hi Nick, with SwiftUI 6.0 ( or earlier ), you don't need an ZStack and zIndex, it's enough to put the new View to an VStack.
    VStack(){
    if showTransition {
    NewScreen2(isDisplayed: $showTransition)
    .padding(.top, 20)
    .transition(.move(edge: .bottom))
    }
    } .animation(.spring(), value: showTransition)
    VStack(){
    NewScreen2(isDisplayed: $showAnimation)
    .padding(.top,20)
    .offset(y: showAnimation ? 0 : UIScreen.main.bounds.height)
    } .animation(.spring(), value: showAnimation)

    • @savokid328
      @savokid328 Місяць тому

      Thank you very much , I add .animation(.spring(), value: showTransition) next to .transition(.move(edge: .bottom), and it doesn't work right... I copied your code it works perfectly! but do you know the reason why my way doesn't work?

    • @DavidKrcek
      @DavidKrcek Місяць тому

      @@savokid328 hi as far as I know it’s a question of order of the layers. Never dived into it deeper.

  • @prasadreddy878
    @prasadreddy878 3 роки тому +2

    You are excellent bro the way you presenting is just awsome ❤❤

  • @dadrewco100
    @dadrewco100 3 роки тому +1

    Very nice ! I am learning so much .

  • @lapusan2008
    @lapusan2008 2 роки тому +1

    Very useful tutorial. Thank you!

  • @Hannappel2000
    @Hannappel2000 7 місяців тому

    Thanks for that interim repetition. Really clever and well down. Thanks, Nick. Would be great if you could add to your "older" videos any big change of depreciation. I know its work, but would help a lot. e.g. animation had changed since iOS 15. Thanks nevertheless for all your good work

    • @SwiftfulThinking
      @SwiftfulThinking  7 місяців тому

      I’ve appended videos to the end of the playlists for everything deprecated 👍 iOS 16 animation here:
      ua-cam.com/video/t95HGRLPwj0/v-deo.html

  • @huseyinsubhanalkan878
    @huseyinsubhanalkan878 Рік тому

    Great video ! Very helpful thank you Nick.

  • @indomitabletr1834
    @indomitabletr1834 2 роки тому

    Nick, I definitely learned swiftui from you. thank you in advance ❣️

  • @rhencydelgado4266
    @rhencydelgado4266 Рік тому +2

    Nick, I've been learning a lot from you!! Excellent content and a way to teach!!
    I have a question; now, in iOS 15.0, .animation was deprecated. Can you explain to us how to use the "value" parameter? Example: .animation(.spring(), value: V), thanks in advance!!!
    😄

    • @SwiftfulThinking
      @SwiftfulThinking  Рік тому +2

      The animation is only applied when the value changes!

  • @최승기-g8f
    @최승기-g8f 3 роки тому +1

    Great video!! Thank you!!

  • @Dragonboh1
    @Dragonboh1 11 місяців тому

    keep doing what you doing

  • @JeckyKA
    @JeckyKA 3 роки тому +1

    amazing, thank you so much!

  • @faikcoskuncakr7418
    @faikcoskuncakr7418 2 роки тому

    An excellent video. Thank you so much

  • @yrac2409
    @yrac2409 3 роки тому +3

    I had trouble doing the last two transition methods using swiftui's default tabview. I was wondering if you need a custom tabview in order to make them work or if I might be missing something here. Thank you so much! your videos are so clear and good

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому +3

      If you're using the default TabView, it's probably best to stick with the default animations. You will have to make your own custom tab view if you want custom transitions unfortunately!

  • @EzularSocial
    @EzularSocial Рік тому

    Thanks, but I prefer the sheet because it has all the necessary functions. I think the Cons of transition are that you have to add the close drag gesture and background dismiss manually.

  • @bobbynwm
    @bobbynwm Рік тому +1

    Thanks again Nick for this insightful video! If I understood this right, I would use Sheets for complex covers ( with lots of content and potential navigation controls starting from that sheet0, Transitions for filters, small popups with few buttons, actionable within same main screen via binding and so so, and Animations for really small items, like tool tips, helper notes, info tips for sections. What do you think ?

  • @sadeqnoori8707
    @sadeqnoori8707 3 роки тому +1

    You are great!

  • @Michalkoks99
    @Michalkoks99 8 місяців тому

    You forgot about another method which you showed us in previous video - fullScreenCover :)

  • @dereklei1746
    @dereklei1746 2 роки тому

    Crazy good. Thanks

  • @dugrut1325
    @dugrut1325 2 роки тому +1

    💧water has cleared, there is hope for me.

  • @techme_blog
    @techme_blog 2 роки тому +1

    Is there a way to change the color of the background of the main screen when sheet is presenting? So you have your orange main screen, then you use sheet to present the purple, so in minute 6:29 it looks: the purple in front, then the orange pushed back a little & it shows a white background, is there a way to change that color? I know I can use fullscreencover but just as a general doubt is there a way to achieve that?

  • @robertsgeorge9487
    @robertsgeorge9487 3 роки тому +1

    I think sheet is good , I was like use offset,I want to change all of them to sheet, thanks Bro

  • @Nunny25
    @Nunny25 3 роки тому +2

    perfect

  • @DefeatOG
    @DefeatOG Рік тому

    Awesome video! This has helped my app design look tons better! I have a question though. I go to round the top corners (I've tried different methods) all of which add a sort of padding to the bottom of the view so it's not flush with the bottom anymore. Any idea on how to fix this?

  • @mamayiwe
    @mamayiwe 2 роки тому

    This is awesome

  • @shelly985985
    @shelly985985 Рік тому

    Is possible to use sheet with different transition? Like sheet opens Right to left

  • @andrejkling3886
    @andrejkling3886 3 роки тому +1

    Thank you....

  • @randlyce
    @randlyce 3 роки тому +2

    wow Cool!

  • @dugrut1325
    @dugrut1325 2 роки тому

    Ok I first watched this 5mths ago, I'm back to see if I've learnt anything...

  • @slugbtye
    @slugbtye 11 місяців тому

    Curious if there is any performance implications for the animation offset version? Does swift lazy render the view, (like only put the view in memory once the display condition is true)?

  • @DavideBelardi
    @DavideBelardi 3 роки тому +1

    What if I want to use the second option with Transition and doing something like that :
    "I want to click the text, it opens a 'fake' sheet view and I want to but inside of it a button that it shows me a new view without compromising with the padding and be full screen the next"
    The sequence are : View 1 (click button) -> View 2 opens fake sheet (with the padding) and I click inside of it continue to next view -> View 3 it shows me a new page full screen ?

  • @patilashish
    @patilashish Рік тому

    Wont the transition and animation keep the second screen in memory even when off the screen ?

  • @brucknerdevilliers
    @brucknerdevilliers 2 роки тому

    Perfect!

  • @sergeykravtsov251
    @sergeykravtsov251 Рік тому

    Hi Nick, great channel, love your videos and learning loads. Quick question (and I spent something like 3hrs looking for a fix) but method 2 throws the ".animation deprecated as of ios15, use value:", but whenever I do there is no animation going on at all. Would appreciate any help as it is giving me a headache, not being able to wrap my head around what the new method is supposed to be.

    • @SwiftfulThinking
      @SwiftfulThinking  Рік тому +1

      Check this out ua-cam.com/video/t95HGRLPwj0/v-deo.html

  • @zhiyi4896
    @zhiyi4896 3 роки тому

    why zstack can fix the transition problems?

  • @alextoma402
    @alextoma402 Рік тому

    Why do I feel like I know this guy from somewhere. You from Michigan??

  • @hashemakkad6439
    @hashemakkad6439 Рік тому

    Should we delete @Environment from the struct view, in Method 2 and Method 3,
    as we don't use it anymore?

  • @CarloSadun
    @CarloSadun 11 місяців тому

    Does UIScreen still exist because I can not seem to make it work? If it is deprecated what should I use instead?

    • @minimaster.10
      @minimaster.10 11 місяців тому

      UIScreen still exist and work. but UIScreen.main will be deprecated, so in the new way i use GeometryReader. and its perfectly work.

  • @Mhak-rt3lu
    @Mhak-rt3lu Рік тому

    hi Nick, Thank you for the awesome video. I have a problem with animation in xcode 14, it didn't work in the preview nor in the simulator. I tried different combinations (implicit and explicit) but it never worked. can you help please.

  • @knowledgeispower4953
    @knowledgeispower4953 9 місяців тому

    SUP BRO...😇

  • @mig12394
    @mig12394 3 роки тому +1

    I use Sheet, but I like animation offset, Transition is more complicated

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому +1

      Yea, sheet is definitely the easiest however it's also the least customizable! I find that I'm using the .transition more and more these days :)

  • @olepetersen4460
    @olepetersen4460 3 роки тому

    Great video! I wonder about one thing, though: Why does the transition work, even when the zIndex line is blanked out? It seems that this line is unnecessary.

    • @SwiftfulThinking
      @SwiftfulThinking  3 роки тому

      Haha yes it does, but sometimes when transitioning off of the screen, it will get rendered underneath the other layers and you won't be able to see the full animation. If it's working for you without the zIndex, then you probably don't need it. It's just a very common issue I wanted to address.

    • @olepetersen4460
      @olepetersen4460 3 роки тому

      @@SwiftfulThinking Ok, thanks. I plan to see all of your bootcamp and probably some of your other ones. You are very thorough and your videos are very well planned and executed. Keep up the good work 😃

  • @ProgramJerol
    @ProgramJerol 8 місяців тому

    main modifier will be deprecated in future ios versions. Better use GeometryReader and adjust its frame both max h/w to infinity

    • @XanderDev-tg9pg
      @XanderDev-tg9pg 6 місяців тому

      How would we implement GeometryReader in this context?

  • @bixnqq
    @bixnqq Рік тому

    The transition just does not work for me. Don't know why. Makes me frustrated >.

    • @Alla-e9f
      @Alla-e9f Рік тому

      Do not be so upset! If you do instead of .animation(...blah). this -it will work:
      Button("Button", action: {
      withAnimation(.easeInOut(duration: 2)) {
      showNewScreen.toggle()
      }
      })

  • @rinotheone6806
    @rinotheone6806 Рік тому

    Поповер)

  • @wheezyair
    @wheezyair Рік тому +1

    I fucking love yooooooooou

  • @venusbhatia
    @venusbhatia 10 місяців тому

    Method 2

  • @dugrut1325
    @dugrut1325 2 роки тому

    well... that was clear as mud! Maybe if I watch the video a dozen more times it will sink in! That didn't work... haha

  • @magedmohmed4403
    @magedmohmed4403 2 роки тому

    really thank you very much 🤎🤎