Latest 0.0.3
Homepage https://github.com/MQZHot/ZLaunchAdVC
License MIT
Platforms ios 8.0, requires ARC
Authors

image

swift 集成app启动页广告,切换rootViewController,支持LaunchImage和LaunchScreen.storyboard,支持GIF图片显示,支持视图过渡动画

不足之处,欢迎交流,欢迎star✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨

image image image image image image

功能

  • [x] 圆形跳过按钮、倒计时+跳过
  • [x] 全屏广告、广告距离底部距离设置
  • [x] 跳过按钮位置: 屏幕右上角、右下角,广告图右下角
  • [x] 支持GIF图片显示
  • [x] 支持状态栏颜色设置、显示与隐藏

使用

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    window = UIWindow.init(frame: UIScreen.main.bounds)
    window?.backgroundColor = UIColor.white
    let homeVC = ViewController()
    let nav = UINavigationController.init(rootViewController: homeVC)

    if launchOptions != nil {

        /// 通过推送等启动
        window?.rootViewController = nav

    } else {
        /// 正常点击icon启动页,加载广告
        let adVC = ZLaunchAdVC.init(defaultDuration: 6, completion: {

            self.window?.rootViewController = nav

        })
        /// 延时模拟网络请求
        /// 网络超过vc默认显示时间(可设置),不加载图片
        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 2, execute: {

            let url = "http://chatm-icon.oss-cn-beijing.aliyuncs.com/pic/pic_20170725165329728.jpg"
            let adDuartion = 4

            /// 设置参数
            adVC.setAdParams(url: url, adDuartion: adDuartion, skipBtnType: .circle, adViewBottomDistance: 0, transitionType: .flipFromTop, adImgViewClick: {

                let vc = UIViewController()
                vc.view.backgroundColor = UIColor.yellow
                homeVC.navigationController?.pushViewController(vc, animated: true)

            })
        })
        window?.rootViewController = adVC
    }
    window?.makeKeyAndVisible()
    return true
}

安装

  • 1.pod ‘ZLaunchAdVC’

  • 2.pod install / pod update

CocoaPods更新日志

• 2017.08.01(0.0.3):
  1.修复无网络崩溃

• 2017.07.25(0.0.2):
  1.新增GIF图片显示
  2.去除kingfisher
  3.修复过渡动画重复执行

Author

  • Email: [email protected]
  • 简 书 : http://www.jianshu.com/u/9e39ec4000e9

LICENSE

ZLaunchAdVC is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "ZLaunchAdVC",
    "version": "0.0.3",
    "summary": "u96c6u6210appu542fu52a8u9875u5e7fu544auff0cu5207u6362rootViewControlleruff0cu652fu6301LaunchImageu548cLaunchScreen.storyboarduff0cu652fu6301GIFu56feu7247u663eu793auff0cu652fu6301u89c6u56feu8fc7u6e21u52a8u753b",
    "homepage": "https://github.com/MQZHot/ZLaunchAdVC",
    "authors": {
        "mqz": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/MQZHot/ZLaunchAdVC.git",
        "tag": "0.0.3"
    },
    "source_files": [
        "ZLaunchAdDemo/ZLaunchAd",
        "ZLaunchAdDemo/ZLaunchAd/*.{swift}"
    ],
    "requires_arc": true,
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This