Skip to content
This repository was archived by the owner on Oct 12, 2025. It is now read-only.
Merged
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
22 changes: 17 additions & 5 deletions HackIllinois.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
0A360882203539FF001F5F85 /* HIAdminEventViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A360881203539FF001F5F85 /* HIAdminEventViewController.swift */; };
35240BD1201408DB00E0C0D8 /* HICountdownViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35240BD0201408DB00E0C0D8 /* HICountdownViewController.swift */; };
35264667203EC14100F59F48 /* HIRecruiterService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35264666203EC14100F59F48 /* HIRecruiterService.swift */; };
35BD9E4A2017DFED005B6FCE /* HITrackingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35BD9E492017DFED005B6FCE /* HITrackingService.swift */; };
35D7CE9720380ACF00654E28 /* Stickers.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 35D7CE9620380ACF00654E28 /* Stickers.xcassets */; };
35D7CE9B20380ACF00654E28 /* Stickers.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 35D7CE9420380ACF00654E28 /* Stickers.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
Expand Down Expand Up @@ -73,6 +74,8 @@
95CA9230201E60D300C46037 /* HIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95CA922F201E60D300C46037 /* HIImage.swift */; };
95CCEA1F203D6B3600E3E28C /* HINavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95CCEA1E203D6B3600E3E28C /* HINavigationController.swift */; };
95CD0ED52015217E00D79DCC /* HIApplicationStateController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95CD0ED42015217E00D79DCC /* HIApplicationStateController.swift */; };
95D6DA78203F8C3900E7C982 /* HIImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D6DA77203F8C3900E7C982 /* HIImageView.swift */; };
95D6DA7A203F983700E7C982 /* HILocalNotificationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D6DA79203F983700E7C982 /* HILocalNotificationController.swift */; };
95D791E9203E12C900C3BA62 /* HIThemeEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D791E8203E12C900C3BA62 /* HIThemeEngine.swift */; };
95D791ED203E370A00C3BA62 /* HIWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D791EC203E370A00C3BA62 /* HIWindow.swift */; };
95DB8C712018419500173ACC /* HIAPIUser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95DB8C702018419500173ACC /* HIAPIUser.swift */; };
Expand Down Expand Up @@ -111,6 +114,7 @@
/* Begin PBXFileReference section */
0A360881203539FF001F5F85 /* HIAdminEventViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIAdminEventViewController.swift; sourceTree = "<group>"; };
35240BD0201408DB00E0C0D8 /* HICountdownViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HICountdownViewController.swift; sourceTree = "<group>"; };
35264666203EC14100F59F48 /* HIRecruiterService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIRecruiterService.swift; sourceTree = "<group>"; };
35BD9E492017DFED005B6FCE /* HITrackingService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HITrackingService.swift; sourceTree = "<group>"; };
35D7CE9420380ACF00654E28 /* Stickers.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = Stickers.appex; sourceTree = BUILT_PRODUCTS_DIR; };
35D7CE9620380ACF00654E28 /* Stickers.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Stickers.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -180,6 +184,8 @@
95CA922F201E60D300C46037 /* HIImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIImage.swift; sourceTree = "<group>"; };
95CCEA1E203D6B3600E3E28C /* HINavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HINavigationController.swift; sourceTree = "<group>"; };
95CD0ED42015217E00D79DCC /* HIApplicationStateController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIApplicationStateController.swift; sourceTree = "<group>"; };
95D6DA77203F8C3900E7C982 /* HIImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIImageView.swift; sourceTree = "<group>"; };
95D6DA79203F983700E7C982 /* HILocalNotificationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HILocalNotificationController.swift; sourceTree = "<group>"; };
95D791E8203E12C900C3BA62 /* HIThemeEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIThemeEngine.swift; sourceTree = "<group>"; };
95D791EC203E370A00C3BA62 /* HIWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIWindow.swift; sourceTree = "<group>"; };
95DB8C702018419500173ACC /* HIAPIUser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIAPIUser.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -272,13 +278,14 @@
isa = PBXGroup;
children = (
95DE24DB1FC3ADBE000F599D /* HIAnnouncementService.swift */,
35BD9E492017DFED005B6FCE /* HITrackingService.swift */,
950F57151FBE81FA001F7DF4 /* HIAuthService.swift */,
84E3DD04203EA27800BF3883 /* HIPassService.swift */,
950F57131FBE8139001F7DF4 /* HIBaseService.swift */,
957D7C831FC28F4100C4332A /* HIEventService.swift */,
95CA03EF2017F62000CB250F /* HIUserService.swift */,
84E3DD04203EA27800BF3883 /* HIPassService.swift */,
35264666203EC14100F59F48 /* HIRecruiterService.swift */,
955772F9202B963800FCE7C0 /* HIRegistrationService.swift */,
35BD9E492017DFED005B6FCE /* HITrackingService.swift */,
95CA03EF2017F62000CB250F /* HIUserService.swift */,
);
path = APIService;
sourceTree = "<group>";
Expand Down Expand Up @@ -327,6 +334,7 @@
children = (
953199C81FC25CA0009F2AA1 /* CoreDataController.swift */,
957DB2E91FC2453100F8C45E /* FlowControllers */,
95D6DA79203F983700E7C982 /* HILocalNotificationController.swift */,
957DB2E41FC2435100F8C45E /* ViewControllers */,
);
path = Controllers;
Expand Down Expand Up @@ -419,16 +427,17 @@
isa = PBXGroup;
children = (
95069260203EE14000D7C34C /* Animations */,
95D791E8203E12C900C3BA62 /* HIThemeEngine.swift */,
95A7D27B203D4F54005EAEAF /* HIButton.swift */,
95CA922F201E60D300C46037 /* HIImage.swift */,
95D6DA77203F8C3900E7C982 /* HIImageView.swift */,
95A7D29D203D5BA4005EAEAF /* HILabel.swift */,
95A7D27C203D4F54005EAEAF /* HISegmentedControl.swift */,
95A7D27D203D4F54005EAEAF /* HITextField.swift */,
95D791E8203E12C900C3BA62 /* HIThemeEngine.swift */,
95A7D27F203D4F54005EAEAF /* HIView.swift */,
95D791EC203E370A00C3BA62 /* HIWindow.swift */,
95A7D27E203D4F54005EAEAF /* Identifiable.swift */,
95A7D280203D4F54005EAEAF /* TableView */,
95D791EC203E370A00C3BA62 /* HIWindow.swift */,
);
path = UI;
sourceTree = "<group>";
Expand Down Expand Up @@ -695,6 +704,7 @@
9521A6AA20191737009059C6 /* HIAnnouncementDataSource.swift in Sources */,
95C18DCB20096539004784B5 /* HIScheduleViewController.swift in Sources */,
95CCEA1F203D6B3600E3E28C /* HINavigationController.swift in Sources */,
35264667203EC14100F59F48 /* HIRecruiterService.swift in Sources */,
957D7CAC1FC2940800C4332A /* HackIllinois.xcdatamodeld in Sources */,
9510F6A71FCB7E53007D19DB /* HIScannerViewController.swift in Sources */,
956F41E11FC7577500557DC7 /* HIAnnouncementsViewController.swift in Sources */,
Expand Down Expand Up @@ -729,7 +739,9 @@
95A7D28D203D4F54005EAEAF /* Identifiable.swift in Sources */,
9521A6A820191590009059C6 /* HIEventDataSource.swift in Sources */,
9506926E203EE14000D7C34C /* LOTAnimationView.swift in Sources */,
95D6DA78203F8C3900E7C982 /* HIImageView.swift in Sources */,
95A7D294203D4F54005EAEAF /* HIDateHeader.swift in Sources */,
95D6DA7A203F983700E7C982 /* HILocalNotificationController.swift in Sources */,
9510F6A31FCB7D6E007D19DB /* Location+CoreDataClass.swift in Sources */,
95D791ED203E370A00C3BA62 /* HIWindow.swift in Sources */,
95A7D29C203D595F005EAEAF /* HITableView.swift in Sources */,
Expand Down
29 changes: 23 additions & 6 deletions HackIllinois/APIService/HIEventService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class HIEventService: HIBaseService {
return super.baseURL + "/event"
}

// MARK: Events
// MARK: - Events
static func create(event: HIAPIEvent) -> APIRequest<HIAPIEvent.Contained> {
let eventDict = [String: Any]()
return APIRequest<HIAPIEvent.Contained>(service: self, endpoint: "", body: eventDict, method: .POST)
Expand All @@ -26,13 +26,30 @@ final class HIEventService: HIBaseService {
return APIRequest<HIAPIEvent.Contained>(service: self, endpoint: "", parameters: paramaters, method: .GET)
}

// MARK: Locations
static func create(location: HIAPILocation) -> APIRequest<HIAPILocation.Contained> {
let locationDict = [String: Any]()
return APIRequest<HIAPILocation.Contained>(service: self, endpoint: "/location", body: locationDict, method: .POST)
}
// MARK: - Locations
// static func create(location: HIAPILocation) -> APIRequest<HIAPILocation.Contained> {
// let locationDict = [String: Any]()
// return APIRequest<HIAPILocation.Contained>(service: self, endpoint: "/location", body: locationDict, method: .POST)
// }

static func getAllLocations() -> APIRequest<HIAPILocation.Contained> {
return APIRequest<HIAPILocation.Contained>(service: self, endpoint: "/location/all", method: .GET)
}

// MARK: - Favorties
static func favortieBy(id: Int) -> APIRequest<HIAPIFavorite.Contained> {
var body = HTTPBody()
body["eventId"] = id
return APIRequest<HIAPIFavorite.Contained>(service: self, endpoint: "/favorite", body: body, method: .POST)
}

static func unfavortieBy(id: Int) -> APIRequest<HIAPISuccessContainer> {
var body = HTTPBody()
body["eventId"] = id
return APIRequest<HIAPISuccessContainer>(service: self, endpoint: "/favorite", body: body, method: .DELETE)
}

static func getAllFavorites() -> APIRequest<HIAPIFavorite.Contained> {
return APIRequest<HIAPIFavorite.Contained>(service: self, endpoint: "/favorite", method: .GET)
}
}
1 change: 0 additions & 1 deletion HackIllinois/APIService/HIPassService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ final class HIPassService: HIBaseService {
]
return APIRequest<Data>(service: self, endpoint: "", body: params, method: .POST)
}

}

extension Data: APIReturnable {
Expand Down
23 changes: 23 additions & 0 deletions HackIllinois/APIService/HIRecruiterService.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// HIRecruiterService.swift
// HackIllinois
//
// Created by Sujay Patwardhan on 2/22/18.
// Copyright © 2018 HackIllinois. All rights reserved.
//

import Foundation
import APIManager

final class HIRecruiterService: HIBaseService {
override static var baseURL: String {
return super.baseURL + "/recruiter"
}

static func followUserBy(id: Int) -> APIRequest<HIAPISuccessContainer> {
var body = HTTPBody()
body["attendeeUserId"] = id
body["favorite"] = true
return APIRequest<HIAPISuccessContainer>(service: self, endpoint: "/interest", body: body, method: .POST)
}
}
6 changes: 1 addition & 5 deletions HackIllinois/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,16 @@
import UIKit
import SwiftKeychainAccess
import CoreLocation
import UserNotifications

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

// var locationManager = CLLocationManager()

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
setupNavigationBarAppearance()
setupTableViewAppearance()
_ = HIThemeEngine.shared
HIApplicationStateController.shared.initalize()
// locationManager.requestWhenInUseAuthorization()
// locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers
// locationManager.pausesLocationUpdatesAutomatically = true
return true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
3 changes: 3 additions & 0 deletions HackIllinois/Assets.xcassets/Favorited.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
3 changes: 3 additions & 0 deletions HackIllinois/Assets.xcassets/MenuClose.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
3 changes: 3 additions & 0 deletions HackIllinois/Assets.xcassets/MenuOpen.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import Foundation
import UIKit
import SwiftKeychainAccess
import UserNotifications

extension Notification.Name {
static let loginUser = Notification.Name("HIApplicationStateControllerLoginUser")
Expand Down Expand Up @@ -58,7 +59,9 @@ extension HIApplicationStateController {
func resetPersistentDataIfNeeded() {
guard !UserDefaults.standard.bool(forKey: "HIAPPLICATION_INSTALLED") else { return }
_ = Keychain.default.purge()

UserDefaults.standard.set(true, forKey: "HIAPPLICATION_INSTALLED")

}

func recoverUserIfPossible() {
Expand All @@ -84,7 +87,7 @@ extension HIApplicationStateController {
viewControllers.append(HIAnnouncementsViewController())
viewControllers.append(HIUserDetailViewController())

if [.volunteer, .staff, .admin].contains(user.permissions) {
if [.volunteer, .mentor, .sponsor, .staff, .admin].contains(user.permissions) {
viewControllers.append(HIScannerViewController())
}

Expand Down
Loading