Latest 0.1.0
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, UIKit


Some Apps would display an AD when App launch or App enter foreground.
This is a simple tool help to control when and how many times the AD should be displayed.



  • excludeFromScreenLock, should exclude the situation that app enter foreground by unlock screen. YES by default.
  • timeThreshold, time interval in seconds between background and foreground, default to 300s(5 minus)
  • maxSessionShowTimes, max time of showing AD per session(APP run one time), default to NSUIntegerMax.
  • maxDailyShowTimes, max time of showing AD per day, default to NSUIntegerMax.
  • showADFilter, if exists, the return value of this block will determinte the AD should be displayed or not
  • showADAction, block to execute when an AD should be displayed.

example code

KMADManager *mag = [KMADManager sharedInstace];

mag.maxDailyShowTimes = 5;
mag.maxSessionShowTimes = 3;
mag.excludeFromScreenLock = NO;
mag.timeThreshold = 3 * 60; // 3 minus
mag.showADAction = ^(KMADManager *manager, BOOL isFirstLaunch) {
    // here, code to show your AD
    // e.g.
    NSString *imageName = [NSString stringWithFormat:@"ad%@.jpg",@(manager.dailyShowTimes)];
    UIImage *image = [UIImage imageNamed:imageName];
    if (image) {
        [ADHelper showADWithImage:image];

Latest podspec

    "name": "KMADManager",
    "version": "0.1.0",
    "summary": "A tool to manager an AD(like launch AD) should shows up or not.",
    "description": "A tools help you to manager your launch AD and AD that show when app enter foreground.Easy to control when should they show up.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "KimiLin": "[email protected]"
    "platforms": {
        "ios": "7.0"
    "source": {
        "git": "",
        "tag": "0.1.0"
    "source_files": "ADManager/KMADManager.{h,m}",
    "frameworks": [
    "requires_arc": true

Pin It on Pinterest

Share This