Skip to content

Instantly share code, notes, and snippets.

Last active Feb 8, 2019
What would you like to do?
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Initialize store
let context: NSManagedObjectContext = ...
let store = EventStore(context: context)
// Initialize root view controller
let viewController = EventListTableViewController(store: store)
// Initialize window...
class AddEventViewController: UIViewController {
private let store: EventStore
init(store: EventStore) { = store
super.init(nibName: nil, bundle: nil)
func addEventButtonTapped() {
let event = Event()
event.title = "I went to the hairdresser" = Date()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment