Welcome to another issue!
Last week, I asked you for help with the logo and other design elements. It surprised me how many people responded. Thank you! π
There were some of you who offered their help, even sending me made-up banners and logos. Which is wow! π€―
Next week everything should be ready and I will share it with you!
I'm super happy that this community is super helpful to me and always responds.
If you need help or want to share something in this newsletter feel free to reply to this email. I'm always ready to help! π€
Subscribe to another newsletter I run!
3285 subscribers already! π
Weekly newsletter featuring the best tools for iOS developers. Subscribe if you like @iOS developers
Swift Around the Web
Nerdy internals of an Apple text editor
This article explores how Apple's Paper text editor works.
Paper leverages Apple's TextKit framework for text handling, but with a clever twist. It keeps formatting (bold, italics) separate from the underlying structure (headings, quotes) for features like easy navigation and format conversion.
The article also explores Paper's handling of different text formats, including challenges with less common ones like Markdown, and how it optimizes performance during editing.
Sending trial notifications with provisional authorization on iOS
Key problem: Getting user permission for notifications can be difficult.
Solution: Apple's provisional authorization allows silent notifications to the Notification Center, letting users experience their value before deciding to opt-in fully.
Implementation:
- Request provisional authorization using UNUserNotificationCenter.current().requestAuthorization.
- Schedule notifications (local or remote) to showcase their usefulness. (Example provided for local notifications).
Benefit:
- Improved user engagement by gently introducing notifications.
- Respectful approach to user preferences.
Coding
Identifiable protocol in SwiftUI explained with code examples
Identifiable protocoles lets SwiftUI uniquely identify objects in a collection (like ForEach) for proper rendering and updates. SwiftUI needs IDs to redraw views when data changes. Using the wrong ID can cause bugs (e.g., showing duplicate items).
It shows 2 key best practices:
- Use structs, not classes, for data with unique identities.
- Choose a truly unique property as the ID (e.g., a dedicated post ID).
It ultimately avoids unexpected behavior and ensures SwiftUI can efficiently manage your data collections.
Prompt to code in Xcode with Claude 3
While Xcode lacks a Copilot yet, this blog offers a solution! It guides you through building an Xcode extension that leverages Claude 3, a powerful AI model.
Key takeaways:
- Integrate AI in Xcode: Learn to set up an extension within a macOS app to access your code.
- Generate code with prompts: Send code snippets to Claude 3 with clear instructions for desired functionality.
- Master prompting techniques: Discover how to craft effective prompts to optimize AI-generated code.
- Seamless integration: Explore how to incorporate the generated code back into your project.
- Additional resources: Find references for further learning on Xcode extensions and prompting techniques.
Automating SwiftUI accessibility audits in Xcode 15
Accessibility is a crucial aspect in the development and design of iOS apps; itβs about creating inclusive and universally usable digital products.
It ensures that all users, regardless of their abilities or disabilities, can access and benefit from apps. This includes people with visual, hearing, motor, and cognitive disabilities and those who may experience temporary impairments.
This blog highlights the new performAccessibilityAudit feature in Xcode 15 for SwiftUI apps. It emphasizes the importance of accessibility for inclusivity and user experience.
This helps developers ensure apps are inclusive by automatically identifying issues like contrast and hit area size. Detailed reports guide developers in fixing these problems, making accessible app development easier.
visionOS
Migrating SwiftUI App to VisionOS in 2 Hours
An interesting article about migrating a SwiftUI app to visionOS in just 2 hours!
Here's the gist of it:
- Update third-party frameworks (or fork them) for visionOS compatibility.
- Test thoroughly: fix app icon, hover effects, layouts, and colors (brighter for visionOS).
- Reuse existing iPadOS/macOS SwiftUI code if possible.
- You can migrate your app in just a few hours with good planning!
This article offers a helpful roadmap for developers who want to migrate their SwiftUI apps to visionOS.
Other Cool Stuff
π§ Anders Borum - creator of the most popular git client "Working Copy"
Working Copy is a powerful git client in the App store. You can actually make code changes from your phone. Fix merge conflicts etc.
Why you will like it:
- Built by an indie developer who has been working on it for 10+ years.
- Even if you don't want to write code from your phone every day, it's great to have in an emergency.
- Working Copy has 2,900 ratings with a 4.9 star average.
If you're curious on the story of how Anders created Working Copy listen the episode.
Videos
Animated Onboarding UI In SwiftUI
In this video, they have explored how to implement an Animated Onboarding UI View in SwiftUI.
They have designed a single-screen UI with a left panel using some @ViewBuilder views.
Using the interpolatingSpring animation they created a cool slide animation.
Getting Started With The Observation Framework In SwiftUI
This Observation Framework changes the way that we think about Data Flow in SwiftUI. They have added new additions to this framework such as the @Observable macro which changes the way we model our data in SwiftUI.
The goals of this course is to help us to understand how to use the new @Observable macro, migrate an existing app to use the Observation Framework, tackle working with the Environment, AppStorage, understanding Bindable vs Binding and working with Swift Concurrency alongside the Observation Framework.
Books
Integrating SwiftUI into UIKit Apps
A detailed guide on gradually adopting SwiftUI in UIKit projects.
- Discover all the possible ways to add SwiftUI views to an existing UIKit app.
- See how fast you can develop new components in SwiftUI and preview them instantly in Xcode canvas.
- Take your existing apps to the next level by adding new iOS 16 features, such as Swift Charts and Lock Screen widgets.
- Learn how to keep supporting older iOS versions at the same time Migrate larger parts of your apps to SwiftUI while reusing views and controllers built in UIKit.
- Take advantage of the new iOS 17 APIs to bridge state between UIKit and SwiftUI.