mrhangz / Survey

0 stars 0 forks source link

Non-singleton network managers use a singleton underneath #31

Open aleksey-ios-dev opened 7 years ago

aleksey-ios-dev commented 7 years ago

lazy var manager: SessionManager of NetworkManager is a singleton Alamofire.SessionManager.default. So you win nothing by avoiding making your class singleton. Even more. A potential user will be adjusting own copy, but in fact changing the singleton's state. Quite dangerous.