mirror of
https://github.com/NinjaCheetah/RIT-Dining.git
synced 2026-03-04 21:25:27 -05:00
Increased padding around content in views
This increased padding is roughly the same as the padding around native iOS components like lists, which makes it look a lot more uniform. The increased padding also makes everything feel a little less cramped.
This commit is contained in:
27
TigerDine/Components/BackgroundRefresh.swift
Normal file
27
TigerDine/Components/BackgroundRefresh.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// BackgroundRefresh.swift
|
||||
// TigerDine
|
||||
//
|
||||
// Created by Campbell on 1/9/26.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import BackgroundTasks
|
||||
|
||||
/// This is the global function used to tell iOS that we want to schedule a new instance of the background refresh task. It's used both in the main app to automatically reschedule a task when one completes, and also within the dining model to schedule a task when a refresh finishes.
|
||||
func scheduleNextRefresh() {
|
||||
let request = BGAppRefreshTaskRequest(
|
||||
identifier: "dev.ninjacheetah.RIT-Dining.refresh"
|
||||
)
|
||||
|
||||
// Refresh NO SOONER than 6 hours from now. That's not super important since the task will exit pretty much immediately
|
||||
// if the cache is still fresh, but we really don't need to try more frequently than this so don't bother.
|
||||
request.earliestBeginDate = Date(timeIntervalSinceNow: 6 * 60 * 60)
|
||||
|
||||
do {
|
||||
try BGTaskScheduler.shared.submit(request)
|
||||
print("background refresh scheduled successfully")
|
||||
} catch {
|
||||
print("failed to schedule background refresh: ", error)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user