Files
NetNewsWire/Technotes/SwiftUI-UIKit-AppKit-Guidelines.markdown
T

15 lines
560 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# When to use SwiftUI, UIKit, and AppKit
## iOS
Use SwiftUI when possible. There are two cases where you should use UIKit instead:
1. When scrolling performance matters — the timeline, in other words, should not use SwiftUI
2. When SwiftUI can’t provide the user experience we want
## macOS
Use AppKit and .xib files. Avoid SwiftUI. Avoid storyboard files too — use .xib files.
Use Auto Layout in .xib files. Avoid writing Auto Layout constraints in code (sometimes it’s inevitable: if so, use `needsUpdateConstraints` and `updateConstraints`).