Understanding Result Type in Swift 5

preview_player
Показать описание
In this video, Mohammad Azam will demonstrate how to use the Result type in Swift 5 programming language.

If you want to support my work then please consider buying one of my courses below. The links below already has coupon attached which will give you the best deal possible. Thank you for your support!

SwiftUI - Declarative Interfaces for any Apple Device

Mastering RxSwift in iOS

MVVM Design Pattern Using Swift in iOS

Mastering ARKit for iOS

Intermediate and Advanced iOS - Build Real World Apps

The Complete Guide to JSON Parsing in Swift

Data Structures and Algorithms in Swift

Design Patterns in iOS Using Swift

Mastering MapKit for iOS

Machine Learning in iOS Using Swift

Mastering Firebase for iOS Using Swift

Mastering Server Side Swift Using Vapor 3

NodeJS - The Complete Developer Bootcamp

The Complete Guide to Lean Controllers in iOS
Рекомендации по теме
Комментарии
Автор

Incredible explanation as always. Thanks!

mistertea
Автор

Hey Azam awesome tutorial, please keep posting more videos related to swift 5. Thank you...!!!!

pradeepkumar-tmet
Автор

HI cheers for example what do you do if you want to use call this function lots of times with other decodeable structs not just the Post to make it more generic thank you in advance

kjababe
Автор

Hello sir, this example is good .. but can you please give example implementing result type in singleton class, so that any class can reuse it.

ciaraverma
Автор

What if I'm trying to make a Generic request? instead of passing the model in the completion I want to pass it whenever I call the func, for example :
Fetch.shared.fetchJson(url: jsonUrl) request: MyData? in { }


This is how my request would be constructed:
func fetch<T: Codable>(url:URL, completion: @escaping (Result<T?, NetworkError>) -> Void)


When I call it I can't pass the model like I used to. Hope you get the idea of what I'm saying, nevertheless Thank you for this very simple explanation! very useful!

CuriosMindDIY
Автор

Good to know about result, but i am not happy as you have not told us how to use domainError / DecodingError what a point sending it but not using it

aqkhana