iOS 15 Alerts in SwiftUI

Поделиться
HTML-код
  • Опубликовано: 2 фев 2025

Комментарии • 35

  • @isurujn
    @isurujn Год назад +1

    Thanks for this. This is the only video so far I came across on SwiftUi alerts that go beyond the surface level things that everyone talks about.

  • @sherkorahman2166
    @sherkorahman2166 2 года назад

    Thanks for this great tutorial , I have two question regarding to alert iOS 15 : 1- How to update Message title ? 2- How to dismiss an alert ?

    • @StewartLynch
      @StewartLynch  2 года назад +1

      I don't understand your question. The alert title is set when you present the alert. Why would you change it? The dismiss is done when one of action buttons is tapped. If there is no action button specified, a cancel button is always there by default.

    • @sherkorahman2166
      @sherkorahman2166 2 года назад

      @@StewartLynch Many thanks for your reply. I have an application that assigns a series of tasks to the user through an alert. For example, if the user is not aware of one of the alert, or does not react, the user should be shown the specific alert at the specified time, rather than remaining on the old alert. The best way for doing that is to update alert message or dismissing the old one and creating a new alert which I don't prefer this way.

    • @StewartLynch
      @StewartLynch  2 года назад +1

      @@sherkorahman2166 I am not sure you can accomplish what you were trying to do with alerts. They don’t work that way.

  • @erichsnijder7376
    @erichsnijder7376 3 года назад +1

    Real nice video.
    Give's me everything i wanted to know.
    You're an excellent help.

  • @_sabot
    @_sabot 3 года назад

    2:27 Which app you mention for the icons? Couldn't understand it.

    • @StewartLynch
      @StewartLynch  3 года назад

      It is called Bakery. I have added a link to the description too. apps.apple.com/ca/app/bakery-simple-icon-creator/id1575220747?mt=12

  • @ericha2494
    @ericha2494 3 года назад

    Great tutorial. What can I do if I want to get the response back without using .alert?

    • @StewartLynch
      @StewartLynch  3 года назад

      You need to create your own view that you can conditionally present using a ZStack.

    • @ER-bi9ir
      @ER-bi9ir 3 года назад

      @@StewartLynch Thanks for the quick reply! My question was not how to display the data. It was how to get the data. With alert i see that “presenting:” or not mentioned in this video but “item:” holds the response object. But without using .alert(…), how can i get it? That was the question. Thank you!

    • @StewartLynch
      @StewartLynch  3 года назад

      @@ER-bi9ir then I don’t understand the question Eric. This tutorial is about alerts so what are you presenting? Feel free to DM me on Twitter @StewartLynch to continue the conversation

  • @Денис-ж3ф5р
    @Денис-ж3ф5р 3 года назад

    Strange is that, you usually make videos for "advanced" tasks, but this one is relatively easy.

    • @StewartLynch
      @StewartLynch  3 года назад +4

      I want to cover all things. What is easy for you, may not be easy for someone else. This new version of alert is different from the iOS 14 version so I think it is worth pointing out. You will see in videos coming later how I use this new alert type in a different way to display errors to your users.

    • @Денис-ж3ф5р
      @Денис-ж3ф5р 3 года назад

      @@StewartLynch It is worth, I never argued.

  • @nurlanakylbekov7266
    @nurlanakylbekov7266 3 года назад

    What if I’m developing app with Xcode 12.5 for iOS 14 and above. My alerts will not work on iOS 15?

    • @StewartLynch
      @StewartLynch  3 года назад +1

      I your target is still iOS 14, the older API will still work with devices running iOS 15.

    • @nurlanakylbekov7266
      @nurlanakylbekov7266 3 года назад

      @@StewartLynch thank you

  • @Mahadev-x7u
    @Mahadev-x7u 3 года назад +1

    Thank you Stewart...

  • @akbar41
    @akbar41 Год назад

    Thank you.

  • @randlyce
    @randlyce 3 года назад

    this is amazing thank you

  • @mansapratapsingh417
    @mansapratapsingh417 3 года назад

    Hey Stewart! I am very very thankful to you. I learned a lot from you and still learning.
    I got my first iOS Developer job. So thanks to you too. Please buy some Sweets and Sweeten your mouth. ☺

    • @StewartLynch
      @StewartLynch  3 года назад +1

      That is fantastic news. Congratulations.

    • @mansapratapsingh417
      @mansapratapsingh417 3 года назад

      @@StewartLynch I'll buy coffee for you with me first salary. ☺

  • @bry2k
    @bry2k 3 года назад +3

    Great tutorial. One note - it's "deprecated", not "depreciated" 😉

    • @StewartLynch
      @StewartLynch  3 года назад +2

      yah, I was hoping no one would catch that.

    • @criley7755
      @criley7755 2 года назад

      @@StewartLynch Literally the first thing I noticed. Don't worry. Everyone at the company I work at kept saying the same thing to start with.

    • @StewartLynch
      @StewartLynch  2 года назад

      I have come a long way since I created that video. I won’t make that mistake again LOL

  • @ThePhotodiver
    @ThePhotodiver 3 года назад

    The links to the starter project take you to the wrong project. It takes you to the SwiftUI Layout project.

    • @StewartLynch
      @StewartLynch  3 года назад

      Oops. Sorry about that. Fixed now

  • @mhfs61
    @mhfs61 Год назад

    Funny you’re using the word deprecIated, were Apple uses deprecated.

    • @StewartLynch
      @StewartLynch  Год назад

      Yes, I made that mistake. Deprecated is the correct term.

  • @larschristiansen3136
    @larschristiansen3136 3 года назад

    Great insight in the new alerts.
    Especially the last one with the parameter presentData opens a whole set of new possibilities.
    I have not been able to reproduce the same behavior in the first alerts as you do in the video.
    I systematically get an OK button by default, and not a Cancel.
    It has probably something to do with different versions: I use Xcode 13 (not beta5) on Monterey beta 8 (was released on Sept 28, after you have published the video) . On an Intel MacMini2018.