Giter Site home page Giter Site logo

mqzhot / zlaunchad Goto Github PK

View Code? Open in Web Editor NEW
429.0 13.0 72.0 20.9 MB

快速集成启动广告,支持LaunchImage和LaunchScreen,支持GIF,支持本地图片,支持视图过渡动画

License: MIT License

Swift 91.27% Ruby 1.46% Objective-C 7.05% C 0.21%
storyboard launchad launchimage swift launch

zlaunchad's Introduction

ZLaunchAd

image image Carthage Compatible image ZLaunchAd集成启动广告,支持LaunchImageLaunchScreen,支持GIF,支持本地图片,支持视图过渡动画

image image image image image image

功能

  • 支持进入前台广告显示,设定时间间隔,进入后台后返回的时间大于间隔才进行显示
  • 接收自定义通知控制图片显示
  • 支持Objective-C/Swift
  • 自带图片缓存,清除缓存
  • 自定义跳过按钮外观、位置
  • 支持网络/本地资源,支持GIF图片显示
  • 支持LaunchImage和LaunchScreen.storyboard.
  • 支持广告点击事件,支持广告完成动画设置

安装

CocoaPods

platform :ios, '8.0'
use_frameworks!

target 'YourTargetName' do
pod 'ZLaunchAd'
end

Carthage

github "MQZHot/ZLaunchAd"

Swift Package Manager

import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    dependencies: [
        .package(url: "https://github.com/MQZHot/ZLaunchAd.git", from: "2.1.0"),
    ]
)

使用

/// 进入前台时显示
func create(waitTime: Int = 3, showEnterForeground: Bool = false, timeForWillEnterForeground: Double = 10, adNetRequest: ((ZLaunchAdView)->())? = nil) -> ZLaunchAdView
/// 自定义通知控制出现
func create(waitTime: Int = 3, customNotificationName: String?, adNetRequest: ((ZLaunchAdView)->())? = nil) -> ZLaunchAdView

配置图片资源----配置跳过按钮

func setImageResource(_ imageResource: ZLaunchAdImageResourceConfigure, buttonConfig: ZLaunchSkipButtonConfig? = nil, action: ZLaunchClosure?)

页面配置

  • ZLaunchSkipButtonConfig:跳过按钮配置
  • ZLaunchAdImageResourceConfigure:配置广告图

清除缓存

/// 清除全部缓存
ZLaunchAd.clearDiskCache()

/// 清除指定url的缓存
let array = ["http://..", "http://..", "http://..", "http://.."]
ZLaunchAd.clearDiskCacheWithImageUrlArray(array)

联系

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.