This repository has been archived by the owner on Oct 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See Cocoapods Issue #3200. Using cocoapods for botht the app and the extensions causes an issue that prevents Xcode from building a valid archive. From now on cocoapods will be used only for the main app. Realm is now integrated manually as a dynamic framework.
- Loading branch information
1 parent
9aca101
commit d913ee3
Showing
34 changed files
with
3,397 additions
and
101 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
//////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Copyright 2014 Realm Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
//////////////////////////////////////////////////////////////////////////// | ||
|
||
import Realm | ||
|
||
extension RLMObject { | ||
// Swift query convenience functions | ||
public class func objectsWhere(predicateFormat: String, _ args: CVarArgType...) -> RLMResults { | ||
return objectsWithPredicate(NSPredicate(format: predicateFormat, arguments: getVaList(args))) | ||
} | ||
|
||
public class func objectsInRealm(realm: RLMRealm, _ predicateFormat: String, _ args: CVarArgType...) -> RLMResults { | ||
return objectsInRealm(realm, withPredicate:NSPredicate(format: predicateFormat, arguments: getVaList(args))) | ||
} | ||
} | ||
|
||
extension RLMArray: SequenceType { | ||
// Support Sequence-style enumeration | ||
public func generate() -> GeneratorOf<RLMObject> { | ||
var i: UInt = 0 | ||
|
||
return GeneratorOf<RLMObject> { | ||
if (i >= self.count) { | ||
return .None | ||
} else { | ||
return self[i++] as? RLMObject | ||
} | ||
} | ||
} | ||
|
||
// Swift query convenience functions | ||
public func indexOfObjectWhere(predicateFormat: String, _ args: CVarArgType...) -> UInt { | ||
return indexOfObjectWithPredicate(NSPredicate(format: predicateFormat, arguments: getVaList(args))) | ||
} | ||
|
||
public func objectsWhere(predicateFormat: String, _ args: CVarArgType...) -> RLMResults { | ||
return objectsWithPredicate(NSPredicate(format: predicateFormat, arguments: getVaList(args))) | ||
} | ||
} | ||
|
||
extension RLMResults: SequenceType { | ||
// Support Sequence-style enumeration | ||
public func generate() -> GeneratorOf<RLMObject> { | ||
var i: UInt = 0 | ||
|
||
return GeneratorOf<RLMObject> { | ||
if (i >= self.count) { | ||
return .None | ||
} else { | ||
return self[i++] as? RLMObject | ||
} | ||
} | ||
} | ||
|
||
// Swift query convenience functions | ||
public func indexOfObjectWhere(predicateFormat: String, _ args: CVarArgType...) -> UInt { | ||
return indexOfObjectWithPredicate(NSPredicate(format: predicateFormat, arguments: getVaList(args))) | ||
} | ||
|
||
public func objectsWhere(predicateFormat: String, _ args: CVarArgType...) -> RLMResults { | ||
return objectsWithPredicate(NSPredicate(format: predicateFormat, arguments: getVaList(args))) | ||
} | ||
} |
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
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
Oops, something went wrong.