Latest 0.1.0
Homepage https://github.com/pjvea/VSCachedThreadLocalHelper
License MIT
Platforms ios 9.0, requires ARC
Frameworks Foundation
Authors

VSCachedThreadLocalHelper is a helper class that creates cached thread local objects. It is most commonly used for DateFormatters. That way your DateFormatters don’t have to be reallocated every time you want to use them.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

VSCachedThreadLocalHelper is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'VSCachedThreadLocalHelper'

Usage

This is most comonnly used to create DateFormatters.

func getHoursMinutesPeriodDateFormatter() -> DateFormatter {
    return VSCachedThreadLocalHelper.cachedThreadLocalObjectWithKey(key: "HoursMinutesPeriodDateFormatter") {
        let dateFormatter = DateFormatter()
        dateFormatter.dateFormat = "h:mm a"
        return dateFormatter
    }
}

Author

PJ Vea, @pjvea

Vea Software LLC

License

VSCachedThreadLocalHelper is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "VSCachedThreadLocalHelper",
    "version": "0.1.0",
    "summary": "VSCachedThreadLocalHelper is a helper class that creates cached thread local objects.",
    "description": "VSCachedThreadLocalHelper is a helper class that creates cached thread local objects. It is most commonly used for DateFormatters. That way your DateFormatters don't have to be reallocated every time you want to use them.",
    "homepage": "https://github.com/pjvea/VSCachedThreadLocalHelper",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "pjvea": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pjvea/VSCachedThreadLocalHelper.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/pjvea",
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "source_files": "VSCachedThreadLocalHelper/Classes/**/*",
    "frameworks": "Foundation",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This