Tuesday, January 17, 2017

Swift some important note.

Who are swift struggling to comment, pragma, .warning, to do or other imports note to write, which one to next time or fix some issue, it's embarrassing to who already working on Objective-C, here we go with some swift important slip.

Comment:

Single line: //
Multi Line: /* here your commommnets*/

Pragma or methods section mark which Objective-C is called #pragma

//MARK:UITableViewDelegate

Warning:

//TODO: this method complete next day 

Logical change or need to fix somethings then:

//FIXME: logical error here, or should update depreciated

Thursday, January 5, 2017

Access resource from main bundle using Swift 3.0


Plist read from the main bundle:

let plistPath = Bundle.main.path(forResource: "plist name", ofType: "plist")
let dataList = :NSArray = NSArray(contentsOfFile: plistPath!)!
print(dataList)

Info Plist access:

let appDisplayName:String = Bundle.main.infoDictionary!["CFBundleDisplayName"] as! String