Sponsored Link
RUNWAY
Do your mobile releases involve a near-endless pile of manual tasks and different people repeatedly asking each other โWhatโs the status of the release?โ
Donโt just roll over and accept this death by a thousand branch cuts.
Swift Around the Web
Making mistakes while learning Swift
The author Paul Hudson shares his experiences with making mistakes while learning Swift and encourages others to embrace them as part of the learning process.
He emphasizes that everyone makes mistakes, including experienced developers.The key is to learn from them and use them as opportunities for growth.
JSON Parsing in Swift explained with code examples
Antoine van der Lee explains JSON parsing in Swift, a common task for iOS developers. This guide covers decoding with Decodable, handling optional properties, custom key mapping, date decoding, pretty printing, and AI code generation.
Discover how to decode JSON using the built-in Swift functionalities without external libraries and conclude that swift offers robust functionalities for JSON parsing.
Coding
Exploring SwiftUI: Using onScrollPhaseChange for Scroll Changes in iOS 18
The post explores the onScrollPhaseChange modifier in iOS 18 for creating custom scroll interactions. The author uses it to implement a feature similar to Apple Music, hiding the toolbar when scrolling down to view lyrics and showing it when scrolling up.
The post provides code examples and discusses future enhancements like adding visual effects to the scrolling experience.
Considerations for Using Codable and Enums in SwiftData Models
SwiftData makes it easy to use Codable and enums in your models. However, there are some things to keep in mind. Codable types are stored differently, and enums might be tricky to use for queries. In the future, SwiftData might be even better at using these features.
Drag and Drop in SwiftUI
This tutorial teaches you how to implement drag and drop in SwiftUI. Learn how to make simple types draggable, create drop destinations, and handle custom types for drag and drop interactions.
The post also covers adding visual cues to indicate drop targets and exporting custom types for sharing between apps.
Effect UI - build your iOS app faster
Get code+design of over 110+ high-quality components to help you build your iOS app faster. Don't waste time building components from scratch.
Wide range of components to help you build your app faster. Each and every component has been carefully crafted to ensure the best quality and re-usability.
There is a 30% summer discount now. However, you can get an extra 10% off with the promo code SWIFT10
Design
SwiftUI: Customize ProgressView
This post explores customizing ProgressView in SwiftUI. It covers basic usage, modifiers, and creating custom ProgressViewStyle.
Key points:
- ProgressView has built-in styles (linear, circular).
- Use modifiers for basic customization (tint, background, height).
- Create custom ProgressViewStyle for advanced styling.
- Gauge can be used as a ProgressView.
- Consider using custom styles for unique designs.
Subtitle Shenanigans in SwiftUIโs Menu
This post explores the intricacies of creating subtitle items in SwiftUI's Menu component. It highlights that while Menu is powerful, adding subtitles can be somewhat counterintuitive.
It shows how VStack is treated as a pass-through entity within Menu, and subtitles must be placed as sibling Text elements to the primary label content within a Button's label.
Understanding these nuances is crucial for effectively adding subtitles to your Menu items and enhancing the user experience.
Other Cool Stuff
Build Multilingual Ready Apps - WWDC24
This post summarizes key takeaways from a WWDC24 session on building apps that function well for users across different languages.
It says to create multilingual apps, remember keyboard language, use inputAccessoryView or ToolbarItem, and check for marked text. Ensure locale-aware searches and proper text rendering. Use formatters for names and localize hard coded numbers. Allow language settings and open app settings using openSettingsURLString.
Concurrency Step-by-Step: A Network Request
This post guides you through efficiently handling network requests in SwiftUI with Swift concurrency.
It focuses on separating UI-related work from background tasks using MainActor and nonisolated, using async/await for a more linear code structure, and avoiding Task.detached and MainActor.run.
This guide equips you with a solid foundation for making network requests effectively in your SwiftUI applications.
In Case You Missed It
Background Tasks on iOS
BackgroundTasks lets you run background tasks. It supports three types: BGAppRefreshTask, BGProcessingTask, and BGHealthResearchTask.
To use BackgroundTasks, enable Background Modes, register task identifiers, and schedule tasks. Remember to reschedule tasks and provide an expiration handler. Testing can be done using the debugger.
While BackgroundTasks offers benefits, considering limitations like task scheduling unpredictability and the maximum number of tasks.