All Projects → JohnSundell → Require

JohnSundell / Require

Licence: mit
Require optional values to be non-nil, or crash gracefully

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Require

Solarized Dark For Xcode
Solarized Dark Theme for Xcode. Compatible with all modern versions of Xcode since 2013!
Stars: ✭ 358 (-11.6%)
Mutual labels:  xcode
Restofire
Restofire is a protocol oriented networking client for Alamofire
Stars: ✭ 377 (-6.91%)
Mutual labels:  xcode
Buildtimeanalyzer For Xcode
Build Time Analyzer for Swift
Stars: ✭ 3,958 (+877.28%)
Mutual labels:  xcode
Tulsi
An Xcode Project Generator For Bazel
Stars: ✭ 365 (-9.88%)
Mutual labels:  xcode
Cartool
Mac上解压Assets.car文件的小工具(支持右键解压)
Stars: ✭ 375 (-7.41%)
Mutual labels:  xcode
Stylesync
A command line tool to extract shared styles from a Sketch document, and generate native code for any platform.
Stars: ✭ 382 (-5.68%)
Mutual labels:  xcode
Apple Juice
An advanced battery gauge for macOS, that displays the remaining battery time and more.
Stars: ✭ 350 (-13.58%)
Mutual labels:  xcode
Xcode Defaults
Awesome and useful Xcode defaults
Stars: ✭ 399 (-1.48%)
Mutual labels:  xcode
Xcbeautify
A little beautifier tool for xcodebuild
Stars: ✭ 372 (-8.15%)
Mutual labels:  xcode
Stepslider
StepSlider its custom implementation of slider such as UISlider for preset integer values.
Stars: ✭ 391 (-3.46%)
Mutual labels:  xcode
Cargo Mobile
Rust on mobile made easy!
Stars: ✭ 362 (-10.62%)
Mutual labels:  xcode
Ipapatch
Patch iOS Apps, The Easy Way, Without Jailbreak.
Stars: ✭ 3,837 (+847.41%)
Mutual labels:  xcode
Iosdropdown
Drop Down Menu for iOS With Search And Other Awesome Customisation
Stars: ✭ 390 (-3.7%)
Mutual labels:  xcode
Xcode Wakatime
Xcode plugin for automatic time tracking and metrics generated from your programming activity.
Stars: ✭ 360 (-11.11%)
Mutual labels:  xcode
Playground
Instantly create Swift playgrounds from the command line
Stars: ✭ 391 (-3.46%)
Mutual labels:  xcode
Ci helloworld
A simple example of how to setup a complete CI environment for C and C++
Stars: ✭ 357 (-11.85%)
Mutual labels:  xcode
Kingfisher
A lightweight, pure-Swift library for downloading and caching images from the web.
Stars: ✭ 19,512 (+4717.78%)
Mutual labels:  xcode
Squishbutton
A button that squishes when pressed. As seen in the Clips app.
Stars: ✭ 401 (-0.99%)
Mutual labels:  xcode
Swiftuikitview
Easily use UIKit views in your SwiftUI applications. Create Xcode Previews for UIView elements
Stars: ✭ 398 (-1.73%)
Mutual labels:  xcode
Swift Open Project
Swift 开源项目分类汇总
Stars: ✭ 391 (-3.46%)
Mutual labels:  xcode

✅ Require

CocoaPods Carthage Swift PM Twitter

Require lets you easily require Optional values to be non-nil, or crash gracefully.

Sometimes you have optional values in your code that are not really optional, and will cause your application to enter an undefined state if nil. Require makes it easy to avoid such states, by causing a crash with rich debug information, to enable you to much easier hunt down & fix the bug.

Usage

Call require() on any Optional, optionally giving a hint for debugging purposes:

class ConfigurationLoader {
    func load() -> Configuration {
        let data = readJSONFile().require(hint: "Verify that Config.JSON is valid")
        let config: Configuration? = try? unbox(data: data)
        return config.require()
    }
}

Installation

Swift Package Manager:

Add .Package(url: "[email protected]:johnsundell/require.git", majorVersion: 1) to your Package.swift file.

CocoaPods:

Add pod "Require" to your Podfile.

Carthage:

Add github "johnsundell/require" to your Cartfile.

Manual:

Clone the repo and drag the file Require.swift into your Xcode project.

Help, feedback or suggestions?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].