Welcome to another issue!
Subscribe to iOS Dev Jobs! 👇
Hello! 👋
In the past week, more than 300 people have subscribed to my newsletter - iOS Dev Jobs
I will send out the first issue on Sunday. You can still subscribe if you haven't yet. Just click the button below.
I appreciate your support and let's dive into this week's news! 👇
Sponsored Link
GetStream - Start Coding for Free with Stream’s Video & Audio API!
Ready to integrate Zoom/Whatsapp style video experience into your iOS application? Learn how Stream’s Video API can help you get started.
With pre-built Stream libraries and components, you can build in-app video calling in just days.
**Try now!
Swift Around the Web
How to profile your app's performance and Main Thread usage with Instruments and os_signposts
Instruments - a tool from Xcode, explores to profile your app's performance and identify areas for improvement. It focuses on using the Time Profiler instrument to analyze Main Thread usage, a crucial factor in a smooth user experience.
Key Points:
- Identify bottlenecks with the Time Profiler instrument.
- Analyze thread usage to pinpoint high CPU usage.
- Optimize code impacting responsiveness.
Ultimately, it enhances the app's responsiveness, fixes code causing lags or freezes and gains insights for focused optimization.
Coding
Fix Xcode losing references to downloaded Simulator runtimes
This post addresses a recent issue where Xcode forgets downloaded simulator runtimes (iOS versions used for testing).
The Problem:
- Recent Xcode versions manage runtimes differently, requiring separate downloads.
- Sometimes, Xcode fails to recognize mounted runtimes, forcing re-downloads.
The Fix (Apple's Solution):
- Download the latest XProtect update to prevent it from mistakenly quarantining simulator runtimes.
Configurable button with different states in SwiftUI
Create a reusable button with various states and designs in SwiftUI. It's ideal for scenarios like a "claim coupon" button that changes appearance based on network call progress:
- Normal: Initial default state.
- Loading: Displays a progress indicator while processing.
- Confirmed: Shows success with a checkmark icon.
- Disabled: Grayscale appearance indicating completion or error.
This approach promotes code reusability and simplifies managing button states in the SwiftUI applications.
The Sound of Software
A post argues that sound design is often neglected in software creation, leading to repetitive and annoying experiences. It explores the power of sound to enhance usability and user experience.
Get started easily:
- Use sound libraries or record your own sounds.
- Edit with basic audio tools.
Craft engaging sound:
- Avoid repetition: Use variations for a pleasant experience.
- Layer sounds: Combine recordings, instruments, etc. for depth.
- Pair with haptics for a richer experience.
Sound design transforms bland software into experiences that truly resonate with users.
Design
SwiftUI: Rotation Effect and Orbit Animation 2D
The post explores creating dynamic 2D rotation animations and orbit effects in SwiftUI using the rotationEffect modifier.
Key Techniques:
- Rotate views around their center.
- Control rotation points within the view.
- Achieve orbit effects by placing elements in a ZStack and rotating the entire stack.
Other Cool Stuff
Challenges When Re-using SwiftUI Cells in a UITableView
A potential pitfall of using SwiftUI views directly within UIKit's UITableView cells introduced in iOS 16. While convenient, it can lead to unexpected behavior due to how SwiftUI handles cell reuse.
- UITableView cells reuse can cause issues when displaying SwiftUI content.
- Reused TableView cells lack the IDs., leading to confusion for SwiftUI.
- This confusion can manifest as incorrect images displaying briefly before the image loads, or unwanted cell animations.
Setting an ID on the SwiftUI view within the cell explicitly tells SwiftUI about the new data item, preventing these glitches.
In Case You Missed It
What’s the difference between any and Any?
Clarifies the difference between any (lowercase) and Any (uppercase) in Swift.
any: Used with protocols for properties holding types conforming to that protocol. It might become mandatory for runtime checks, impacting performance.
Any: Represents a type for any possible value (String, Int, etc.). It loses type information and requires runtime casting, making it bad practice.
Example: any for a network service property with protocol conformance, Any for an array holding various data types.
Videos
VisionOS 3D content in SwiftUI
This video tutorial guides you through creating a visionOS app with 3D content in windows, volumes, and immersive spaces. It focuses on Spline, a no-code tool for:
- Easily design and modify 3D elements for your app.
- Seamlessly integrate 3D content into your visionOS app using SwiftUI code generated by Spline.
- Spline's renderer leverages Apple device’s graphics acceleration for smooth visuals.
By learning Spline, iOS developers gain valuable skills for building immersive 3D experiences in the world of spatial computing with Apple Vision Pro.
Developing An Inclusive Mindset
The concept of developing an "Inclusive Mindset" in product design explained by this video. The speaker, a product designer, emphasizes the importance of creating software that is comfortable and useful for a wide range of users.
Key Takeaways: - Importance of an inclusive mindset in product design. - Building software for a broad spectrum of users. - Practical examples from the development of Pedometer++.