Initial scaffold: context-aware notes app for iOS + macOS
XcodeGen project (Notes / NotesMac / NotesTests), Swift 6 strict concurrency, iCloud-document storage via IndieSync with a SwiftData cache, automatic capture context (location, place, time zone, device) on every note, context-based relevance ranking with a 'Right here, right now' shelf, tags, search, and the square.and.pencil-on-red app icon.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
@Environment(SyncEngine.self) private var syncEngine
|
||||
|
||||
var body: some View {
|
||||
if syncEngine.iCloudStatus == .unavailable {
|
||||
ICloudGateView()
|
||||
} else {
|
||||
TabView {
|
||||
Tab("Notes", systemImage: "square.and.pencil") {
|
||||
NotesListView()
|
||||
}
|
||||
|
||||
Tab("Tags", systemImage: "tag") {
|
||||
TagsView()
|
||||
}
|
||||
|
||||
Tab("Settings", systemImage: "gearshape") {
|
||||
SettingsView()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import SwiftUI
|
||||
|
||||
/// Blocking screen when the ubiquity container can't be obtained. The app
|
||||
/// deliberately has no local-only fallback — notes written without iCloud
|
||||
/// would exist nowhere durable and be wiped by the next cache rebuild.
|
||||
struct ICloudGateView: View {
|
||||
@Environment(SyncEngine.self) private var syncEngine
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 16) {
|
||||
Image(systemName: "icloud.slash")
|
||||
.font(.system(size: 56))
|
||||
.foregroundStyle(.secondary)
|
||||
Text("iCloud Required")
|
||||
.font(.title2.bold())
|
||||
Text("Notes stores everything in your iCloud Drive so it's on all your devices. Sign in to iCloud and enable iCloud Drive for Notes in Settings, then try again.")
|
||||
.font(.callout)
|
||||
.foregroundStyle(.secondary)
|
||||
.multilineTextAlignment(.center)
|
||||
.frame(maxWidth: 420)
|
||||
Button("Try Again") {
|
||||
Task { await syncEngine.connect() }
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
.padding(32)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user