A Swift integration for Zermelo API, allowing users to authenticate, fetch their schedules, and manage their school timetable seamlessly. This project showcases how to interact with the Zermelo API using Swift and SwiftUI.
- OAuth Authentication with Zermelo API
- Fetch and display schedules dynamically
- QR Code Scanning for quick authentication
- User session persistence using
UserDefaults - Clean and modular Swift codebase
- Clone the repository:
git clone https://github.com/Siddharth11sehgal/ZermeloSwiftIntegration.git cd ZermeloSwiftIntegration
Zermelo uses OAuth for authentication. Users can:
- Enter their school name and auth code manually.
- Scan a QR code to automatically fetch authentication details.
Task {
do {
try await ZermeloAuthManager.shared.authenticate(code: "YOUR_AUTH_CODE", school: "YOUR_SCHOOL_NAME")
} catch {
print("Authentication failed: \(error)")
}
}Retrieve your school schedule using:
let appointments = try await ZermeloManager.shared.fetchSchedule(start: startTime, end: endTime)ZermeloAuthView.swift→ Handles user authentication (manual & QR code).ZermeloAuthManager.swift→ Manages OAuth token storage and authentication.ZermeloManager.swift→ Fetches schedules from the API.ZermeloModels.swift→ Defines data structures for Zermelo responses.
Contributions are welcome! Feel free to:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -m "Add new feature"). - Push and submit a Pull Request.
This project is licensed under the MIT License.
If you have questions, reach out via GitHub or email me at [email protected].