swift 讀取info.plist檔案中的資訊
阿新 • • 發佈:2019-02-09
//在頂部狀態列顯示風火輪(iPhonex之後沒有好像)
UIApplication.shared.isNetworkActivityIndicatorVisible = true
// 讀取info.plist中的資訊
let mainBundle = Bundle.main
let identifer = mainBundle.bundleIdentifier
let info = mainBundle.infoDictionary
let bundleId = mainBundle.object(forInfoDictionaryKey: "CFBundleName")
let version = mainBundle.object(forInfoDictionaryKey: "CFBundleShortVersionString")
print("[identifer]:\(identifer!)")
print("[info]:\(info!)")
print("[bundleId]:\(bundleId!)")
print("[version]:\(version!)")