Last active
March 7, 2018 07:18
-
-
Save kapilrathore/1f4188cd4c66b6087787c8aa39e41b6c to your computer and use it in GitHub Desktop.
For medium article - SOLID Swift Using Protocols !!!
This file contains hidden or 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
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