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
Get a single source of truth for your entire team with Runway.
Your mobile releases are hidden behind a fog of browser tabs and Slack threads. Runway cuts through this fog by bringing all of your tools and stakeholders into one place.
Swift Around the Web
Typed throws in Swift explained with code examples
Swift 16 introduces typed throws, a new feature that improves error handling. By defining the exact error type a method can throw, developers benefit from compile-time checks, autocompletion, and safer code.
It enables more precise error handling within do-catch clauses ensuring all potential errors are considered, preventing unexpected crashes. This functionality is important for SDK development, where clear error expectations are crucial.
WebSocket tutorial using Swift and Hummingbird
WebSockets is a communication method for real-time interaction between web browsers and servers.
This post guides you through building a chat application using Hummingbird, a Swift framework that simplifies WebSocket use. You'll learn how to set up Hummingbird for WebSockets, manage connections, and handle messages.
This approach leverages modern Swift features for efficient communication, making it valuable for developers building real-time web apps in Swift.
Coding
Some tips & tricks with the new iOS 18 ScrollView API
Learn useful new features for scrolling in SwiftUI apps with iOS 18. This post explores two key features that enhance the user experience by making scrolling smoother and more immersive in your apps.
- Automatic Pagination: New content appears automatically as users scroll down long lists using onScrollTargetVisibilityChange API.
- Immersive Scrolling: Hide navigation and tab bars while scrolling with onScrollPhaseChange, providing more screen space.
Zoom transitions
New zoom transitions in iOS 18 smoothly transition users from small views (thumbnails) to full screen in your apps with SwiftUI & UIKit.
Customize the source view for a clean animation start (SwiftUI) and use the cell's content view in UIKit to avoid gaps.
While limitations exist, it doesn't work with sheets, popovers, and transparency, still, the author finds this transition valuable.
Binding extensions in SwiftUI
This article explores 3 SwiftUI binding extensions to reduce boilerplate code:
- Not-Nil Binding: Easily show alerts for non-nil values in your views.
- Equivalency Binding: Present alerts based on specific error types.
- Unwrapped Values: Use optional with Text views and avoid unwrapping everywhere.
These extensions help streamline common tasks and make your SwiftUI code cleaner and more efficient.
visionOS
Diffuse reflection UV computation tool
This post shows tips for creating more immersive video experiences in your virtual reality (VR) app. A new tool called DockingRegionComponent allows us to create custom spaces for videos, similar to placing a screen in a movie theater.
For realistic reflections, your 3D models need special data (UV coordinates). Luckily, Apple offers a free Python script that automatically calculates these coordinates, making the process much easier.
Design
Mastering Animatable and AnimatablePair in SwiftUI
Aryaman Sharda explored Animatable and AnimatablePair for fine-tuning SwiftUI animations. It addresses scenarios where built-in animations are limited:
- Custom Shapes: Animate custom shapes smoothly using Animatable.
- Synchronized Animations: Animate multiple properties together to synchronize animations.
- Complex Animations: Go beyond basic changes to create complex animations.
- Text Content Animation: Achieve smoother text content transitions.
Using multi-step animations in SwiftUI
PhaseAnimator is a tool that lets you design animations in stages and control how they flow with each other. It's perfect for creating looping animations or those triggered by user actions.
It gives us two options: animate multiple views at once or focus on a single view, changing its look step-by-step.
Just remember, while animations can make your app more fun to use, don't overdo it – too many animations can make your app harder to navigate.
Other Cool Stuff
Create Custom SF Symbols in Sketch
This guide lets you create unique and custom symbols for Apple's SF Symbols library using a vector graphics tool like Sketch.
Key Steps:
- Grab an SF symbol and export its editable template.
- Modify the template's SVG paths to design your custom symbol in Sketch.
- Export your edit and add it back to SF Symbols for validation.
It also allows us to export the symbol with all variants from SF Symbols and import it to the Xcode project's Assets.
Inspect network traffic using the Xcode Simulator
Another great article by Antoine, explores RocketSim's Network Monitor, a tool that helps SwiftUI developers inspect network traffic in their apps.
It lets you see what's happening in real time, so you can debug requests, analyze responses, and make your app run smoother. Unlike other tools, RocketSim won't mess with your Mac's overall internet connection and doesn't require any certificates.
In Case You Missed It
Exploring Translation: Using translationPresentation for Translation Popover
The post explores how to add translation features to the app using translationPresentation API. This is ideal for users with older devices that lack the latest translation features.
Simply attach translationPresentation to the text view you want users to translate. This triggers a translation popover when activated.
It supports older devices (macOS/iPadOS/iOS 14.4+) and adds translation functionality without requiring the latest OS.
Videos
Some Cool SwiftUI Updates in iOS 18
Sean Allen explores some of the coolest new features in SwiftUI for iOS 18, including:
- Mesh Gradients: Create stunning, modern backgrounds.
- Zoom Transitions: Make navigation between views smooth and engaging.
- SF Symbols 6, Powerful Animations: Leverage the latest symbol library and create engaging animations.
- iPadOS-Specific Features: Explore floating TabViews and custom sheet sizes.
- Date Formatting Enhancements: Work with dates in Text views more easily.