美文网首页
Swift 获取 LaunchImage的启动图

Swift 获取 LaunchImage的启动图

作者: 枫子jun | 来源:发表于2019-01-08 14:05 被阅读0次
    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 launchImage = UIImage(named: launchImageName)
    

    相关文章

      网友评论

          本文标题:Swift 获取 LaunchImage的启动图

          本文链接:https://www.haomeiwen.com/subject/wuwvrqtx.html