Learn Swift and iOS Development
Master iOS development through in-depth tutorials and comprehensive courses on Swift, SwiftUI, UIKit, Core Data, and more.
Master iOS development through in-depth tutorials and comprehensive courses on Swift, SwiftUI, UIKit, Core Data, and more.
Learn Swift and iOS development through comprehensive video guides
Showing 277 to 288 of 420 posts
3:54
I'm not a fan of random string literals in a project and I always try to find solutions to avoid them. In today's episode, I show you an elegant solution to rid a project of string literals.
7:40
You've probably heard about Grand Central Dispatch and chances are that you've used it in some of your projects. This series takes a close look at Grand Central Dispatch. Before exploring the API of Grand Central Dispatch, we find out what it is and what problem it solves.
in Concurrency
9:40
I'd like to give the user the ability to manually refresh the weather data. While this isn't strictly necessary since the application refreshes the weather data every time the application is opened, it gives me the opportunity to show you how to implement pull to refresh, a common design pattern in mobile applications.
in Swift
8:48
The application fetches the location of the device on launch and it subsequently asks the Dark Sky API for weather data for that location. That's fine, but it isn't sufficient. What happens if the user backgrounds the application and opens it several hours later. The weather data may be out of date and, if they're traveling, the location of the device may have changed.
in Swift
9:30
It takes time to become familiar with a new programming language and some features don't always immediately make sense. Enums are a joy to work with in Swift, but it took some time before I found a use for associated values. In this episode, we refactor Rainstorm by taking advantage of enums with associated values. We remove unnecessary optionals and make the code we write more readable.
in Swift
14:47
In the previous episode, we asked the Core Location framework for the location of the device and used that location to fetch weather data. That change has made the application much more useful. At the end of the episode, I mentioned that the current implementation introduces a subtle problem. The RootViewModel class is responsible for fetching the location of the device, using the Core Location framework. The implementation of the RootViewModel class depends on the Core Location framework. Because Core Location is a framework we don't control, it impacts the testability of the RootViewModel class. Remember what I said earlier in this series. To write a fast and reliable test suite, you need to be in control of the environment the test suite runs in. In this episode, we use protocol-oriented programming to decouple the RootViewModel class from the the Core Location framework. We used protocol-oriented programming earlier in this series to add a layer of abstraction. It's a powerful pattern that is easy to adopt.
in Swift
13:32
The application we're building is shaping up nicely. It's time to make it a little bit more functional. The application is currently only capable of fetching weather data for a predefined set of coordinates. This severely limits the appeal of the application. In this episode, we use the Core Location framework to fetch the location of the device. The application will use that information to show the user weather data for their current location. That will make the application much more useful.
in Swift
16:13
In the previous episode, we drastically improved the performance and usability of the application. It no longer takes several seconds for the application to become responsive. Even though the application's performance has gotten better, there's room for improvement.
in Fundamentals
7:10
This episode should look and feel familiar if you've watched the previous episodes because we are about to write unit tests for the WeekViewModel and WeekDayViewModel structs. Let's start with the WeekViewModel struct.
in Swift
12:37
In this episode, we populate the week view. We build the user interface and implement the WeekViewModel struct and the WeekViewController class. Let's start with the user interface.
in Swift
8:08
Earlier in this series, I showed you that dependency injection with storyboards isn't complicated once you understand how the various pieces fit together. We haven't covered tab bar controllers in this series and it seems quite a few developers run into problems when working with storyboards and tab bar controllers. It's a bit more complicated, but that complexity disappears once you understand how everything fits together.
in Patterns
12:57
Because a view model isn't or shouldn't be coupled to the user interface, it's easy to write unit tests for a view model. I'd like to illustrate that in this episode by writing a handful of unit tests for the DayViewModel struct. If you're new to unit testing, then this episode is an excellent start.
in Swift