-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ChartsRealm with Swift 4.0.3 and fix compile errors, demo app …
…add support for iPhone X 1. Replace Launchimage with LaunchScreen 2. Change auto-layout to bind with safe layout guide 3. Update Realm with latest master, and fix errors. Currently Realm does not release prebuilt framework for Swift 4.0.3, have to use master. Once it released we can point to that
- Loading branch information
liuxuan30
committed
Jan 4, 2018
1 parent
df28714
commit 257ca3d
Showing
36 changed files
with
435 additions
and
184 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
github "danielgindi/Charts" == 3.0.4 | ||
github "realm/realm-cocoa" ~> 2.10 | ||
github "danielgindi/Charts" "master" | ||
github "realm/realm-cocoa" "master" |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
github "danielgindi/Charts" "v3.0.4" | ||
github "realm/realm-cocoa" "v2.10.2" | ||
github "danielgindi/Charts" "9706fa140bbce03e0e4fb7f798a3b2a13e8f0eb4" | ||
github "realm/realm-cocoa" "95d69bebbeebf30a5bf00f8923638ed16e3899ce" |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
//////////////////////////////////////////////////////////////////////////// | ||
// | ||
// 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 RLMRealm { | ||
@nonobjc public class func schemaVersion(at url: URL, usingEncryptionKey key: Data? = nil) throws -> UInt64 { | ||
var error: NSError? | ||
let version = __schemaVersion(at: url, encryptionKey: key, error: &error) | ||
guard version != RLMNotVersioned else { throw error! } | ||
return version | ||
} | ||
|
||
#if swift(>=3.2) | ||
@nonobjc public func resolve<Confined>(reference: RLMThreadSafeReference<Confined>) -> Confined? { | ||
return __resolve(reference as! RLMThreadSafeReference<RLMThreadConfined>) as! Confined? | ||
} | ||
#else | ||
@nonobjc public func resolve<Confined: RLMThreadConfined>(reference: RLMThreadSafeReference<Confined>) -> Confined? { | ||
return __resolve(reference as! RLMThreadSafeReference<RLMThreadConfined>) as! Confined? | ||
} | ||
#endif | ||
} | ||
|
||
extension RLMObject { | ||
// Swift query convenience functions | ||
public class func objects(where predicateFormat: String, _ args: CVarArg...) -> RLMResults<RLMObject> { | ||
return objects(with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) as! RLMResults<RLMObject> | ||
} | ||
|
||
public class func objects(in realm: RLMRealm, | ||
where predicateFormat: String, | ||
_ args: CVarArg...) -> RLMResults<RLMObject> { | ||
return objects(in: realm, with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) as! RLMResults<RLMObject> | ||
} | ||
} | ||
|
||
public struct RLMIterator<T>: IteratorProtocol { | ||
private var iteratorBase: NSFastEnumerationIterator | ||
|
||
internal init(collection: RLMCollection) { | ||
iteratorBase = NSFastEnumerationIterator(collection) | ||
} | ||
|
||
public mutating func next() -> T? { | ||
return iteratorBase.next() as! T? | ||
} | ||
} | ||
|
||
// Sequence conformance for RLMArray and RLMResults is provided by RLMCollection's | ||
// `makeIterator()` implementation. | ||
extension RLMArray: Sequence {} | ||
extension RLMResults: Sequence {} | ||
|
||
extension RLMCollection { | ||
// Support Sequence-style enumeration | ||
public func makeIterator() -> RLMIterator<RLMObject> { | ||
return RLMIterator(collection: self) | ||
} | ||
} | ||
|
||
extension RLMCollection { | ||
// Swift query convenience functions | ||
public func indexOfObject(where predicateFormat: String, _ args: CVarArg...) -> UInt { | ||
return indexOfObject(with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) | ||
} | ||
|
||
public func objects(where predicateFormat: String, _ args: CVarArg...) -> RLMResults<NSObject> { | ||
return objects(with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) as! RLMResults<NSObject> | ||
} | ||
} | ||
|
||
// MARK: - Sync-related | ||
extension RLMSyncManager { | ||
public static var shared: RLMSyncManager { | ||
return __shared() | ||
} | ||
} | ||
|
||
extension RLMSyncUser { | ||
public static var current: RLMSyncUser? { | ||
return __current() | ||
} | ||
|
||
public static var all: [String: RLMSyncUser] { | ||
return __allUsers() | ||
} | ||
|
||
@nonobjc public var errorHandler: RLMUserErrorReportingBlock? { | ||
get { | ||
return __errorHandler | ||
} | ||
set { | ||
__errorHandler = newValue | ||
} | ||
} | ||
|
||
public static func logIn(with credentials: RLMSyncCredentials, | ||
server authServerURL: URL, | ||
timeout: TimeInterval = 30, | ||
callbackQueue queue: DispatchQueue = DispatchQueue.main, | ||
onCompletion completion: @escaping RLMUserCompletionBlock) { | ||
return __logIn(with: credentials, | ||
authServerURL: authServerURL, | ||
timeout: timeout, | ||
callbackQueue: queue, | ||
onCompletion: completion) | ||
} | ||
} | ||
|
||
extension RLMSyncSession { | ||
public func addProgressNotification(for direction: RLMSyncProgressDirection, | ||
mode: RLMSyncProgressMode, | ||
block: @escaping RLMProgressNotificationBlock) -> RLMProgressNotificationToken? { | ||
return __addProgressNotification(for: direction, | ||
mode: mode, | ||
block: block) | ||
} | ||
} | ||
|
||
extension RLMNotificationToken { | ||
@available(*, unavailable, renamed: "invalidate()") | ||
@nonobjc public func stop() { fatalError() } | ||
} |
Oops, something went wrong.