diff --git a/HIAPI/Models/Staff.swift b/HIAPI/Models/Staff.swift index 91240c51..dc838d96 100644 --- a/HIAPI/Models/Staff.swift +++ b/HIAPI/Models/Staff.swift @@ -23,7 +23,7 @@ public struct StaffContainer: Decodable, APIReturnable { public struct Staff: Codable { internal enum CodingKeys: String, CodingKey { - case isPro + case _id case eventId case isStaff case name @@ -31,15 +31,15 @@ public struct Staff: Codable { case startTime case endTime case eventType - case exp case locations case isAsync - case mapImageUrl case points case isPrivate case displayOnStaffCheckIn + case mapImageUrl + case isPro } - public let isPro: Bool + public let _id: String public let eventId: String public let isStaff: Bool public let name: String @@ -47,13 +47,13 @@ public struct Staff: Codable { public let startTime: Date public let endTime: Date public let eventType: String - public let exp: Int public let locations: [Location] public let isAsync: Bool - public let mapImageUrl: String public let points: Int public let isPrivate: Bool public let displayOnStaffCheckIn: Bool + public let mapImageUrl: String? + public let isPro: Bool } diff --git a/HackIllinois.xcodeproj/project.pbxproj b/HackIllinois.xcodeproj/project.pbxproj index a4012740..2b2de29b 100644 --- a/HackIllinois.xcodeproj/project.pbxproj +++ b/HackIllinois.xcodeproj/project.pbxproj @@ -1380,7 +1380,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2025.1.1; + MARKETING_VERSION = 2025.1.3; ONLY_ACTIVE_ARCH = YES; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" -Xfrontend -warn-long-expression-type-checking=150"; PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios; @@ -1417,7 +1417,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2025.1.1; + MARKETING_VERSION = 2025.1.3; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.hackillinois.ios; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/HackIllinois/FlowControllers/HITabBarController.swift b/HackIllinois/FlowControllers/HITabBarController.swift index 308acf21..b4ca0d03 100644 --- a/HackIllinois/FlowControllers/HITabBarController.swift +++ b/HackIllinois/FlowControllers/HITabBarController.swift @@ -29,8 +29,10 @@ class HITabBarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() - setupQRScanButton() - setupTabBar() + if !(UIDevice.current.userInterfaceIdiom == .pad) { + setupQRScanButton() + setupTabBar() + } } override func viewDidLayoutSubviews() { diff --git a/HackIllinois/ViewControllers/HIScheduleViewController.swift b/HackIllinois/ViewControllers/HIScheduleViewController.swift index 4c237fc6..cbd68f98 100644 --- a/HackIllinois/ViewControllers/HIScheduleViewController.swift +++ b/HackIllinois/ViewControllers/HIScheduleViewController.swift @@ -117,35 +117,23 @@ extension HIScheduleViewController { } func currentPredicate() -> NSPredicate { - if onlyShifts { - // Return a predicate that matches no events when in shifts view - return NSPredicate(value: false) - } else if onlyFavorites { - let currentTabPredicate = dataStore[currentTab].predicate - return NSCompoundPredicate(andPredicateWithSubpredicates: [currentTabPredicate, onlyFavoritesPredicate]) + let currentTabPredicate = dataStore[currentTab].predicate + if onlyFavorites { + let compoundPredicate = NSCompoundPredicate(andPredicateWithSubpredicates: [currentTabPredicate, onlyFavoritesPredicate]) + return compoundPredicate + } else if onlyShifts { + let noEventsPredicate = NSPredicate(value: false) + return noEventsPredicate } else { - return dataStore[currentTab].predicate + return currentTabPredicate } } func animateReload() { try? fetchedResultsController.performFetch() - - if onlyShifts { - // Clear schedule events - tableView?.reloadData() - - // Make sure shifts are displayed if we have them - if hasSelectedShift && !staffShifts.isEmpty { - removeStaffShiftContainerViews() // Clear old shift views - setUpShiftCells() // Re-display current shifts - } - } else { - // Normal reload for schedule view - animateTableViewReload() - if let tableView = tableView, !tableView.visibleCells.isEmpty { - tableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false) - } + animateTableViewReload() + if let tableView = tableView, !tableView.visibleCells.isEmpty { + tableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: false) } } } @@ -382,7 +370,7 @@ extension HIScheduleViewController { @objc func shiftsButtonTapped(_ sender: UIButton) { if !onlyShifts { - onlyShifts = true + onlyShifts = !onlyShifts backgroundView.image = #imageLiteral(resourceName: "BackgroundShifts") hasSelectedShift = true labelColor = #colorLiteral(red: 0.337254902, green: 0.1411764706, blue: 0.06666666667, alpha: 1) @@ -404,6 +392,8 @@ extension HIScheduleViewController { DispatchQueue.main.async { self.setUpShiftCells() + self.updatePredicate() + self.animateReload() } } catch { print("An error has occurred in getting staff shifts \(error)") @@ -443,7 +433,7 @@ extension HIScheduleViewController { let calendar = Calendar.current let dayComponent = calendar.component(.day, from: dateString) var curr_idx = segmentedControl.selectedIndex - if curr_idx == 0 && dayComponent != 28 { + if curr_idx == 0 && dayComponent != 29 { continue } else if curr_idx == 1 && dayComponent != 1 { continue