13, 14
- 13: Publisher, CloudKit, CoreData
- 14: App Architecture, Document Architecture, Undo
Publisher
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 取得 Publisher (subscription)
- Publisher 設定
.map(_:)
改變產物
.receive(on: DispatchQueue.main)
- Publisher 資料接收
.sink(receiveValue:)
處理產出的資料
- Cancellable 保存與使用
Publisher 有很多 method 很像 array 的 method,.map(_:)
- URLSession
- Timer
- NotificationCenter
CoreData
- @ObservedObject
- @FetchRequest
App Architecture
App
protocol
Scene
protocol
- WindowGroup { }
- DocumentGroup(newDocument:) { }
- DocumentGroup(viewing:) { }
@SenceStorage
@AppStorage
@ScaledMetric
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 被存在
UserDefaults.standard
7:48 Code
app icon -> Asset.xcassets
19:56 RawRepresentable
每次開啟 app 後 load backgroundImage 完成又去 zoomToFit
28:02 Document Architecture
- FileDocument
- ReferenceFileDocument
- UTType
- Document Types
- 39:05 Undo
43:14 Back To Code
- 49:50 讓 ViewModel conform to
ReferenceFileDocument
- 1:02:16 undo imple
- 1:12:01 support document
https://github.com/skkimeo/CS193p-Spring-2021