SwiftUI
Learn more and get better in building apps with SwiftUI.
SwiftUI Alert Guide + Code Examples
You can present a SwiftUI Alert using dedicated view modifiers that make it straightforward to present native alerts. It works a bit differently compared to their UIKit variant, but you'll get used to them quickly. In this article, we're going to dive into the SwiftUI Alert functions and I'll demonstrate ...
SwiftUI Grid, LazyVGrid, LazyHGrid Explained with Code Examples
SwiftUI Grid, LazyVGrid, and LazyHGrid are UI elements that allow you to place views in a structured grid. You can control the horizontal and vertical spacing, columns, and rows. You typically use the lazy variants for performance improvements since they load items lazily when they need to enter the screen ...
SwiftUI TabView: Explained with Code Examples
The SwiftUI TabView allows you to create a tabbed view and is a great container for several of your main views. Each tab displays another main view, allowing your user to quickly switch between the most important sections of your app. Developers often use a SwiftUI Tab view as the ...
Codemagic makes Apple M2 machines available, even on the free tier!Codemagic is the first CI/CD to make Apple M2 machines available to everyone (including the free tier!). This is a free upgrade from M1 machines with no price change. Get started today.
Picker in SwiftUI explained with code examples
The picker control in SwiftUI allows you, as a developer, to create a UI element for users to select from a set of values. It comes in different styles, and the segmented control and menu picker styles are probably the most well-known variants. When you're building forms in a SwiftUI ...
How to develop an app for iOS
You have a great app idea but you wonder: how to develop an app for iOS? Where do I even start? You might also question whether it's even realistic to think you're able to build an app for iOS yourself. While it's definitely not easy, with nowadays tools you can ...
SwiftUI Lists: Present rows of data explained with code examples
SwiftUI Lists allow you, as a developer, to present rows of data. It's one of the most commonly used elements when building apps and the core of many navigation flows. Presenting rows of data is simply an implementation pattern you always need. You can use different list styles, change the ...
SwiftUI Button: Custom Styles, Variants, and Best Practices
SwiftUI allows you to create buttons in different styles, both custom and default configurations. You can define reusable button styles or quickly get started using SwiftUI modifiers specifically available for buttons. It's essential to avoid tap gestures if possible since you'll get a lot of accessibility support for free when ...
@Entry macro: Creating custom environment values in SwiftUI
The @Entry macro in SwiftUI allows you to define custom environment values without writing boilerplate code. While introduced in Xcode 16, you can use it from iOS 13 and up since it's a Swift Macro that generates backward-compatible code. The new macro can be used for environment values, as well ...
Memory consumption when loading UIImage from disk
Memory consumption can quickly increase if you load many images from the disk using UIImage. You'll generally load images from a remote address or via an asset catalog. However, you have bundled images in some cases, and you need to load them directly from a bundle path. In those cases, ...
Why macOS Development is Perfect for Indie Developers
Building apps for macOS offers developers a fantastic opportunity to expand their skills, create useful utilities to solve their problems, and begin their journey as indie developers. I've invited Jordi Bruin to write a guest article on this topic as he launched several useful Mac applications, such as MacWhisper and ...
@Previewable: Dynamic SwiftUI Previews Made Easy
Xcode 16 introduced the @Previewable macro for SwiftUI Previews, allowing you to use dynamic properties inline in previews. You'll be able to make richer and more dynamic previews of your SwiftUI views without the need to wrap any state inside child views. Swift and SwiftUI use macros to hide implementation ...