Welcome to another issue!
I need your help! π
As you remember, I changed the name of the newsletter last time. Now it's called "Those Who Swift".
However, I do not have any new design elements like a logo or banner. Here I need your help.
- If you are a designer, please contact me if you are interested in helping me with a few design elements. I would be happy to hire you.
- Feel free to send me any ideas you have on how a new logo could look.
I appreciate your help and let's dive in!
Subscribe to another newsletter I run!
3250 subscribers already! π
Weekly newsletter featuring the best tools for iOS developers. Subscribe if you like @iOS developers
Swift Around the Web
Swift 6 New Features
Apple is planning to release Swift 6 in September 2024, alongside Xcode 16. This will be the first major Swift update in five years since Swift 5. This release will be on the 10th anniversary of Swift.
In this blog post, they have given a quick recap to the evolution of Swift 5.x versions over the years.
And Focus on Swift 6 upcoming features:
- User-defined macros as caller-side arguments
- Pack iteration for generic functions
- Tuples conforming to Equatable, Comparable, and Hashable
- Typed throws for error handling with concrete error types
They also highlighted the importance of migrating to Swift for a future-proof development approach.
Coding
How to build a draggable bottom sheet with a scroll view in SwiftUI
This blog post teaches you to create a draggable bottom sheet with a scroll view, similar to those found in Apple Maps or Google Maps.
It leverages SwiftUI's sheet combined with presentationDetents including state management, swipe dismissal prevention, state configuration, and background interaction handling.
Key Features:
- Multiple sheet states (collapsed, medium, expanded)
- Seamless interaction with both sheet content and parent view
- Integrated dragging for smooth content exploration
Benefits:
- Simple code implementation for complex functionality
Downsides:
- Sheets cover the entire view hierarchy, including tab bars (no current workaround within SwiftUI sheets).
With their given example we can achieve complex functionality with concise SwiftUI code simple and effectively.
How to link to native type extensions in DocC
This blog post explores how Xcode 15's improved DocC capabilities enhance documentation for Swift developers. The key takeaway is the ability to link directly to native type extensions, a feature absent in previous versions.
Benefits of DocC:
- Clearer documentation with easy access to extended types.
- Compile-time warnings prevent outdated references.
Xcode 15 DocC Enhancements:
- Metadata for page descriptions, interactive tabs and grids.
- Support for showing and linking to native type extensions.
Overall, DocC's new linking features empower developers to create more user-friendly and up-to-date documentation.
SubscriptionStoreView for iOS apps
This blog post explores Apple's built-in SubscriptionStoreView introduced in iOS 17 for managing subscriptions within your app. It highlights the benefits of using this pre-built view compared to creating a custom solution from scratch.
It lets you easily add in-app subscriptions to your app, complete with product ID configuration and customization options. Plus, it keeps you updated on subscription changes, allowing you to focus on what matters most - creating a great app experience for your users.
It explains how to observe subscription changes using Transaction objects and update your app's UI accordingly and how to observe subscription changes using Transaction objects and update your app's UI accordingly.
visionOS
Swift/VisionOS: Handling Multiple Windows
This blog post explores how to effectively manage multiple windows in your VisionOS app.
It provides a code example showcasing a MainView that opens two child views in separate windows upon button clicks. Each child view has a dismiss button to close its own window.
Benefits of Multi-Window Apps:
- Enhanced User Experience: Create a more interactive and engaging environment for your VisionOS users.
- Simplified Management: Streamlined window management with clear SwiftUI functions and environment variables.
By incorporating the exampleβs steps, you can unlock the potential of multiple windows and elevate the user experience of your VisionOS applications.
Apple News
Updates to app distribution in the European Union
In response to developer feedback, Apple has revised the Alternative Terms Addendum for EU apps. This update offers developers increased flexibility and reduced risk when participating in the EU App Store changes mandated by the Digital Markets Act (DMA).
Key changes are:
- No longer requires signing for each subsidiary within a company.
- Allows developers to switch back to standard terms under specific circumstances.
- New way to qualify for creating alternative app marketplaces.
Other Cool Stuff
Guide to Naming SwiftUI Components
This blog post offers a simple yet powerful way to improve your SwiftUI code readability: ditch the generic "View" suffix!
The Problem: Ever find yourself constantly opening files just to understand their purpose based on a name like "TransactionView"?
The Solution: Replace the "View" suffix with the actual root view used within the component. This creates descriptive names like "TransactionCategoryImage" or "TransactionCostLabel".
By adopting this simple practice, you'll write cleaner, more maintainable SwiftUI code that's easier for you and others to understand.
Make a SwiftUI App with In-App Purchases and Subscriptions using StoreKit 2
This blog post guides you through implementing in-app purchases and subscriptions using StoreKit 2 in a SwiftUI app.
Key takeaways:
- Use StoreKit 2 for modern IAP in your iOS/iPadOS apps.
- Define purchasable items in a StoreKit configuration file.
- Fetch products and verify purchases before updating your app's state.
- Listen for transaction updates to handle things like renewals.
- Restore purchases and create informative renewal strings for subscriptions.
The API is precise, modern and easy to use. StoreKit 2 has come a long way from Apple's initial StoreKit APIs, and you can even use them together with StoreKit 2.
In Case You Missed It
Swift Macros
Swift Macros have brought in a new wave of possibilities. This project aims to curate a list of community-created Macros and associated learning resources.
This repository has a curated list of awesome Swift Macros with some outstanding example repos and documentation links.
It includes Tools, Frameworks, Apple, and Community Blogs types of references.