Welcome to another issue!
Subscribe to another newsletter I run!
3900 subscribers already! ๐
Weekly newsletter featuring the best tools for iOS developers. Subscribe ๐ iOS Dev Tools Newsletter
Sponsored Link
A CI/CD for mobile dev teams trusted by 150,000+ developers
Automate the whole build, test, and release pipeline of your iOS apps to get to the market 20% faster.
Swift Around the Web
Free, on-device translations with the Swift Translation API
During WWDC24, Apple announced Translation, a new framework that allows us to perform on-device translations in the Swift apps.
It translates text directly on devices without needing internet access. This free framework integrates with SwiftUI and offers three methods:
- Translation sheets: Users select text and view the translation in a sheet (simple).
- Translation sessions: Provides more control over source and target languages.
- Batch translations: Translate multiple pieces of text at once.
Here are 3 advanced tips in Swift
This blog post by Vincent Pradeilles shows you 3 super interesting advanced features of Swift:
- Safer Iteration: Learn how to avoid crashes when using .enumerated().
- Loop Labels: Discover how loop labels simplify nested loop control flow.
- Custom Pattern Matching: See how to create custom matching rules for user-defined types.
Coding
Utilizing Appleโs oslog for Enhanced Logging in Xcode
This blog post explains a custom logging system for the iOS app using Apple's oslog. It describes how to categorize logs with different levels (debug, info, error) and enrich them with details like timestamps and file names.
It also explains how to log network requests and their responses for improved debugging with well-structured logs and efficient management in Xcode's console.
This logging is ideal for iOS developers who want to enhance their app's logging capabilities for better debugging and maintenance.
Using TextRenderer to create highlighted text
TextRenderer is a new protocol introduced at WWDC 2024 which lets us enhance how text is rendered in SwiftUI. It creates a reusable HighlightedText view that takes text, optional highlighted text, and optional highlighting style.
The writer tried to show how to create a view that enables us to highlight certain parts of a given String. Previously this was primarily done using NSAttributedString, but with TextRenderer it is now possible to do the same in a pure SwiftUI way.
Mastering ScrollView in SwiftUI. Scroll Phases
New SwiftUI scrolling features allow us to precisely track scroll behavior. This post explores ScrollPhase, an enum that defines different scroll stages:
- Idle (no scrolling)
- Tracking (user touches content but doesn't drag)
- Interacting (user drags to scroll)
- Decelerating (scroll view slows after user interaction)
- Animating (programmatic scroll using ScrollPosition/ScrollViewReader)
We can leverage the onScrollPhaseChange modifier to react to these changes and potentially customize views based on the scroll state.
Design
Whatโs New in SF Symbols 6: New Features and Stunning Animations
This blog post dives into SF Symbols 6, a new update that adds animations to the vector-based icons for iOS apps.
- It allows us to create animated icons for a more engaging user experience.
- New animations include wiggle, rotate, and breathe.
- We can configure and combine these animations for even more expressive icons.
- It also introduced over 800 new symbols and improved integration with SwiftUI.
These symbol animations emphasize improved user experience through engaging interfaces and clear feedback.
Mixing colors in SwiftUI and Xcode 16
SwiftUI in iOS 18 and macOS 15 has gained a new trick; it can mix colors. We can blend two colors with a specified weight (0-1) to create a new color. For instance, mixing pink and blue with a weight of 0.5 would result in a purple shade.
The post provides an example code demonstrating how to mix colors to create various shades using the mix function.
This feature is useful for exploring color palettes because you can easily see how different colors blend.
Other Cool Stuff
Xcode Explicitly Built Modules
Xcode 16 offers an experimental setting to explicitly build Swift modules. It analyzes dependencies and prioritizes builds, but initial tests show no significant improvement.
The feature might even be slower in some cases. A potential benefit is faster expression evaluation in the debugger, but this feature is still experimental for Swift in Xcode 16 beta
Tools
BananaBin - take out the trash ๐
BananaBin is a new Mac app uses animated flies to tell you when to take out the trash.
In Case You Missed It
SwiftUI: Horizontal ScrollView on Vertical Drag Gesture
This guide explores a SwiftUI technique for horizontal scrolling triggered by vertical drags, mimicking Apple's homepage UI.
To achieve this scrolling, the writer disables the default horizontal behavior of ScrollView, tracks the current horizontal position with a variable, captures vertical swipes with a DragGesture, and translates them proportionally for smooth scrolling.
Additionally, it retrieves the scrollable content's size to prevent overscrolling at the beginning or end.
Videos
Swift News - Apple Intelligence, WWDC 24, Swift Testing, SwiftUI & More
Sean Allen shared exciting new features about Swift, SwiftUI, and UIKit, along with best practices for testing our apps in this video.
It also dives into resources from Apple's WWDC conference and showcases the winners of the Apple Design Awards (including a design tip at 13:53).
For a bonus, the video explores the history of SwiftUI and how Apple's products have evolved over the years.
Books
FREE: SwiftUI and Accessibility: Creating Inclusive iOS Applications (eBook)
Empower users of all abilities by creating accessible iOS apps with SwiftUI. This comprehensive guide dives deep into best practices and development techniques. Like,
- Inclusive Design: Craft apps for users with diverse abilities.
- Accessibility Mastery: Become an expert in Xcode's accessibility features.
- Optimized Features: Ensure proper font size, color contrast, and VoiceOver for visual impairments.
It helps to boost user satisfaction, reputation, and market reach while adhering to accessibility standards.