
Build a RESTful weather app from scratch using Alamofire and Swift 5, mastering API calls, JSON decoding, and error handling in MVC architecture.
Please download the image assets to follow along with the lessons.
Sign up for open weather, create a new API key, and install Alamofire and SkeletonView in your Swift 5 weather app to enable API calls and loading placeholders.
Create a robust weather manager, call the OpenWeatherMap API for current data, and decode it into a Swift weather data model mapping name, temperature, and description.
Fetch weather by city using a weather manager and a completion handler with a result type, then update the UI with the weather data and show a skeleton loading animation.
Create a custom add city UI from a plus button, presenting a modal form with labels, text input, and an activity indicator inside a stack view.
Map weather condition IDs to icons and update the weather image in the user interface by converting API payload into a weather model and using a computed condition image.
Configure the city form to show the keyboard on load by making the city text view the first responder. Use a tap gesture to dismiss when tapping outside.
Implement form validation for the city search by guarding non-empty input, showing an inline error when empty, and revealing the search area while hiding the status label.
Wire a search button to fetch weather by city with a weather manager, show an activity indicator during search, handle success or error, and update the status accordingly.
Use delegates and a weather view controller delegate protocol to pass a weather model from city to weather view, update the view, dismiss after a delay, and hide the keyboard.
Build robust error handling for a weather app by decoding server payloads, introducing a custom weather error with a city not found message, and validating 4xx responses.
Implement a location manager to obtain the user's current coordinates, manage authorization statuses, and update the weather page with location-based data via CLLocationManager and delegate methods.
Fetch user coordinates by tapping the location button, handle location permission, receive updates via a delegate method, and print the latest latitude and longitude from the coordinates.
Fetch weather data using coordinates with the open weather map api and api key. Refactor to a reusable handle request function and update the ui on the main thread.
Refactor a weather app to remove duplicated code by adding city and location based fetch, using latitude and longitude, and a centralized result handler to update data and animations.
Demonstrate error handling by replacing console prints with a toast using the Loaf library, showing a top message like 'something went wrong. please try again.'
Modularize error handling by extracting a private function handleError(error:) and applying it to location manager failures and invalid city scenarios, ensuring clear user messages.
Learn to simulate the device location by editing the scheme and enabling location simulation, test with San Francisco, Honolulu, and Jakarta, noting the default is Sydney and occasional inconsistency.
Refactor and clean up the weather app by fixing grammar and copy, improving error messages, and moving alerts to the bottom for clearer location permission prompts and city search handling.
Add a launch screen by placing an image view on the storyboard, set 200-point width and height, center it, and use a sun icon from assets for the launch preview.
Learn how to add app icons, resize assets for iPhone and iPad, use an icon generator, and change the app display name in a Swift app.
Set a custom location using the simulator, choose a place on Google Maps, copy its latitude and longitude, and update the app to show the new city.
Question - https://www.udemy.com/instructor/communication/qa/10300200/detail/
In this video, we learn the differences between a stored property and a computed property.
In this bonus video, we explore how we can cache the city in UserDefaults.
Welcome to the Build a RESTFul API Weather App with Alamofire & Swift 5 course.
This course is designed for iOS developers with at least 6 to 9 months experience or web developers who want to learn to make network or RESTful APIs calls on the iOS platform. The lessons are designed to provide student the thought process and skillset required to make HTTPS calls with a secured API key via building a concise and fully functional weather app. In this course, students will also learn to build the views via the storyboard with auto layout and stack views. The project is built according to the MVC architecture which reinforces good coding practices such as the DRY principle, separation of concerns and keep code readable, neat and modular.
These are some comments from students of courses by the instructor:
Excellent Content, I appreciate the different styles of onboarding screens and all the great explanation! - Carey M
The course is very concise but informative . I really like the project based approach that this course takes. It cuts straight to the chases and show you how these abstract concepts are put into real life problems . Highly recommended - AN Dinh
Really easy to follow and great for beginners. Really enjoyed the course, thanks Kelvin! - Atiqah A.K
Perfect course to help me get started on ios programming! - Tan Kel Vin
The instructor is knowledgeable and clear with his instructions. The course is great and informative for those who are planning to build a skeleton they can build on their own app projects Instructor is also helpful. - Raphael Lim