Created
April 23, 2017 08:31
-
-
Save cristibaluta/f657fac6f450700ac4f9abb0b6cf0711 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Repository { | |
func queryTasks (_ page: Int, completion: @escaping ([Task], NSError?) -> Void) | |
func queryTasksInDay (_ day: Date) -> [Task] | |
func queryTasksInDay (_ day: Date, completion: @escaping ([Task], NSError?) -> Void) | |
func queryUnsyncedTasks() -> [Task] | |
func queryDeletedTasks (_ completion: @escaping ([Task]) -> Void) | |
func queryUpdates (sinceDate: Date, completion: @escaping ([Task], [String], NSError?) -> Void) | |
// Marks the Task as deleted. If forceDelete is true it will be removed from db | |
func deleteTask (_ task: Task, forceDelete: Bool, completion: @escaping ((_ success: Bool) -> Void)) | |
func deleteTask (objectId: String, completion: @escaping ((_ success: Bool) -> Void)) | |
// Save a task and returns the same task with a taskId generated if it didn't had | |
func saveTask (_ task: Task, completion: @escaping ((_ task: Task) -> Void)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment