Visual_Novel_iOS/crush/Crush/Src/Utils/Extensions/BundleExt.swift

47 lines
1.3 KiB
Swift
Executable File

//
// Bundle+Ext.swift
// DouYinSwift5
//
// Created by lym on 2020/7/23.
// Copyright © 2020 lym. All rights reserved.
//
import Foundation
public extension Bundle {
/// App
static var namespace: String {
return (Bundle.main.infoDictionary?["CFBundleExecutable"] as? String) ?? ""
}
/// App
static var appDisplayName: String {
return (Bundle.main.infoDictionary!["CFBundleDisplayName"] as? String) ?? ""
}
///
static var appBundleName: String {
return (Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as? String) ?? ""
}
/// ID
static var appBundleID: String {
return (Bundle.main.object(forInfoDictionaryKey: "CFBundleIdentifier") as? String) ?? ""
}
///
static var appVersion: String {
return (Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String) ?? ""
}
///
static var appBuildVersion: String? {
return (Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String) ?? ""
}
/// iOS
static var appLanguage: String? {
return Bundle.main.preferredLocalizations.first
}
}