Latest 0.2.1
License MIT
Platforms ios 9.0, osx 10.11, watchos 2.0, tvos 9.0
Dependencies PromiseKit
Frameworks Foundation

The ultimate lazy library. Can cause a thread to sleep for a random amount of

This looks useless, what is this really?

Snorlax is a good citizen in the Swift ecosystem. It’s a reference
implementation to support as many different platforms as possible.

Snorlax currently supports the following platforms:

  • Mac OS X
  • iOS
  • tvOS
  • watchOS
  • Linux

Using the following Package Managers:

Feel free the look at the commit
or browse the
documentation to see how to create a library:

Can I try installing it?

Sure, use your favorite package manager. Please note the two different versions:

  • Odd minor versions (eg – 0.1.0) require no dependencies. The latest one is 0.1.1.
  • Even minor versions (eg – 0.2.0) has dependencies. The latest one is
    0.2.1. Currently, these dependencies don’t support all the platforms
    properly (WIP).

You can see examples at Snorlax Samples


Add Snorlax to your pod file and run pod install:

# CocoaPods
pod 'Snorlax', '~> 0.1.0'


Add Snorlax to your Cartfile (package dependency) or Cartfile.private
(development dependency):

github "tryswift/Snorlax" ~> 0.1.0

Swift Package Manager

Add to your Package.swift dependencies:

import PackageDescription

let package = Package(
    // ... your project details
    dependencies: [
        // As a required dependency
        .Package(url: "ssh://[email protected]/tryswift/Snorlax.git", majorVersion: 0)
    testDependencies: [
        // As a test dependency
        .Package(url: "ssh://[email protected]/tryswift/Snorlax.git", majorVersion: 0)

Manually as an Xcode Subproject



Documentation improvements and translations are welcomed!

Latest podspec

    "name": "Snorlax",
    "version": "0.2.1",
    "summary": "Snoozing for everyone",
    "description": "Snoozing for everyone!nnSnorlax allows you to sleep on the current thread for anrandom amount of time.nnIn truth, Snorlax is an example library demostrating how to build libraries that support multiple platforms:n - Carthagen - Cocoapodsn - Swift Package Managern - OS Xn - iOSn - watchOSn - tvOSn - LinuxnnSee the source at",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Jeff Hui": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "9.0",
        "osx": "10.11",
        "watchos": "2.0",
        "tvos": "9.0"
    "source": {
        "git": "",
        "tag": "v0.2.1"
    "source_files": "Sources/Snorlax/*.{h,m,swift}",
    "public_header_files": "Sources/Snorlax/*.h",
    "frameworks": "Foundation",
    "dependencies": {
        "PromiseKit": [
            "~> 3.0"

Pin It on Pinterest

Share This