ios - Non UIViewController Class in Swift -
ios - Non UIViewController Class in Swift -
i m new ios.
i want know how create non uiviewcontroller based class. mean class not extending uiviewcontroller.
i want because want phone call async http url , parse json/xml in non ui class. want them in separate class uiviewcontroller classs.
please help me
create new class without inheritance this:
class jsonobject{ var url: nsurl? internal func parsejson() -> nsarray { // code parse json homecoming [] } }
and can create instance of class elsewhere using this:
var newjsonobject: jsonobject = jsonobject() newjsonobject.url = nsurl(string: "www.somejson.php") newjsonobject.parsejson()
ios class swift uiviewcontroller
Comments
Post a Comment