Latest 0.1.8
Homepage https://github.com/guoyingtao/Trigger
License MIT
Platforms ios 10.0
Authors

SwiftTrigger

SwiftTrigger is used to easily check if some events should be trigged by executing times:

  • The first time
  • The N time
  • every N times
  • every N times but stop after repeating M times

Requirements

  • iOS 10.0+
  • Xcode 9.0+

Install

CocoaPods

To integrate SwiftTrigger into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'SwiftTrigger', '~> 0.1.8'

Cathage

github "guoyingtao/Trigger"

usage

check if an event runs first time

SwiftTrigger().firstRunCheck("Event1") {
  // do something
}

check if an event runs for the N time

SwiftTrigger().check("Event2", targetCount: N) { {
  // do something
}

create an event trigged every N times

SwiftTrigger().check("Event3", targetCount: N, repeatTime: 0) {
  // do something
}

create an event trigged every N times but stop after repeating M times

SwiftTrigger().check("Event4", targetCount: N, repeatTime: M) {
  // do something
}

clear an event

SwiftTrigger().clear("Event1")

clear all events

SwiftTrigger().clearAll()

Latest podspec

{
    "name": "SwiftTrigger",
    "version": "0.1.8",
    "summary": "SwiftTrigger is used to easily check if some events should be trigged by executing times.",
    "description": "The event can be trigged by following casesn* The first time runn* The N time runn* every N times runn* every N times run but stop after repeating M times",
    "homepage": "https://github.com/guoyingtao/Trigger",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Yingtao Guo": "[email protected]"
    },
    "social_media_url": "http://twitter.com/guoyingtao",
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/guoyingtao/Trigger.git",
        "tag": "0.1.8"
    },
    "source_files": "SwiftTrigger/SwiftTrigger.swift",
    "resources": "SwiftTrigger/SwiftTriggerModel.xcdatamodeld",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This