Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
For medium article - SOLID Swift Using Protocols !!!
struct DataManager {
func manage() {
let data = loadData()
let array = parseData(data)
saveData(array)
}
func loadData() -> Data {
// load data from some URL
}
func parseData(_: Data) -> [String] {
// parse json data to array of strings
}
func saveData(_: [String]) {
// save the data to DB
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment