Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to macOS app #11

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,46 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/Tube Status">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077FB3C824B465DC00AAB327"
BuildableName = "watchOS WatchKit App.app"
BlueprintName = "watchOS WatchKit App"
ReferencedContainer = "container:TubeStatus.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</RemoteRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/Tube Status">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077FB3C824B465DC00AAB327"
BuildableName = "watchOS WatchKit App.app"
BlueprintName = "watchOS WatchKit App"
ReferencedContainer = "container:TubeStatus.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077FB3C824B465DC00AAB327"
BuildableName = "watchOS WatchKit App.app"
BlueprintName = "watchOS WatchKit App"
ReferencedContainer = "container:TubeStatus.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
13 changes: 11 additions & 2 deletions App/macOS/macOSApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,17 @@ struct MACOSApp: App {

var body: some Scene {
WindowGroup {
ScrollView { JourneyPlanner().padding(16) }
.frame(minWidth: 400, minHeight: 400)
TabView {
ScrollView {
ContentView(updates: viewModel.status, displayReason: true)
}.tabItem { Text("Status") }

ScrollView { JourneyPlanner().padding(16) }
.frame(minWidth: 400, minHeight: 400)
.tabItem { Text("Journey Planner") }
}
.padding(.top, 16)
.navigationTitle("Tube Status")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public final class JourneyPlannerViewModel: ObservableObject {
guard stations == nil else { return }
stationService
.getAllStations()
.print()
.receive(on: DispatchQueue.main)
.sink(receiveCompletion: { error in
print(error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import SwiftUI
import TFLAPI

struct ContentView: View {
public struct ContentView: View {
let updates: [LineStatusUpdate]?
let displayReason: Bool

init(updates: [LineStatusUpdate]?,
displayReason: Bool = false) {
public init(updates: [LineStatusUpdate]?,
displayReason: Bool = false) {
self.updates = updates
self.displayReason = displayReason
}

var body: some View {
public var body: some View {
VStack(alignment: .center, spacing: 0) {
if let updates = updates {
ForEach(updates) { update in
Expand Down