SwiftLee https://www.avanderlee.com/ A weekly blog about Swift, iOS and Xcode Tips and Tricks Tue, 24 Jan 2023 08:23:17 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 Testing push notifications on the iOS simulator https://www.avanderlee.com/workflow/testing-push-notifications-ios-simulator/ Tue, 24 Jan 2023 08:23:14 +0000 https://www.avanderlee.com/?p=2538 Testing push notifications in the iOS simulator make adding support for remote notifications much more effortless. You often must iterate a lot to verify that your code is working as expected. After gaining permission to receive push notifications in your app, you can start testing out several notifications. Xcode’s Simulator supports testing both regular and … 

The post Testing push notifications on the iOS simulator appeared first on SwiftLee.

]]>
Task Groups in Swift explained with code examples https://www.avanderlee.com/concurrency/task-groups-in-swift/ Tue, 17 Jan 2023 09:12:54 +0000 https://www.avanderlee.com/?p=27470 Task Groups in Swift allow you to combine multiple parallel tasks and wait for the result to return when all tasks are finished. They are commonly used for tasks like combining multiple API request responses into a single response object. Read my article about tasks first if you’re new to them, and make sure you’ve … 

The post Task Groups in Swift explained with code examples appeared first on SwiftLee.

]]>
RocketSim 9.0: Enhance your iOS Simulator https://www.avanderlee.com/xcode/rocketsim-simulator-tool/ Mon, 09 Jan 2023 18:37:49 +0000 https://www.avanderlee.com/?p=5357 RocketSim is a developer tool that gives your iOS Simulator extra functionalities to increase day-to-day development productivity. Floating windows become visible next to your active Simulator to provide additional functionalities while not being too intrusive. Some significant features include recordings with touches and bezels, performing quick actions on recent builds, and several design comparison features. … 

The post RocketSim 9.0: Enhance your iOS Simulator appeared first on SwiftLee.

]]>
Engineering goals: How to become a more successful developer https://www.avanderlee.com/optimization/engineering-goals-become-successful-developer/ Tue, 03 Jan 2023 08:54:10 +0000 https://www.avanderlee.com/?p=14660 Engineering goals create focus and help you achieve the milestones of becoming a successful developer. You’ll know better what you’ve accomplished in the past months, and make sure that you work on projects with the highest impact. Over the past years, goals helped me successfully release new versions of RocketSim and Stock Analyzer. While I … 

The post Engineering goals: How to become a more successful developer appeared first on SwiftLee.

]]>
Enum explained in-depth with code examples in Swift https://www.avanderlee.com/swift/enumerations/ Tue, 27 Dec 2022 09:39:38 +0000 https://www.avanderlee.com/?p=1191 Enum usage in Swift: If case, guard case, fallthrough, and the CaseIteratable protocol. These are all terms which could sound familiar if you’ve worked a lot with enums in Swift. An enumeration defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code. It’s … 

The post Enum explained in-depth with code examples in Swift appeared first on SwiftLee.

]]>
SwiftLee 2022: A Year in Review https://www.avanderlee.com/general/swiftlee-2022-a-year-in-review/ Tue, 20 Dec 2022 08:00:00 +0000 https://www.avanderlee.com/?p=7912 Another year passed by, and we’re close to getting into 2023. It’s been a year with a single Swift 5.7 release, Xcode 14, new SwiftLee products, and many articles. I always enjoy looking back on the year and realizing what I’ve achieved, hopefully inspiring others for the year to come. More than ever, I’ve been … 

The post SwiftLee 2022: A Year in Review appeared first on SwiftLee.

]]>
OptionSet in Swift explained with code examples https://www.avanderlee.com/swift/optionset-swift/ Tue, 13 Dec 2022 08:26:30 +0000 http://www.avanderlee.com/?p=105 OptionSet in Swift allows you to define a set of options for configurations. It’s the Swift variant of the well-known NS_OPTIONS in Objective-C and it’s used throughout the standard libraries. A set of options is often confused by a set of enum cases, but they’re not the same. While you could create a similar solution … 

The post OptionSet in Swift explained with code examples appeared first on SwiftLee.

]]>
How to use FormatStyle to restrict TextField input in SwiftUI https://www.avanderlee.com/swiftui/formatstyle-formatter-restrict-textfield-input/ Tue, 06 Dec 2022 08:33:45 +0000 https://www.avanderlee.com/?p=5997 A custom FormatStyle can help you control the allowed characters of a SwiftUI TextField. You might want to allow numbers only or a specific set of characters. While you could use a formatter in many cases, it’s good to know there’s a flexible solution using a custom FormatStyle implementation. In my case, I was looking … 

The post How to use FormatStyle to restrict TextField input in SwiftUI appeared first on SwiftLee.

]]>
Sheets in SwiftUI explained with code examples https://www.avanderlee.com/swiftui/presenting-sheets/ Tue, 29 Nov 2022 09:18:49 +0000 https://www.avanderlee.com/?p=5726 Sheets in SwiftUI allow you to present views that partly cover the underlying screen. You can present them using view modifiers that respond to a particular state change, like a boolean or an object. Views that partly cover the underlying screen can be a great way to stay in the context while presenting a new … 

The post Sheets in SwiftUI explained with code examples appeared first on SwiftLee.

]]>
@dynamicCallable in Swift explained with code examples https://www.avanderlee.com/swift/dynamiccallable/ Tue, 22 Nov 2022 09:32:05 +0000 https://www.avanderlee.com/?p=5715 It’s all in the name: @dynamicCallable in Swift allows you to dynamically call methods using an alternative syntax. While it’s primarily syntactic sugar, it can be good to know why it exists and how it can be used. We covered @dynamicMemberLookup earlier, allowing us to express member lookup rules in dynamic languages naturally. @dynamicCallable is … 

The post @dynamicCallable in Swift explained with code examples appeared first on SwiftLee.

]]>