├─ Level // Root Folder
├─ 3rdParty (Any 3rd party which can not added through package manager)
├─ AppDelegate
├─ AppDelegate.swift
├─ AppDelegateBGSupport.swift (extension of AppDelegate, methods associated with background support (prefetching, download etc))
├─ AppDelegateNotificationSupport.swift (extension of AppDelegate, methods associated with Notification(Push, Local) support)
├─ Controllers
├─ Feedback
├─ Controllers (View controllers strictly associated with Feedback Module)
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
/// Called whenever there is a change in NetworkReachibility Status | |
/// | |
/// — parameter notification: Notification with the Reachability instance | |
func reachabilityChanged(notification: Notification) { | |
let reachability = notification.object as! Reachability | |
switch reachability.currentReachabilityStatus { | |
case .notReachable: | |
debugPrint("Network became unreachable") |
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
// Start | |
ReachabilityManager.shared.startMonitoring() | |
// Stop | |
ReachabilityManager.shared.stopMonitoring() |
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
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
ReachabilityManager.shared.addListener(listener: self) | |
} | |
override func viewDidDisappear(_ animated: Bool) { | |
super.viewDidDisappear(animated) | |
ReachabilityManager.shared.removeListener(listener: self) | |
} |
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
extension ViewController: NetworkStatusListener { | |
func networkStatusDidChange(status: Reachability.NetworkStatus) { | |
switch status { | |
case .notReachable: | |
debugPrint("ViewController: Network became unreachable") | |
case .reachableViaWiFi: | |
debugPrint("ViewController: Network reachable through WiFi") | |
case .reachableViaWWAN: |
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
func networkStatusDidChange(status: Reachability.NetworkStatus) { | |
switch status { | |
case .notReachable: | |
debugPrint("ViewController: Network became unreachable") | |
case .reachableViaWiFi: | |
debugPrint("ViewController: Network reachable through WiFi") | |
case .reachableViaWWAN: | |
debugPrint("ViewController: Network reachable through Cellular Data") | |
} |
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
extension UIColor { | |
/** | |
Creates an UIColor from HEX String in "#363636" format | |
- parameter hexString: HEX String in "#363636" format | |
- returns: UIColor from HexString | |
*/ | |
convenience init(hexString: String) { |
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
enum Color { | |
case theme | |
case border | |
case shadow | |
case darkBackground | |
case lightBackground | |
case intermidiateBackground | |
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
extension Color { | |
var value: UIColor { | |
var instanceColor = UIColor.clear | |
switch self { | |
case .border: | |
instanceColor = UIColor(hexString: "#333333") | |
case .theme: | |
instanceColor = UIColor(hexString: "#ffcc00") |