ColdGrub1384 / Random-Day

An iPhone, iPad and Mac app to generate random schedules (project for a Hackathon)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Random-Day

An iPhone, iPad and Mac app to generate random schedules

This is an app for iPhone, iPad and Mac that allows you to organize your days but adding a bit of randomness to make them less boring during quarantine or working at home.

Code

I described the app in the video but I didn't explained anything about the code so I'll do it here.

This is an app made with SwiftUI and a little bit of UIKit and is ported to macOS with Catalyst.

The database is just a JSON encoded struct saved in the disk.

The code for the UI is here and everything else is here.

The app displays a sidebar on iPad and Mac and a tab bar in iPhone or iPad in compact mode. I don't think that needs too much explanation because I think this code is pretty understandable and is just basic SwiftUI.

The sidebar UI

The tabs UI

UI

  • ContentView: The root UI
  • DayPlanner: The UI for configurating the schedule of a weekday
  • NewTaskDialogTableViewController: The UI for creating a new task
  • Sidebar: The sidebar navigation UI
  • Tabs: The tab bar navigation UI
  • TaskCategoriesTableViewController: The UI for managing task categories
  • TaskCategoryPicker: The UI for creating a random space in the schedule
  • TaskPicker: The UI for creating a static space in the schedule
  • TasksTableViewController: The UI to manage the tasks in the selected category
  • TodayScreen: Shows the schedule for today
  • WeekScreen: Shows the week days so the user can configure them

Model

  • CurrentDayManager: Gives the information for today and manages real time updates
  • Database: The database struct is encoded into JSON and saved to disk
  • DatabaseManager: A singleton that holds and manages the database
  • Day: The schedule for a day generated by the app.
  • FutureTask: A space in the schedule that the user created. The app will take care of randomizing it and create a Task from it
  • PlannedDay: The schedule for a day created by the user. The app will generate a Day from it
  • SelectedSection: Just a helper for the UI
  • Task: A task generated by the app.
  • TaskCategory: A category of tasks. The app can take one of the items of the category randomly if it's selected by the user in the schedule Weekday: Weekdays basically

Widget

The widget is just a typical iOS 14 widget that shows what the user has to do now.

iCloud syncing

The database is synced via iCloud thanks to the library Zephyr.

About

An iPhone, iPad and Mac app to generate random schedules (project for a Hackathon)


Languages

Language:Swift 100.0%