From the course: Swift 5: Protocol-Oriented Programming
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Integrating a fallback service
From the course: Swift 5: Protocol-Oriented Programming
Challenge: Integrating a fallback service
(gently chiming bells) - Web services are not guaranteed to function all of the time, they may fail for various reasons; such as timeout issues, or authentication problems. We can try to avoid this problem by using multiple services. If one service fails, we switch to another one. Your task is to enhance the weather app with such a Fallback Strategy. Editors, please remove the transition from the slides to this X code view. I added a new web service controller that allows us to fetch weather information using the weather stack API. The corresponding code, the birth structures can be found in the Jason Mappers Group. Not that I had to add the weather's tech domain to the app transport security exception domains. The free plan doesn't include SSL. There is HTTPS connections, and the iOS security policy denies HTTP connections by default. To access HTTP resources, we need to white list the given domain. Your task is to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Weather app design2m 32s
-
Defining the UI using SwiftUI4m 20s
-
The WebServiceController protocol5m 13s
-
Working with a third-party API52s
-
Implementing the OpenWeatherMap controller4m 9s
-
Completing the OpenWeatherMap controller2m 42s
-
Introducing the view model3m 8s
-
Presenting weather data2m 39s
-
Challenge: Integrating a fallback service2m 34s
-
Solution: Integrating a fallback service4m 8s
-
-