Skip to content

Instantly share code, notes, and snippets.

View kapilrathore's full-sized avatar

 Kapil Rathore kapilrathore

  • Jaipur, Rajasthan
View GitHub Profile
@kapilrathore
kapilrathore / SRPPass.swift
Last active March 7, 2018 07:49
For medium article - SOLID Swift Using Protocols !!!
struct DataManager {
let dataLoader: DataDownloader
let dataParser: DataParser
let dbManager: DBManager
init(dataLoader: DataDownloader, dataParser: DataParser, dbManager: DBManager) {
self.dataLoader = dataLoader
self.dataParser = dataParser
self.dbManager = dbManager
@kapilrathore
kapilrathore / SRPFail.swift
Last active March 7, 2018 07:18
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