mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Create rough app outline
This commit is contained in:
15
Multiplatform/Shared/AppModel.swift
Normal file
15
Multiplatform/Shared/AppModel.swift
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// AppModel.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 6/28/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
final class SceneModel {
|
||||
|
||||
var sidebarModel = SidebarModel()
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// ContentView.swift
|
||||
// Shared
|
||||
//
|
||||
// Created by Maurice Parker on 6/27/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
var body: some View {
|
||||
Text("Hello, world!").padding()
|
||||
}
|
||||
}
|
||||
|
||||
struct ContentView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
40
Multiplatform/Shared/NavigationView.swift
Normal file
40
Multiplatform/Shared/NavigationView.swift
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// NavigationView.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 6/28/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct SceneNavigationView: View {
|
||||
var body: some View {
|
||||
SceneNavigationView {
|
||||
Text("Hello")
|
||||
// #if os(macOS)
|
||||
// SidebarView().frame(minWidth: 100, idealWidth: 150, maxWidth: 200, maxHeight: .infinity)
|
||||
// #else
|
||||
// SidebarView()
|
||||
// #endif
|
||||
//
|
||||
// Text("Timeline")
|
||||
// .frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
//
|
||||
// #if os(macOS)
|
||||
// Text("None Selected")
|
||||
// .frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
// .toolbar { Spacer() }
|
||||
// #else
|
||||
// Text("None Selected")
|
||||
// .frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct NavigationView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SceneNavigationView()
|
||||
}
|
||||
}
|
||||
@@ -18,9 +18,21 @@ struct NetNewsWire: App {
|
||||
@UIApplicationDelegateAdaptor(AppDelegate.self) private var delegate
|
||||
#endif
|
||||
|
||||
@StateObject private var sceneModel = SceneModel()
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
#if os(macOS)
|
||||
SceneNavigationView()
|
||||
.frame(minWidth: 600, idealWidth: 1000, maxWidth: .infinity, minHeight: 600, idealHeight: 700, maxHeight: .infinity)
|
||||
.environmentObject(sceneModel)
|
||||
#endif
|
||||
|
||||
#if os(iOS)
|
||||
SceneNavigationView()
|
||||
.environmentObject(sceneModel)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
15
Multiplatform/Shared/SceneModel.swift
Normal file
15
Multiplatform/Shared/SceneModel.swift
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// SceneModel.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 6/28/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
final class SceneModel: ObservableObject {
|
||||
|
||||
var sidebarModel: SidebarModel?
|
||||
|
||||
}
|
||||
39
Multiplatform/Shared/SceneNavigationView.swift
Normal file
39
Multiplatform/Shared/SceneNavigationView.swift
Normal file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// SceneNavigationView.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 6/28/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct SceneNavigationView: View {
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
#if os(macOS)
|
||||
SidebarView().frame(minWidth: 100, idealWidth: 150, maxWidth: 200, maxHeight: .infinity)
|
||||
#else
|
||||
SidebarView()
|
||||
#endif
|
||||
|
||||
Text("Timeline")
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
|
||||
#if os(macOS)
|
||||
Text("None Selected")
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.toolbar { Spacer() }
|
||||
#else
|
||||
Text("None Selected")
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct NavigationView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SceneNavigationView()
|
||||
}
|
||||
}
|
||||
13
Multiplatform/Shared/Sidebar/SidebarModel.swift
Normal file
13
Multiplatform/Shared/Sidebar/SidebarModel.swift
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// SidebarModel.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 6/28/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
class SidebarModel: ObservableObject {
|
||||
|
||||
}
|
||||
21
Multiplatform/Shared/Sidebar/SidebarView.swift
Normal file
21
Multiplatform/Shared/Sidebar/SidebarView.swift
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// SidebarView.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 6/28/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct SidebarView: View {
|
||||
var body: some View {
|
||||
Text("Sidebar View")
|
||||
}
|
||||
}
|
||||
|
||||
struct SidebarView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SidebarView()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user