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.
UI
ContentView
: The root UIDayPlanner
: The UI for configurating the schedule of a weekdayNewTaskDialogTableViewController
: The UI for creating a new taskSidebar
: The sidebar navigation UITabs
: The tab bar navigation UITaskCategoriesTableViewController
: The UI for managing task categoriesTaskCategoryPicker
: The UI for creating a random space in the scheduleTaskPicker
: The UI for creating a static space in the scheduleTasksTableViewController
: The UI to manage the tasks in the selected categoryTodayScreen
: Shows the schedule for todayWeekScreen
: Shows the week days so the user can configure them
Model
CurrentDayManager
: Gives the information for today and manages real time updatesDatabase
: The database struct is encoded into JSON and saved to diskDatabaseManager
: A singleton that holds and manages the databaseDay
: 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 aTask
from itPlannedDay
: The schedule for a day created by the user. The app will generate aDay
from itSelectedSection
: Just a helper for the UITask
: 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 scheduleWeekday
: 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.