Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AdvertisementViewDemo
.gitignore
LICENSE
README.md

README.md

About Advertisement Scene

一个简单的启动广告页面 demo

如何获取 App 启动页的 Launch Image name?

static func getLauchImageName() -> String? {
        if let infoDictionary = Bundle.main.infoDictionary, let launchImages = infoDictionary["UILaunchImages"] as? [[String: Any]] {
            let imageSizeValue = "{\(Int(UIScreen.main.bounds.size.width)), \(Int(UIScreen.main.bounds.size.height))}"
            let orientationValue = "Portrait"
            for dict in launchImages {
                if let size = dict["UILaunchImageSize"] as? String, size == imageSizeValue {
                    if let orientation = dict["UILaunchImageOrientation"] as? String, orientation == orientationValue{
                        if let imageName = dict["UILaunchImageName"] as? String {
                            return imageName
                        }
                    }
                }
            }
        }
        return nil
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.