Presenting Errors Globally in SwiftUI Applications

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ม.ค. 2025

ความคิดเห็น • 10

  • @RobertHolzapfel
    @RobertHolzapfel ปีที่แล้ว

    Thanks Mr. Azam. When being a 'sharp' minded person, good stuff is coming out. 🤩

  • @ayushs_2k4
    @ayushs_2k4 ปีที่แล้ว +1

    How can we throw errors from view model?

  • @jy9dc
    @jy9dc 11 หลายเดือนก่อน

    I am using try do catch to handle division by zero error in a button but it showing some errors in the code that...
    Invalid conversion from throwing function of type '() throws -> Void' to non- throwing function type '() -> Void'
    How to solve?

  • @rwilson1125
    @rwilson1125 ปีที่แล้ว

    i saw the ErrorWrapper in the scrumdinger app, but spaced how it was really implemented. Thanks for showing this. I tried plopping this in another project which uses a lot of asynchronous calls, and I get a "Attempt to present on screen(?) already presenting". It worked once, but now i get this error all the time, even when using the example authenticate button. in stack overflow, there is use of using asyncAfter. any thoughts?

    • @azamsharp
      @azamsharp  ปีที่แล้ว

      Are you sure you are attaching the sheet at the current location?

    • @rwilson1125
      @rwilson1125 ปีที่แล้ว

      @@azamsharp i attached it to the ContentView of App, part of the windowGroup

    • @rwilson1125
      @rwilson1125 ปีที่แล้ว

      @azamsharp Ok, so after a while of not trying, it works, sort of. Possibly because of the async nature of the app, on an error, there is a brief attempt at the sheet, then it slides down, then a sheet with the real error appears.

  • @khaledhussien7443
    @khaledhussien7443 ปีที่แล้ว

    good work :)
    i have one question about restarting the Simulator i have this problem after updating the Xcode to 14.0
    every time i run the application i must restart it to run idk what should i do ?

  • @developerios6096
    @developerios6096 ปีที่แล้ว

    Hey azam, i came up with same approach to centralize error management, however, i am not sure it will work if we present new views with fullscreencover modifier, am i wrong? Should this logic be injected in every, lets find a word, ‘hierarchy flow’ ?

  • @victorriurean
    @victorriurean ปีที่แล้ว

    nice