Skip to content

Instantly share code, notes, and snippets.

@lazabogdan
Created September 24, 2015 13:31
Show Gist options
  • Save lazabogdan/21fdd349ff67ed07d6c0 to your computer and use it in GitHub Desktop.
Save lazabogdan/21fdd349ff67ed07d6c0 to your computer and use it in GitHub Desktop.
CouchbaseLite Swift
//
// 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