Skip to content
Closed
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
173 changes: 163 additions & 10 deletions Uplift.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1610"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions Uplift.xcodeproj/xcshareddata/xcschemes/Uplift.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1610"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -43,7 +43,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
13 changes: 13 additions & 0 deletions Uplift/Configs/UpliftEnvironment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ enum UpliftEnvironment {
static let announcementsHost = "ANNOUNCEMENTS_HOST"
static let announcementsPath = "ANNOUNCEMENTS_PATH"
static let announcementsScheme = "ANNOUNCEMENTS_SCHEME"

static let googleClientID = googleServiceDict["CLIENT_ID"] as? String ?? ""
}

/// A dictionary storing key-value pairs from Info.plist.
Expand All @@ -32,6 +34,17 @@ enum UpliftEnvironment {
return dict
}()

/// An NSDictionary storing key-value pairs from GoogleService-Info.plist.
private static let googleServiceDict: NSDictionary = {
guard let path = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist") else {
fatalError("Path for GoogleService-Info invalid")
}
guard let myDict = NSDictionary(contentsOfFile: path) else {
fatalError("GoogleService-Info.plist not found")
}
return myDict
}()

/**
The base URL of Uplift's backend server.

Expand Down
57 changes: 45 additions & 12 deletions Uplift/Core/UpliftApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import FirebaseCore
import GoogleSignIn
import SwiftUI

@main
Expand All @@ -16,27 +17,59 @@ struct UpliftApp: App {

@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
@StateObject var locationManager = LocationManager.shared
@StateObject private var mainViewModel = MainView.ViewModel()

// MARK: - UI

var body: some Scene {
WindowGroup {
MainView()
.environmentObject(locationManager)
.onAppear {
locationManager.requestLocation()
NavigationStack {
ZStack {
(mainViewModel.showSignInView) ? (
SignInView()
.environmentObject(mainViewModel)
.onOpenURL { url in
GIDSignIn.sharedInstance.handle(url)
}
) : nil

(mainViewModel.showCreateProfileView) ? (
CreateProfileView()
.environmentObject(mainViewModel)
) : nil

(mainViewModel.showMainView) ? (
MainView()
.environmentObject(locationManager)
.onAppear {
locationManager.requestLocation()
}
) : nil
}
}
}
}

}
class AppDelegate: NSObject, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FirebaseApp.configure()
GIDSignIn.sharedInstance.restorePreviousSignIn { user, error in
if error != nil || user == nil {
// TODO: - Show the app's signed-out state.
} else {
// TODO: - Show the app's signed-in state.
}
}
return true
}

class AppDelegate: NSObject, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
FirebaseApp.configure()
return true
func application(_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
GIDSignIn.sharedInstance.handle(url)
}
}
}
33 changes: 23 additions & 10 deletions Uplift/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,31 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>ANNOUNCEMENTS_PATH</key>
<string>$(ANNOUNCEMENTS_PATH)</string>
<key>ANNOUNCEMENTS_HOST</key>
<string>$(ANNOUNCEMENTS_HOST)</string>
<key>ANNOUNCEMENTS_COMMON_PATH</key>
<string>$(ANNOUNCEMENTS_COMMON_PATH)</string>
<key>ANNOUNCEMENTS_HOST</key>
<string>$(ANNOUNCEMENTS_HOST)</string>
<key>ANNOUNCEMENTS_PATH</key>
<string>$(ANNOUNCEMENTS_PATH)</string>
<key>ANNOUNCEMENTS_SCHEME</key>
<string>$(ANNOUNCEMENTS_SCHEME)</string>
<key>CFBundleIconName</key>
<string>AppIcon</string>
<key>UPLIFT_DEV_URL</key>
<string>$(UPLIFT_DEV_URL)</string>
<key>UPLIFT_PROD_URL</key>
<string>$(UPLIFT_PROD_URL)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.cornellappdev.uplift.ios</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.207564484616-0tm2dfijhhehimopfcg8bh1k92r3h4e8</string>
</array>
</dict>
</array>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>UIAppFonts</key>
<array>
<string>BebasNeue-Regular.ttf</string>
Expand All @@ -27,5 +36,9 @@
<string>Montserrat-Regular.ttf</string>
<string>Montserrat-SemiBold.ttf</string>
</array>
<key>UPLIFT_DEV_URL</key>
<string>$(UPLIFT_DEV_URL)</string>
<key>UPLIFT_PROD_URL</key>
<string>$(UPLIFT_PROD_URL)</string>
</dict>
</plist>
7 changes: 7 additions & 0 deletions Uplift/Models/Capacity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,10 @@ enum CapacityStatus: Hashable {
case veryBusy(Double)

}

/// An enumeration of the status message of the current capacity.
enum CapacityText: String {
case notBusy = "Not Busy"
case slightlyBusy = "Slightly Busy"
case veryBusy = "Very Busy"
}
Loading