declared types on all views, trying to make a nice mac app

This commit is contained in:
neon443 committed 2025-05-21 17:02:21 +01:00
1 parent 4bf33d50d6
commit e051d73b7e
11 files changed
+377 -74

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
//
// Extension.swift
// NearFuture
//
// Created by neon443 on 21/05/2025.
//
import Foundation
import SwiftUI
extension View {
var backgroundGradient: some View {
return LinearGradient(
gradient: Gradient(colors: [.bgTop, .two]),
startPoint: .top,
endPoint: .bottom
)
.ignoresSafeArea(.all)
}
func apply<V: View>(@ViewBuilder _ block: (Self) -> V) -> V { block(self) }
}
extension AnyTransition {
static var moveAndFade: AnyTransition {
.asymmetric(
insertion: .move(edge: .leading),
removal: .move(edge: .trailing)
)
.combined(with: .opacity)
}
static var moveAndFadeReversed: AnyTransition {
.asymmetric(
insertion: .move(edge: .trailing),
removal: .move(edge: .leading)
)
.combined(with: .opacity)
}
}
-13
View File
@@ -10,18 +10,6 @@ import SwiftData
@main
struct NearFutureApp: App {
// var sharedModelContainer: ModelContainer = {
// let schema = Schema([
// Item.self,
// ])
// let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
//
// do {
// return try ModelContainer(for: schema, configurations: [modelConfiguration])
// } catch {
// fatalError("Could not create ModelContainer: \(error)")
// }
// }()
@StateObject var settingsModel: SettingsViewModel = SettingsViewModel()
var body: some Scene {
WindowGroup {
@@ -31,6 +19,5 @@ struct NearFutureApp: App {
)
.tint(settingsModel.settings.tint.color)
}
// .modelContainer(sharedModelContainer)
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.