RIT-Dining/RIT Dining/Views/AboutView.swift
NinjaCheetah f8e4c37cd4
Major sorting/filtering improvements
This update mostly includes improvements related to sorting and filtering the main dining location list, including:
- Favorites! You can mark locations as your favorites by swiping them on the list or pressing the star button on their detail page. Favorites are sorted to the top.
- "Hide Closed Locations" has been moved to a dedicated sort/filter button in the bottom left corner. This looks best on iOS 26+, where it sits nicely to the left of the search bar.
- Added an "Open Locations First" option to sort open locations above closed locations, if you want to know what's open quicker without entirely hiding closed locations.
Other improvements:
- Made most asynchronous code properly async instead of bouncing between DispatchQueue.main.async{} and .sync{}.
- Added a timer to refresh open statuses every 3 seconds while on the main list, so that when the time changes the open statuses will change appropriately. It seemed silly to force you to fetch the data again just to do a quick "hey is current time in range?".
- Made date formatter shared so there aren't 3 separate copies of it.
2025-09-25 12:52:50 -04:00

54 lines
1.7 KiB
Swift

//
// AboutView.swift
// RIT Dining
//
// Created by Campbell on 9/12/25.
//
import SwiftUI
struct AboutView: View {
@Environment(\.openURL) private var openURL
let appVersionString: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String
let buildNumber: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as! String
var body: some View {
VStack {
Image("Icon")
.resizable()
.frame(width: 128, height: 128)
.clipShape(RoundedRectangle(cornerRadius: 20))
Text("RIT Dining App")
.font(.title)
Text("because the RIT dining website is slow!")
Text("Version \(appVersionString) (\(buildNumber))")
.foregroundStyle(.secondary)
Text("The RIT Dining app is powered by the TigerCenter API. Dining location occupancy information is sourced from the RIT maps API.")
.multilineTextAlignment(.center)
Spacer()
Button(action: {
openURL(URL(string: "https://github.com/NinjaCheetah/RIT-Dining")!)
}) {
Label("GitHub Repository", systemImage: "globe")
}
Button(action: {
openURL(URL(string: "https://tigercenter.rit.edu/")!)
}) {
Label("TigerCenter", systemImage: "globe")
}
Button(action: {
openURL(URL(string: "https://maps.rit.edu/")!)
}) {
Label("RIT Maps", systemImage: "globe")
}
}
.padding()
.navigationTitle("About")
.navigationBarTitleDisplayMode(.inline)
}
}
#Preview {
AboutView()
}