<?xml version="1.0" encoding="utf-8" standalone="no"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:media="http://search.yahoo.com/mrss/"> <channel> <atom:link href="https://cocoacasts.com/feed.rss" rel="self" type="application/rss+xml" /> <title>Cocoacasts</title> <link>https://cocoacasts.com</link> <description>If you're looking for a quick fix, then I don't have anything to offer you. If you want to become a better Swift developer, then have a seat and let me share with you what I know.</description> <language>en-us</language> <pubDate>Sun, 23 Mar 2025 01:07:52 +0000</pubDate> <lastBuildDate>Sun, 23 Mar 2025 01:07:52 +0000</lastBuildDate> <ttl>40</ttl> <item> <title>Runtime Issue Breakpoints</title> <description>A few years ago, Apple added support for detecting potential issues at runtime. Runtime issues show up as purple issues in Xcode's Issues Navigator. They are easy to miss or ignore, but they are just as important as errors at compile time.</description> <pubDate>Wed, 31 Jan 2024 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/debugging-apps-with-xcode-15-runtime-issue-breakpoints</guid> <link>https://cocoacasts.com/debugging-apps-with-xcode-15-runtime-issue-breakpoints</link> </item> <item> <title>Exception Breakpoints</title> <description>In the previous video, we used the Swift error breakpoint to suspend the process of the app if an error is thrown in your code or the code of a library or framework. The exception breakpoint works in a similar way. The difference, as you may have guessed, is that the debugger suspends the process of the app if an exception is thrown.</description> <pubDate>Wed, 10 Jan 2024 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/debugging-apps-with-xcode-15-exception-breakpoints</guid> <link>https://cocoacasts.com/debugging-apps-with-xcode-15-exception-breakpoints</link> </item> <item> <title>Swift Error Breakpoints</title> <description>Error handling is a key aspect of the Swift language. In several ways errors in Swift are similar to exceptions in Objective-C and C++. Both errors and exceptions indicate that something didn't go as planned. The Swift error and exception breakpoints are useful to debug scenarios in which errors or exceptions are thrown.</description> <pubDate>Wed, 3 Jan 2024 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/debugging-apps-with-xcode-15-swift-error-breakpoints</guid> <link>https://cocoacasts.com/debugging-apps-with-xcode-15-swift-error-breakpoints</link> </item> <item> <title>Symbolic Breakpoints</title> <description>Earlier in this course, we briefly explored the types of breakpoints you can use in Xcode. In the previous video, we focused on file and line breakpoints. This video zooms in on symbolic breakpoints.</description> <pubDate>Wed, 18 Oct 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/debugging-apps-with-xcode-15-symbolic-breakpoints</guid> <link>https://cocoacasts.com/debugging-apps-with-xcode-15-symbolic-breakpoints</link> </item> <item> <title>Managing and Editing Breakpoints</title> <description>When you are debugging a complex problem, you quickly end up with dozens of breakpoints scattered across your project or workspace. I would like to start this video by showing you how you can stay on top of the breakpoints in a project or workspace.</description> <pubDate>Wed, 11 Oct 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/debugging-apps-with-xcode-15-managing-and-editing-breakpoints</guid> <link>https://cocoacasts.com/debugging-apps-with-xcode-15-managing-and-editing-breakpoints</link> </item> <item> <title>Stepping through Code With Breakpoints</title> <description>In the previous video, you learned what a breakpoint is and what types of breakpoints Xcode supports. In this video, we step through code using a breakpoint and the debug bar we explored earlier in this course.</description> <pubDate>Wed, 4 Oct 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/debugging-apps-with-xcode-15-stepping-through-code-with-breakpoints</guid> <link>https://cocoacasts.com/debugging-apps-with-xcode-15-stepping-through-code-with-breakpoints</link> </item> <item> <title>Debugging with Breakpoints</title> <description>Breakpoints are indispensable for debugging problems in a software project. Debugging an app with breakpoints can seem complex at first, but it isn't difficult once you understand what is going on. While the underlying concept of debugging with breakpoints is simple, you can make it as complex as you want to fit your needs.</description> <pubDate>Wed, 27 Sep 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/debugging-apps-with-xcode-15-debugging-with-breakpoints</guid> <link>https://cocoacasts.com/debugging-apps-with-xcode-15-debugging-with-breakpoints</link> </item> <item> <title>Exploring Xcode's Debugging Tools</title> <description>Xcode offers developers a mature development environment with a powerful debugger. Under the hood, Xcode's debugging tools take advantage of LLDB, the debugger of the LLVM project. It isn't necessary to have a deep understanding of LLDB or LLVM to make use of Xcode's debugging tools, but it certainly doesn't hurt to become familiar with LLDB or LLVM.</description> <pubDate>Wed, 20 Sep 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/debugging-apps-with-xcode-15-exploring-xcode-debugging-tools</guid> <link>https://cocoacasts.com/debugging-apps-with-xcode-15-exploring-xcode-debugging-tools</link> </item> <item> <title>Where to Start</title> <description>Everyone makes mistakes, and developers are no different. As a developer, you spend a significant portion of your time debugging the code you write. It is an inextricable aspect of software development. Some bugs are easy to find, while others can make you scratch your head.</description> <pubDate>Fri, 15 Sep 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/debugging-apps-with-xcode-15-where-to-start</guid> <link>https://cocoacasts.com/debugging-apps-with-xcode-15-where-to-start</link> </item> <item> <title>Migrating from ObservableObject to Observable</title> <description>I'd like to end this series by taking advantage of the recently introduced Observable macro. The changes we need to make are small and focused, but we also run into a few issues. Let's get started.</description> <pubDate>Wed, 6 Sep 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-integrating-the-observable-macro</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-integrating-the-observable-macro</link> </item> <item> <title>The Challenges of Asynchronous Unit Tests</title> <description>In this episode, we finish the unit test we started in the previous episode. Even though the implementation of the addLocation(with:) method of the AddLocationViewModel class isn't overly complex, writing a unit test for it is quite the challenge. Let's continue where we left off.</description> <pubDate>Wed, 16 Aug 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-the-challenges-of-asynchronous-unit-tests</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-the-challenges-of-asynchronous-unit-tests</link> </item> <item> <title>Writing Asynchronous Unit Tests</title> <description>In this episode, we continue where we left off in the previous episode, that is, writing unit tests for the AddLocationViewModel class. This episode is an important one because it illustrates the impact asynchronous code can have on the unit tests you write.</description> <pubDate>Wed, 2 Aug 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-writing-asynchronous-unit-tests</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-writing-asynchronous-unit-tests</link> </item> <item> <title>Unit Testing a Complex View Model</title> <description>In the previous episode, we wrote unit tests for a simple view model, the AddLocationCellViewModel struct. In this episode, we take it up a notch and write unit tests for a complex view model. We take the AddLocationViewModel class as an example.</description> <pubDate>Wed, 19 Jul 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-unit-testing-a-complex-view-model</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-unit-testing-a-complex-view-model</link> </item> <item> <title>Unit Testing a Simple View Model</title> <description>One of the key benefits of the Model-View-ViewModel pattern is improved testability. It isn't possible to write unit tests for the SwiftUI views we created, but we can unit test the view models that drive those views. The good news is that writing unit tests for a well-designed view model isn't difficult.</description> <pubDate>Sun, 9 Jul 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-unit-testing-a-simple-view-model</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-unit-testing-a-simple-view-model</link> </item> <item> <title>How to Set Up In-App Purchases with RevenueCat</title> <description>Offering a subscription product in your application involves more than integrating with Apple's StoreKit framework. You need to set up subscription products in App Store Connect, keep track of the user's subscription status, and restrict access to the content or features that are exclusive to subscribers. Things get even more complicated if your application offers multiple tiers or is available on multiple platforms.</description> <pubDate>Wed, 14 Jun 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/how-to-set-up-in-app-purchases-with-revenuecat</guid> <link>https://cocoacasts.com/how-to-set-up-in-app-purchases-with-revenuecat</link> </item> <item> <title>Injecting Dependencies with Swinject</title> <description>We hit a roadblock in the previous episode. The CurrentConditionsViewModel struct needs access to a Store object, but it is tedious to pass a Store object from one view model to the next. In this episode, we use a dependency injection library, Swinject, to make this much less of a problem.</description> <pubDate>Thu, 18 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-injecting-dependencies-with-swinject</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-injecting-dependencies-with-swinject</link> </item> <item> <title>Deleting Locations</title> <description>The last feature we need to add is the ability to delete locations. The changes we need to make are small, but there is a problem we need to address. Let's start by adding a button to the CurrentConditionsView.</description> <pubDate>Tue, 16 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-deleting-locations</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-deleting-locations</link> </item> <item> <title>Defining the States of the Location View</title> <description>The LocationView is always in one of two states, fetching weather data or displaying weather data. It is the LocationView itself that implicitly defines these states and that is limiting. Not only is it limiting, we cannot write unit tests for the states of the LocationView. In this episode, I show you a solution that is testable and extensible.</description> <pubDate>Thu, 11 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-defining-the-states-of-the-location-view</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-defining-the-states-of-the-location-view</link> </item> <item> <title>Refactoring the Location View Model</title> <description>The LocationView still displays stub data. That is something we change in this episode. The LocationViewModel struct is responsible for fetching the weather data the LocationView displays. It uses that weather data to create view models for the CurrentConditionsView and the ForecastView.</description> <pubDate>Wed, 10 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-refactoring-the-location-view-model</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-refactoring-the-location-view-model</link> </item> <item> <title>Refactoring the Forecast View Model</title> <description>In this episode, we refactor the ForecastViewModel struct and the ForecastCellViewModel struct. The ForecastViewModel struct drives the ForecastView, the bottom section of the LocationView. Let's get to work.</description> <pubDate>Tue, 9 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-refactoring-the-forecast-view-model</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-refactoring-the-forecast-view-model</link> </item> <item> <title>Refactoring the Current Conditions View Model</title> <description>In this episode, we refactor the CurrentConditionsViewModel struct. Remember that the CurrentConditionsViewModel struct drives the CurrentConditionsView, the top section of the LocationView. The changes we need to make are small.</description> <pubDate>Mon, 8 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-refactoring-the-current-conditions-view-model</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-refactoring-the-current-conditions-view-model</link> </item> <item> <title>Setting Up A Proxy Server with Swift and Vapor</title> <description>In yesterday's episode, I wrote about protecting your application's secretes with a proxy server. In today's episode, I show you how to set up a proxy server with Swift and Vapor.</description> <pubDate>Sun, 7 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/setting-up-a-proxy-server-with-swift-and-vapor</guid> <link>https://cocoacasts.com/setting-up-a-proxy-server-with-swift-and-vapor</link> </item> <item> <title>Protecting Secrets with a Proxy Server</title> <description>Most of the services your application interacts with require authentication. Authentication through a secret, an API key or a client secret, is a commonly used method. Your application includes the secret in the request it sends to the service. That is only possible if your application has access to the secret at runtime.</description> <pubDate>Sat, 6 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/protecting-secrets-with-a-proxy-server</guid> <link>https://cocoacasts.com/protecting-secrets-with-a-proxy-server</link> </item> <item> <title>Avoiding Code Duplication</title> <description>In the previous episode, we used the MeasurementFormatter class to format the raw values the Clear Sky API returns. This is convenient and we use the MeasurementFormatter class several more times in the next few episodes. In this episode, we create an elegant API that wraps around the MeasurementFormatter API to avoid code duplication.</description> <pubDate>Fri, 5 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-avoiding-code-duplication</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-avoiding-code-duplication</link> </item> <item> <title>Refactoring the Location Cell View Model</title> <description>With the WeatherService protocol in place, we can refactor the view models that need to provide their views with weather data. In this episode, we focus on the LocationCell by refactoring the LocationCellViewModel class.</description> <pubDate>Thu, 4 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-refactoring-the-location-cell-view-model</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-refactoring-the-location-cell-view-model</link> </item> <item> <title>Injecting Base URL and API Key</title> <description>In the previous episode, we hard-coded the base URL and the API key of the Clear Sky API in the WeatherClient class. I'm not a fan of hard-coding configuration details. In this episode, we explore an alternative approach.</description> <pubDate>Wed, 3 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-injecting-base-url-and-api-key</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-injecting-base-url-and-api-key</link> </item> <item> <title>Fetching Weather Data</title> <description>In this episode, we add the ability to fetch weather data from the Clear Sky API and decode a WeatherData object from the API response. We apply a pattern that should feel familiar by now.</description> <pubDate>Tue, 2 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-fetching-weather-data</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-fetching-weather-data</link> </item> <item> <title>Defining the Weather Data Model</title> <description>It is time to focus on one of the core aspects of the weather application we are building, fetching and displaying weather data. Thunderstorm displays placeholder data for the time being. That is something we change in this and the next episodes.</description> <pubDate>Mon, 1 May 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-defining-the-weather-data-model</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-defining-the-weather-data-model</link> </item> <item> <title>What to Gift Your Programmer Friend?</title> <description>Being a programmer myself, I know how challenging it can be to find the perfect gift for a fellow coder. Programmers are often quirky with peculiar interests. Finding a gift that speaks to their passions can be, well, challenging. The good news is that there are plenty of options to delight any coder, whether they are a seasoned professional or just starting out.</description> <pubDate>Thu, 27 Apr 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/best-gifts-for-programmers-in-2023</guid> <link>https://cocoacasts.com/best-gifts-for-programmers-in-2023</link> </item> <item> <title>Decoupling User Defaults</title> <description>The user's defaults database acts as the store of the weather application we are building. That is fine, but most objects shouldn't be aware of that implementation detail. The LocationsViewModel and AddLocationViewModel classes are tightly coupled to the UserDefaults class, but that isn't necessary. In this episode, we decouple the LocationsViewModel and AddLocationViewModel classes from the UserDefaults class.</description> <pubDate>Wed, 26 Apr 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-decoupling-user-defaults</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-decoupling-user-defaults</link> </item> <item> <title>Updating Locations in User Defaults</title> <description>In this episode, we revisit the addLocation(with:) method of the AddLocationViewModel class. In that method, the view model stores the location the user selected in the user's defaults database.</description> <pubDate>Tue, 25 Apr 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-updating-locations-in-user-defaults</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-updating-locations-in-user-defaults</link> </item> <item> <title>What Are the Benefits of the Final Keyword in Swift</title> <description>The final keyword in Swift is often ignored or overlooked. That isn't surprising as it isn't immediately obvious what the benefits are of annotating a class, method, or property with the final keyword. In this episode, you learn about the obvious and less obvious benefits of diligently marking a class, method, or property as final.</description> <pubDate>Mon, 24 Apr 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/swift-fundamentals-what-are-the-benefits-of-the-final-keyword-in-swift</guid> <link>https://cocoacasts.com/swift-fundamentals-what-are-the-benefits-of-the-final-keyword-in-swift</link> </item> <item> <title>Persisting Locations in User Defaults</title> <description>You may remember that the LocationsView displays a static list of locations. We need to change that if we want to put the AddLocationView to use. We keep it simple and store the list of locations in the user's defaults database. Let's get to work.</description> <pubDate>Wed, 12 Apr 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-persisting-locations-in-user-defaults</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-persisting-locations-in-user-defaults</link> </item> <item> <title>0 Dependencies from the Podfile and 0 Total Pods Installed</title> <description></description> <pubDate>Sat, 8 Apr 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/0-dependencies-from-the-podfile-and-0-total-pods-installed</guid> <link>https://cocoacasts.com/0-dependencies-from-the-podfile-and-0-total-pods-installed</link> </item> <item> <title>A .gitignore for Swift Projects</title> <description>I have been using the same .gitignore file for ages, making small changes as my needs changed over the years. In this episode, I walk you through the .gitignore file I use for Swift and Vapor projects.</description> <pubDate>Wed, 5 Apr 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/a-gitignore-for-swift-projects</guid> <link>https://cocoacasts.com/a-gitignore-for-swift-projects</link> </item> <item> <title>Refactoring the Add Location View</title> <description>In the previous episode, we declared the State enum. It defines the possible states of the AddLocationView. In this episode, we integrate the State enum into the AddLocationView.</description> <pubDate>Wed, 5 Apr 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-refactoring-the-add-location-view</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-refactoring-the-add-location-view</link> </item> <item> <title>Optimizing the User Experience</title> <description>The user can add locations using the AddLocationView, but there is room for improvement. The user experience isn't optimal at the moment. The AddLocationView doesn't show a progress view when the application is forward geocoding the address the user entered and the user is faced with an empty view if no matches are found. That is something we address in this episode.</description> <pubDate>Wed, 29 Mar 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-optimizing-the-user-experience</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-optimizing-the-user-experience</link> </item> <item> <title>Improving the Testability of the Geocoding Client</title> <description>In the previous episode, we made the Core Location framework a dependency of the project. That is fine, but we don't want a dependency to compromise the testability of the project. In this episode, we use a proven and familiar pattern to improve the testability of the GeocodingClient class.</description> <pubDate>Fri, 24 Mar 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-improving-the-testability-of-the-geocoding-client</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-improving-the-testability-of-the-geocoding-client</link> </item> <item> <title>Integrating the Core Location Framework</title> <description>The GeocodingClient class returns stub data for the time being. In this episode, we integrate the Core Location framework and take advantage of the geocoding APIs it offers. We use the geocoding APIs to forward geocode the address the user enters in the TextField of the AddLocationView to a collection of `Location` objects.</description> <pubDate>Fri, 17 Mar 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-integrating-the-core-location-framework</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-integrating-the-core-location-framework</link> </item> <item> <title>Integrating the Geocoding Service</title> <description>The AddLocationView displays stub data for the time being. We change that in this and the next episode by integrating the Core Location framework. Apple's Core Location framework defines an API for forward geocoding addresses. We use that API to convert an address to a collection of placemarks. The application converts the placemarks to Location objects the AddLocationView can display.</description> <pubDate>Wed, 15 Mar 2023 06:30:00 +0000</pubDate> <guid>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-integrating-the-geocoding-service</guid> <link>https://cocoacasts.com/mastering-model-view-viewmodel-with-swiftui-integrating-the-geocoding-service</link> </item> </channel> </rss>