Swift Around the Web
Introducing Swift Testing. Traits
Swift Testing's trait system introduces a versatile way to control test execution. With traits, we can disable certain tests, enable them conditionally, set time constraints, and use tags to organize group tests meaningfully.
This approach simplifies our testing process, by ensuring we can effectively manage our workflow and maintain high-quality, reliable code.
Coding
How to Use URLSession with Async/Await for Network Requests in Swift
Explore how to effortlessly make network requests in Swift using URLSession and async/await. Learn to perform GET and POST requests, decode JSON responses, and implement robust error handling.
This guide empowers you to build efficient and reliable networking layers for your Swift apps without relying on third-party libraries.
Swift Format in Xcode
Learn how Xcode's built-in Swift Format tool compares the popular alternatives like SwiftLint and Prettier.
This article explores their strengths and weaknesses in addressing common formatting issues, such as indentation, line length, and whitespace.
visionOS
Identifying attention areas in images with Vision Framework
Learn how to use the Vision Framework's Saliency Analysis feature to identify the most important parts of an image. By analyzing images and generating heatmaps, you can gain insights into user attention and optimize your app's visual design.
This technique can be used for image optimization, user interface design, and content moderation.
Apple News
Upcoming changes to the App Store Receipt Signing Intermediate Certificate
Apple is updating the App Store receipt signing intermediate certificate to use the more secure SHA-256 algorithm. If your app performs on-device receipt validation and doesn't support SHA-256, it may fail to validate receipts after January 24, 2025.
To ensure uninterrupted app functionality, update your app to support SHA-256 or use the AppTransaction and Transaction APIs for receipt verification. For detailed guidance, refer to TN3138.
Design
SwiftUI Self-Sizing Flow Layouts
Check how to build flexible and responsive grid-like layouts in SwiftUI using the Layout protocol.
This tutorial guides you through using sizeThatFits and placeSubviews to create dynamic and visually appealing user interfaces that adapt seamlessly to different screen sizes and content variations.
Other Cool Stuff
Dynamic colors in SwiftUI
Discover how to create adaptable color schemes in SwiftUI apps that respond to the userβs preferred interface style.
This guide explores both asset catalog and code-based methods, enabling you to implement dynamic colors that improve user experience and simplify maintenance.
How to automatically update build and version numbers in your app using Fastlane
Simplify your app deployment process with Fastlane. Automate version and build number updates, ensuring your releases are always up-to-date.
By using release branches and Fastlane actions, you can streamline your workflow and avoid common pitfalls.
In Case You Missed It
Implement blurring when multitasking in SwiftUI
Learn how to safeguard user privacy by automatically blurring your app's screen when it enters multitasking or background mode.
This guide provides step-by-step instructions on using SwiftUI's @Environment(.scenePhase) and blur(radius:) modifiers to implement this essential privacy feature.
Tutorials
Some most loved SwiftUI modifiers
Custom modifiers to clean up your SwiftUI code and improve its maintainability. By encapsulating common styling, layout, and conditional logic into reusable components, you can reduce code duplication and enhance readability.
This guide will help you streamline your development process and build more elegant and efficient SwiftUI applications.
Videos
MockData, PreviewModifiers and PreviewTraits in SwiftUI
Learn to create realistic and informative SwiftUI previews by effectively setting up mock data. This video demonstrates how to use static arrays of mock data and inject them into your view models to visualize your UI without relying on real data.
Additionally, it explores the use of the @Preview
attribute and preview modifiers to customize and enhance your previews.