Swift

494 readers
1 users here now

This group focus on the content related to the development of Apple Eco-system software. So feel free to share and talk about, for example;

founded 2 years ago
MODERATORS
51
 
 

Text is heavily used in SwiftUI. Compared to its counterparts in UIKit/AppKit, Text requires no configuration and works out of the box, but this also means developers lose more control over it. In this article, I will demonstrate through a real-world case study how to accomplish seemingly “impossible” tasks with SwiftUI’s approach: finding the first view among a given set where text is not truncated, and using it as the required size.

52
 
 

Fatbobman’s Swift Weekly #092 is out! High Temperatures and Strange Atmospheric Phenomena

  • 🌟 My Month with Claude Code
  • ⏰ Schedule a Countdown Timer with AlarmKit
  • 📱 Using the Swift Android SDK
  • 🔎 Improving SwiftUI Performance

and more...

53
 
 

Swift’s Multi-Platform Strategy Requires Collective Effort

  • ⭐ NotificationCenter.Message
  • 🚀 Xcode’s Coding Intelligence Prompt
  • 🔐 Memory Efficiency in iOS

and more...

54
55
 
 

NotificationCenter has long been a staple of iOS development, offering developers a flexible broadcast–subscribe mechanism. However, as Swift’s concurrency model has advanced, the traditional approach—using string-based identifiers and a userInfo dictionary—has revealed several pitfalls: thread-safety hazards, silent typos, and unsafe type casts. These issues often only surface at runtime.

To eliminate these pain points, Swift 6.2 introduces a brand-new, concurrency-safe notification protocols in Foundation: NotificationCenter.MainActorMessage and NotificationCenter.AsyncMessage. Leveraging Swift’s type system and concurrency isolation, it validates both posting and observing at compile time, completely eradicating common problems like “wrong thread” or “payload type mismatch.”

56
 
 

Fatbobman’s Swift Weekly #090 is out! You Only Realize Its Value Once It’s Gone

  • 🔍 layoutPriority in SwiftUI ZStack
  • 🚀 Exploring the Limits of On-Device AI
  • 📈 Exploring a New Visual Language: Liquid Glass
  • 🧩 What's New in SwiftUI for iOS 26

and more...

57
 
 

In SwiftUI’s layout system, the .layoutPriority modifier might seem inconspicuous at first glance, yet it can decisively influence a view’s size allocation when it matters most. Most developers know its “magic”—in a VStack or HStack, a higher priority view will fight for more space when things get cramped. But did you realize that .layoutPriority can work wonders in a ZStack too? Its behavior there is entirely different from VStack and HStack. In this article, we’ll dive deep into this little-known feature and show you how to harness layout priority inside a ZStack.

58
 
 

Fatbobman’s Swift Weekly #089 is out! WWDC 2025: A Return to Pragmatism

  • ✨ A (Re-)Introduction to ExtensionKit
  • 🌌 SwiftData vs SQL Query Builder
  • 🌊 llm .codes : Make Apple Docs AI-Readable
  • 🎶 Dragula : Drag-and-Drop Solution for SwiftUI

and more...

59
 
 

WWDC 2025 introduced a host of eye-catching new features and APIs. In this special issue, we’ve handpicked high-value analysis articles, practical tools, and key takeaways from the developer community to help you quickly master the essentials of these new capabilities. Content will continue to be updated through the end of the week.

60
 
 

WWDC 2025 arrived right on schedule. Apple released all session videos at once, allowing developers to dive into the new features and APIs they care about without delay. After skimming through them over the past two days, my initial takeaway for this year’s conference is: as expected, yet unexpected.

61
62
 
 

Fatbobman’s Swift Weekly #087 is out!

Swift: New Design, New Case Study, New Experience

  • 🌟 Notepad.exe: A Lightweight Swift Code Editor
  • 🌠 WWDC 2025 Wish List Roundup
  • 🎵 DataScout for SwiftData

and more...

63
 
 

cross-posted from: https://programming.dev/post/31627972

The internet keeps telling me that they go in the model, but some developers tell me that it goes in the view model

Model (Data / Networking / Algorithms) objects represent special knowledge and expertise. They hold an application’s data and define the logic that manipulates that data.
https://developer.apple.com/forums/thread/699003

Therefore, the model can be thought of as representing the app's domain model, which usually includes a data model along with business and validation logic.
https://learn.microsoft.com/en-us/dotnet/architecture/maui/mvvm

Model: Contains the data or the business logic. Any changes in data are communicated to the ViewModel.
https://medium.com/@dilipp817/understanding-mvvm-architecture-a-beginners-guide-to-model-view-viewmodel-8fb05c285710

The Model's purpose is to represent (or model) your business domain. Therefore, business logic by definition goes in the Model, not the ViewModel.https://developer.apple.com/forums/thread/699003
https://stackoverflow.com/questions/37671866/should-i-implement-business-logic-on-a-model-or-a-viewmodel

Even though the vast majority of business logic is present in the data layer, the UI layer can also contain business logic. This can be the case when combining data from multiple repositories to create the screen UI state, or when a particular type of data doesn't require a data layer.\

ViewModel is the right place to handle business logic in the UI layer. The ViewModel is also in charge of handling events and delegating them to other layers of the hierarchy when business logic needs to be applied to modify application data.
https://developer.android.com/topic/libraries/architecture/viewmodel

64
65
 
 

Xcode Playgrounds has strayed from its original purpose, and VSCode can be too complex for beginners. So, how can we set up a simple Swift learning environment? Notepad.exe might just be the solution.

66
 
 

Fatbobman’s Swift Weekly #086 is out! Arc, Dia, TCA and SwiftUI

  • ✨ Swift 6 Refactoring in a Camera App
  • 🌌 Making Your iOS App More Accessible with Dynamic Type
  • 🚀 SkyLightWindow
  • 🔒 Forming an Opinion on SwiftUI Forms

... and more

67
 
 

Have You Registered for WWDC 2025 Group Labs Yet?

  • ✨ Experience the Charm of Swift
  • 🌌 Apple Developer Relations
  • 🤚 Creating Xcode Source Editor Extensions
  • 📊 Mesh Gradients in SwiftUI
  • and more...
68
 
 

Use Swift’s generics, KeyPath, protocol extensions, and ResultBuilder to build a type-safe DataFrame export tool with TabularData. Dive into column mapping, conditional logic, and clean DSL syntax for maximum flexibility

69
 
 

Fatbobman’s Swift Weekly #084 is out!

Awaiting WWDC 2025 with Serenity

  • ✨ SwiftUI’s .ignoredByLayout()
  • 🌌 Picker With Optional Selection
  • 🤚 Don't Save SQLite in App Group Container
  • 📊 Default isolation with Swift 6.2

and more...

70
 
 

Publication croisée depuis https://programming.dev/post/30462189

71
 
 

Among SwiftUI’s many APIs, .ignoredByLayout() is something of an “understated member.” Information is scarce, usage scenarios are uncommon, and its very name tends to raise questions. It seems to suggest some kind of “ignoring” of the layout—but how does that differ from modifiers like offset or scaleEffect, which by default don’t affect their parent’s layout? When does ignoredByLayout actually come into play, and what exactly does it “ignore” or “hide”? In this article, we’ll lift the veil on this subtle API in SwiftUI’s layout mechanism.

72
 
 

Don't Let Vibe Coding Hinder Your Technical Growth

Fatbobman’s Swift Weekly #083 is out!

  • 📏 A Complete Guide to Swift Measurement
  • 🔒 SwiftUI View Model Ownership
  • 🍫 Cocoa Basics
  • 🖥️ xtool - Cross-platform alternative to Xcode

and more...

73
 
 

In everyday life we constantly convert values between different units of measurement. For developers this seems easy—write a few formulas, sprinkle in a couple of switch statements and you’re done. But the moment you try to support dozens of units, seamless internationalisation, formatting, precision and rounding, the workload sky-rockets and the drudgery can make you question your life choices. The good news: starting with iOS 10 Apple added a comprehensive Measurement API to Foundation, taking all that “donkey work” off our hands. This article walks you through its usage and best practices.

74
 
 

Apple Pays the Price for Its Arrogance

Fatbobman’s Swift Weekly #082 is out!

  • 🍏 Using equatable() in SwiftUI
  • 🆕 What's New in Swift 6.1
  • 🔒 Mutex in Swift
  • 🎨 Convert VS Code Themes to Xcode

…and more

75
 
 

NavigationLink is a component SwiftUI developers love. By ingeniously combining the behavior of Button with navigation logic, it dramatically simplifies code. Unfortunately, in certain scenarios, using it the wrong way can create serious performance issues and make your app sluggish. This article analyzes the cause of the problem and offers a practical—albeit slightly mysterious—solution: adding the equatable() modifier to optimize performance.

view more: ‹ prev next ›