Created
September 24, 2015 13:31
-
-
Save lazabogdan/21fdd349ff67ed07d6c0 to your computer and use it in GitHub Desktop.
CouchbaseLite Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Utilities.swift | |
// swift-couchbaselite | |
// | |
// Created by Jens Alfke on 9/17/14. | |
// Copyright (c) 2014 Couchbase, Inc. All rights reserved. | |
// | |
import Foundation | |
extension CBLView { | |
// Just reorders the parameters to take advantage of Swift's trailing-block syntax. | |
func setMapBlock(version: String, mapBlock: CBLMapBlock) -> Bool { | |
return setMapBlock(mapBlock, version: version) | |
} | |
} | |
extension CBLDocument { | |
// Just reorders the parameters to take advantage of Swift's trailing-block syntax. | |
func update(error: NSErrorPointer, block: ((CBLUnsavedRevision!) -> Bool)) -> CBLSavedRevision? { | |
return update(block, error: error) | |
} | |
} | |
extension NSDate { | |
class func withJSONObject(jsonObj: AnyObject) -> NSDate? { | |
return CBLJSON.dateWithJSONObject(jsonObj) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment