获取本地的lanuchImage

2019-11-28  本文已影响0人  艾希_可可
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
}
上一篇下一篇

猜你喜欢

热点阅读