Welcome to another issue!
Swift Conference in Paris (September 2024)
Simone Civetta the organizer of Swift Connection contacted me and asked if I could promote the conference that will take place in Paris in September 2024. 🇫🇷
And as I shared in one of the previous emails - I'm always happy to share some valuable information and help others! 💪
Swift Connection - French conference dedicated to Swift, iOS, macOS, and the ecosystems of Apple technologies, previously known as FrenchKit.
If you will be around in Paris at that time, go and check it out!
I appreciate your support and let's dive into this week's news! 👇
Subscribe to another newsletter I run!
3850 subscribers already! 🚀
Weekly newsletter featuring the best tools for iOS developers. Subscribe if you like @iOS developers
Swift Around the Web
Swift 6: Incrementally migrate your Xcode projects and packages
Migrate your Xcode projects and Swift packages to Swift 6 for a smoother development experience and improved app stability.
Incremental Migration Steps:
- Isolate code (target/module)
- Enable upcoming features (one by one)
- Increase strict concurrency checking (gradually)
- Change language version to Swift 6
This step-by-step approach simplifies migration and lets you leverage Swift 6's enhancements.
Hello Swift Testing, Goodbye XCTest
This article by Leo compares Apple's new Swift Testing framework with the current XCTest framework.
It highlights the key differences between XCTest and Swift Testing and some of the common scenarios you probably will face, like injecting your Spies or adding your SUT object and others.
Async await in Swift explained with code examples
And another great article by Antoine. 💪
Async and Await are new features in Swift for asynchronous programming. They improve readability and error handling while making code safer.
- Async: Allows methods to run tasks without blocking the main thread.
- Await: Pauses execution until an asynchronous task finishes.
These features replace older methods with the new concurrency model using closure-based completion handlers with Xcode.
Coding
Mastering ScrollView in SwiftUI. Scroll Offset
Article explores programmatic control over scroll position in SwiftUI's ScrollView.
- New ScrollPosition Type: Introduced in SwiftUI, ScrollPosition allows for precise control of scroll offset.
- Scrolling to Specific Locations: Scroll to edges (top, bottom), specific views by ID, or arbitrary points using various scrollTo methods.
- Animation Support: Animate programmatic scrolling using the animation view modifier.
- Reading Scroll Position: While programmatic scrolling is covered here, a future article will detail how to read user-initiated scroll positions.
SwiftUI Hero Animations with NavigationTransition
In his latest article Peter Friese explores creating hero animations in SwiftUI using the new NavigationTransition protocol introduced in iOS 18.
- Key Feature: Leverage SwiftUI's new NavigationTransition protocol (iOS 18) for hero animations.
- Reusable Component: Build a reusable component for this hero animation effect.
- Customization: Fine-tune the source view's appearance during the animation. Dismiss Options: Implement a dismiss button and drag-to-dismiss gesture for the target view.
- Enhanced Experience: Create a scaling-down effect and disable the source view highlight, improving user experience.
Design
iOS 18: Notable UIKit Additions
Some new features in iOS 18's UIKit framework for building user interfaces.
- Automatic Trait Tracking: Less code for handling changes in device orientation and size.
- UIUpdateLink: Improved performance and battery efficiency for complex animations.
- Enhanced SF Symbols: New animations and customization options.
- Custom Text Formatting: Rich text editing capabilities similar to the Notes app.
- Other Improvements: Week-by-week calendar selection, unified gestures across SwiftUI and UIKit, haptic feedback integration withdrawal, and more.
Other Cool Stuff
Tricking iOS Into Animating App Icons
Bryce Bostwick shares a a technique that lets you create animated app icons in iOS by exploiting some private API.
This hack offers animation but relies on private APIs, which could break in future iOS updates.
Preparing your App Icon for dark and tinted appearance
Learn to prepare app icons for the new Dark Mode and tinted appearance features in iOS 18.
Basic guidelines:
- Three icon variants are needed: Light mode, Dark mode, and Tinted.
- Start with a clear and recognizable light mode icon.
- Dark mode icons can use the original color scheme with adjustments for contrast. The system can also automatically add a dark background.
- Tinted icons require a fully opaque grayscale image. The system applies a gradient tint based on user preference.
By following these guidelines, you can ensure your app icon looks great in all modes and provides a consistent user experience.
How to Mirror Any View in SwiftUI?
The post explains how to invert (mirror) any view in SwiftUI using the scaleEffect modifier.
The author encourages experimentation and exploration of these concepts in your SwiftUI projects. The possibilities for creative UI design are endless. You can significantly enhance the interactivity and visual appeal of your applications.
In Case You Missed It
What Type of Loading and Progress Indicators are implemented in the App?
The importance of loading indicators for user experience mainly has two types: indeterminate and determinate.
- Indeterminate indicators: Used when load time depends on factors like internet speed. They reassure users that the app is working.
- Determinate indicators: Display progress as a percentage, allowing users to estimate wait time.
The post also provides best practices for implementing these indicators. By following those tips, you can create a more positive user experience in your app.