获取本地的lanuchImage

static func getLaunchImage()->UIImage{
    let viewSize = UIScreen.main.bounds.size
    let viewOr = "Portrait"//垂直
    var launchImageName = ""
    let tmpLaunchImages = Bundle.main.infoDictionary!["UILaunchImages"] as? [Any]
    for dict in tmpLaunchImages! {
        if let someDict = dict as? [String: Any] {
            let imageSize = CGSizeFromString(someDict["UILaunchImageSize"] as! String)
            if __CGSizeEqualToSize(viewSize, imageSize) && viewOr == someDict["UILaunchImageOrientation"] as! String {
                launchImageName = someDict["UILaunchImageName"] as! String
            }
        }
    }
    let lanuchImage = UIImage(named: launchImageName)!
    return lanuchImage
}

你可能感兴趣的:(获取本地的lanuchImage)