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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -