do {
let decoded = try HelperManager.JSON.jsonDecode(jsonString, type: MockObject.self)
} catch let error as NSError {
//put here your error management.
}
UIApplication+TopViewController
This helper includes a fuction for catch top viewcontroller in Viewcycle stack
Interface:
Description : function for encode Swift object to json stirng.
Parameter base: Base of stack for find the top view controller.
Returns: UIViewController: The first view controller finded in base stack.
public static func getTopViewController(base: UIViewController? = UIApplication.shared.keyWindow?.rootViewController) -> UIViewController?
Usage Example:
let topVC = HelperManager.UIApplicationHelpers.getTopViewController()
Main class
Helpers
JSON
This helper provides methodf for encode and decode json to swift object and vice versa using Codable framework..
Interface:
Usage Example:
Deocde:
Usage Example:
Object:
use
UIApplication+TopViewController
This helper includes a fuction for catch top viewcontroller in Viewcycle stack
Interface:
Usage Example:
Meta
David Martin Saiz – @deividmarshall – davms81@gmail.com
Distributed under the MIT license. See
LICENSE
for more information.https://github.com/CodeNationDev/
Version History