Latest 0.0.1
Homepage https://github.com/ulian-onua/KRNTimeout
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation
Authors

KRNTimeout is a class that allows you to start, handle and stop timeouts. Class can be useful for working with network and asynchronous operations using Core Bluetooth, Multipeer Connectivity Framework etc.

Installation

CocoaPods

Just add pod 'KRNTimeout' to your Podfile and run pod install in Terminal from your project folder.

Write #import "KRNTimeout.h" in files where you need to use KRNTimeout class and its instances.

How to use

Usage of KRNTimeout is very simple.
For example, to create timeout that expires in 2 seconds you can use next code:

[KRNTimeout timeoutWithSeconds:2.f andFiredBlock:^{
    // block will be called when timeout expires    
}];

Of course, you can create instances of KRNTimeout class and stop timeout if event connected with them occurred before timeout expiration.

KRNTimeout *timeout = [[KRNTimeout alloc]initWithSeconds:2.f];
[timeout startWithBlock:^{
   // block will be called when timeout expires if timeout hasn't been stopped before its expiration
}];
...
[timeout stop]; // stop timeout

Requirements

  • iOS 8.0 and above
  • XCode 6+

License

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

Contact

Any suggestion or question? Please create a Github issue or reach me out.

LinkedIn

Latest podspec

{
    "name": "KRNTimeout",
    "version": "0.0.1",
    "summary": "An Objective C class that simplifies using timeouts during iOS-development",
    "homepage": "https://github.com/ulian-onua/KRNTimeout",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Julian Drapaylo": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/ulian-onua/KRNTimeout.git",
        "tag": "0.0.1"
    },
    "source_files": "KRNTimeout/*.{h,m}",
    "public_header_files": "KRNTimeout/*.h",
    "frameworks": "Foundation",
    "requires_arc": true
}

Pin It on Pinterest

Share This