Welcome to another issue!
Hey guys! π
I hope you had a wonderful summer and are ready to get back to work or personal projects. People usually start something new in autumn and winter.
So if you are interested in sharing something with the community, please do not hesitate to reach out to me.
In the #books section, you'll find a FREE ebook from one of my newsletter readers, Cyril. Do what he did and reach out to me if you have anything to share or need help!
I appreciate your support and let's check what I found for you today! π
Swift Around the Web
SwiftDataβs new Index and Unique macros
There are two new features in SwiftData, a framework for managing data models inside SwiftUI applications:
- Index Macro: Improves performance for frequently filtered and sorted properties.
- Unique Macro: Enforces uniqueness on combinations of properties, preventing duplicate entries.
It enhances SwiftData's capabilities, making it a powerful and user-friendly tool for building data-driven applications.
Coding
Swift Optionals cheat sheet
This cheat sheet provides a concise overview of Swift Optionals, which is crucial for safe and expressive code.
It covers their declaration, unwrapping techniques (forced, optional binding, guard), nil coalescing, implicit unwrapping, optional chaining, comparison, collections, switch statements, and the underlying implementation.
Custom hover effects in SwiftUI
Learn how to add custom hover effects in SwiftUI, focusing on their use in visionOS, tvOS, and macOS. A step-by-step guide on creating these effects using the hoverEffect view modifier.
The key points include basic hover effects, custom effect creation, animation and delay, and the CustomHoverEffect protocol. It concludes with a practical example of a custom scale hover effect.
How to make ZStack content fully scrollable in a SwiftUI ScrollView
This post discusses how to make stacked content in a ZStack scrollable within a ScrollView. It also covers an issue where applying offsets to ZStack elements interferes with smooth scrolling.
Two solutions are presented:
- Using Paddings: Replace offsets with top paddings on each ZStack element. This increases the element size, allowing ScrollView to calculate the correct content size.
- Using Frames: Maintain offsets but manually set the ScrollView's frame to the sum of all element offsets and a single element's height.
Both methods ensure smooth scrolling through all ZStack content.
Apple News
Apple Entrepreneur Camp applications are now open
Apple Entrepreneur Camp is now accepting applications for underrepresented founders and developers. This program offers one-on-one code-level guidance, access to Apple experts, and networking opportunities.
Both in-person and online programs are available. Eligible entrepreneurs with app-driven businesses can apply today.
Price and tax updates for apps, In-App Purchases, and subscriptions
Apple is updating prices and taxes for apps, In-App Purchases, and subscriptions in several countries. Prices for apps and In-App Purchases will be updated in Chile, Laos, and Senegal.
Taxes will be introduced or increased in Laos, Senegal, India, and Canada. These changes are due to tax regulations and foreign exchange rate fluctuations. Developers can view and edit upcoming price changes in App Store Connect.
Other Cool Stuff
The AirDrop Conundrum: Passing Custom Models From and To Your App
This post highlights the challenges encountered when attempting to share custom data models between iOS apps via AirDrop.Due to recent changes in Apple's implementation, apps can no longer directly open received custom data, leading to a less user-friendly experience.
The author suggests a more intuitive solution, similar to macOS's ability to choose the opening app, would be beneficial for both developers and users. They emphasize the need for clearer documentation and a developer-friendly approach from Apple to enhance the overall AirDrop experience.
Scoring the aesthetics of an image with the Vision framework
Learn how to use the Vision framework to calculate the aesthetic score of an image in a SwiftUI app. The process involves creating a request, analyzing, and retrieving the results.
The overallScore and isUtility properties of the ImageAestheticsScoresObservation object provide valuable information about the image's aesthetic quality. This can be valuable for various purposes, such as curating photo galleries or suggesting visually appealing images to users.
In Case You Missed It
Mapping Coordinates on an Image in SwiftUI
This guide presents a solution for mapping coordinates from an image to a container view in SwiftUI. The approach involves calculating the scaling factor, identifying the clipping rect, and converting the coordinates accurately.
This approach is useful for applications requiring precise coordinate mapping, such as clothing size recommendation apps.
Videos
ZoomTransitions with iOS 18
This video tutorial introduces the zoomTransitions modifier in SwiftUI. It demonstrates how to use this modifier to create smooth zoom-in/zoom-out effects between views.
It covers practical examples, customization options, and additional tips for using the zoomTransitions effectively in SwiftUI projects.
Books
Modular Architecture on iOS and macOS [FREE]
This book covers the essentials of building a modular architecture on iOS, extendable to all Apple platforms. It includes examples of various approaches, framework types, pros and cons, and common issues.
By the end, you'll understand the benefits of modular architecture, its necessity, and the best approach for your project, with a focus on high-level architecture, modularisation, and efficient collaboration.