Wwdc 11

WWDC23 SwiftUI Q&A

Issue #918

Interesting SwiftUI Q&A during WWDC23

Observable vs ObservableObject

Q: With the new SwiftUI @Observable macro, are there any cases where ObservableObject would still be a better alternative?

A: Use ObservableObject when you need to …

What's new in SwiftUI iOS 17 at WWDC23

Issue #916

WWDC23 brings new additions to SwiftUI

Screenshot 2023-06-07 at 22 02 36

Scrolling

The scroll transition modifier is very similar to the visual effect modifier Curt used earlier for the welcome screen. It lets you apply effects to items in your scroll view.

I’m …

How to use actor in Swift concurrency

Issue #905

Protect mutable state with Swift actors

Actor reentrancy

abc

Imagine we have two different concurrent tasks trying to fetch the same image at the same time. The first sees that there is no cache entry, proceeds to start downloading the …

How Task use thread in Swift concurrency

Issue #904

Consider this code where we have an ObservableObject with fetch1 and async fetch2, and a fetch inside ContentView

Here the observation in Xcode 14

  • ViewModel.fetch1: run on main thread
  • ViewModel.fetch2: run on cooperative thread pool …

My favorite WWDC videos

Issue #891

Below are my favorite WWDC videos. My focus is to use SwiftUI to make useful apps with great UX. I don’t pay much attention to new frameworks as they come and go, but the underlying reasons and design principles are worth …

WWDC swiftui-lounge

Issue #890

In WWDC21, WWDC22 Apple provide a Slack channel https://wwdc22.slack.com/ for people to interact with Apple engineers in digital lounges. Here I note down some interesting Q&As

WWDC22

What’s the difference between a custom ViewModifier …

WWDC22 SwiftUI Q&A

Issue #890

Interesting SwiftUI Q&A during WWDC22

What’s the difference between a custom ViewModifier vs View extension

Q: What’s the difference between a custom ViewModifier (without DynamicProperty) that uses some built-in modifiers in …

What's new in SwiftUI iOS 16 at WWDC22

Issue #889

asda

What’s new in SwiftUI

New EnvironmentValues

abc

TextField inside Alert

abc

List uses UICollectionView

See gist https://gist.github.com/onmyway133/fc08111964984ef544a176a6e9806c18

abc

ButtonStyle composition

Screenshot 2022-06-09 at 10 25 30
Section("Hashtags") { …

How to use any vs some in Swift

Issue #888

Embrace Swift generics

This generic pattern is really common, so there’s a simpler way to express it. Instead of writing a type parameter explicitly, we can express this abstract type in terms of the protocol conformance by writing …

Favorite WWDC 2017 sessions

Issue #56

  1. Introducing Core ML
  • Core ML
  1. Introducing ARKit: Augmented Reality for iOS
  • ARKit
  1. What’s New in Swift
  • String
  • Generic
  • Codable
  1. Advanced Animations with UIKit
  • Multiple animation
  • Interactive animation …