Skip to content

Commit

Permalink
Updated Realm
Browse files Browse the repository at this point in the history
  • Loading branch information
insidegui committed Nov 19, 2015
1 parent c315e9e commit 1929242
Show file tree
Hide file tree
Showing 22 changed files with 261 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Realm.framework/Versions/A/Headers/RLMConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ typedef NS_ENUM(int32_t, RLMPropertyType) {
RLMPropertyTypeInt = 0,
/** Boolean type: BOOL, bool, Bool (Swift) */
RLMPropertyTypeBool = 1,
/** Float type: CGFloat (32bit), float, Float (Swift) */
/** Float type: float, Float (Swift) */
RLMPropertyTypeFloat = 9,
/** Double type: CGFloat (64bit), double, Double (Swift) */
/** Double type: double, Double (Swift) */
RLMPropertyTypeDouble = 10,

////////////////////////////////
Expand Down
8 changes: 8 additions & 0 deletions Realm.framework/Versions/A/Headers/RLMDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,11 @@ typedef RLMObject * RLMObjectArgument;
#else
# define RLM_NOESCAPE
#endif

#pragma mark - Swift Availability

#if defined(NS_SWIFT_UNAVAILABLE)
# define RLM_SWIFT_UNAVAILABLE(msg) NS_SWIFT_UNAVAILABLE(msg)
#else
# define RLM_SWIFT_UNAVAILABLE(msg)
#endif
16 changes: 11 additions & 5 deletions Realm.framework/Versions/A/Headers/RLMObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ RLM_ASSUME_NONNULL_BEGIN
### Supported property types
- `NSString`
- `NSInteger`, `CGFloat`, `int`, `long`, `float`, and `double`
- `NSInteger`, `int`, `long`, `float`, and `double`
- `BOOL` or `bool`
- `NSDate`
- `NSData`
- `NSNumber<X>`, where X is one of RLMInt, RLMFloat, RLMDouble or RLMBool, for optional number properties
- `RLMObject` subclasses, so you can have many-to-one relationships.
- `RLMArray<X>`, where X is an `RLMObject` subclass, so you can have many-to-many relationships.
Expand Down Expand Up @@ -232,6 +233,9 @@ RLM_ASSUME_NONNULL_BEGIN

/**
Indicates if an object can no longer be accessed.
An object can no longer be accessed if the object has been deleted from the containing `realm` or
if `invalidate` is called on the containing `realm`.
*/
@property (nonatomic, readonly, getter = isInvalidated) BOOL invalidated;

Expand Down Expand Up @@ -279,11 +283,13 @@ RLM_ASSUME_NONNULL_BEGIN
Implement to return an array of property names that should not allow storing nil.
By default, all properties of a type that support storing nil are considered optional properties.
To require that an object in a Realm always have a non-nil value for a property, add the name of the property to the array returned from this method.
Currently only String, Data, and Object properties support storing nil, and all other properties are implicitly treated as if they were required properties.
Support for additional types will come in the future.
To require that an object in a Realm always have a non-nil value for a property,
add the name of the property to the array returned from this method.
Currently Object properties cannot be required. Array and NSNumber properties
can, but it makes little sense to do so: arrays do not support storing nil, and
if you want a non-optional number you should instead use the primitive type.
@return NSArray of property names that are required.
*/
+ (NSArray *)requiredProperties;
Expand Down
12 changes: 12 additions & 0 deletions Realm.framework/Versions/A/Headers/RLMProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@

RLM_ASSUME_NONNULL_BEGIN

@protocol RLMInt
@end
@protocol RLMBool
@end
@protocol RLMDouble
@end
@protocol RLMFloat
@end

@interface NSNumber ()<RLMInt, RLMBool, RLMDouble, RLMFloat>
@end

/**
This class models properties persisted to Realm in an RLMObjectSchema.
Expand Down
36 changes: 34 additions & 2 deletions Realm.framework/Versions/A/Headers/RLMRealm.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ RLM_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, readonly) RLMRealmConfiguration *configuration;

/**
Indicates if this Realm contains any objects.
*/
@property (nonatomic, readonly) BOOL isEmpty;

/**---------------------------------------------------------------------------------------
* @name Default Realm Path
* ---------------------------------------------------------------------------------------
Expand Down Expand Up @@ -305,7 +310,22 @@ typedef void(^RLMNotificationBlock)(NSString *notification, RLMRealm *realm);
Calling this when not in a write transaction will throw an exception.
*/
- (void)commitWriteTransaction;
- (void)commitWriteTransaction RLM_SWIFT_UNAVAILABLE("");

/**
Commits all writes operations in the current write transaction.
After this is called the `RLMRealm` reverts back to being read-only.
Calling this when not in a write transaction will throw an exception.
@param error If an error occurs, upon return contains an `NSError` object
that describes the problem. If you are not interested in
possible errors, pass in `NULL`.
@return Whether the transaction succeeded.
*/
- (BOOL)commitWriteTransaction:(NSError **)error;

/**
Revert all writes made in the current write transaction and end the transaction.
Expand Down Expand Up @@ -337,7 +357,19 @@ typedef void(^RLMNotificationBlock)(NSString *notification, RLMRealm *realm);
/**
Helper to perform a block within a transaction.
*/
- (void)transactionWithBlock:(void(^)(void))block;
- (void)transactionWithBlock:(void(^)(void))block RLM_SWIFT_UNAVAILABLE("");

/**
Helper to perform a block within a transaction.
@param block The block to perform.
@param error If an error occurs, upon return contains an `NSError` object
that describes the problem. If you are not interested in
possible errors, pass in `NULL`.
@return Whether the transaction succeeded.
*/
- (BOOL)transactionWithBlock:(void(^)(void))block error:(NSError **)error;

/**
Update an `RLMRealm` and outstanding objects to point to the most recent data for this `RLMRealm`.
Expand Down
1 change: 1 addition & 0 deletions Realm.framework/Versions/A/Modules/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ framework module Realm {
header "RLMObjectSchema_Private.h"
header "RLMObjectStore.h"
header "RLMObject_Private.h"
header "RLMOptionalBase.h"
header "RLMProperty_Private.h"
header "RLMRealmUtil.h"
header "RLMRealm_Private.h"
Expand Down
5 changes: 4 additions & 1 deletion Realm.framework/Versions/A/PrivateHeaders/RLMAccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ RLM_ASSUME_NONNULL_BEGIN
Class RLMAccessorClassForObjectClass(Class objectClass, RLMObjectSchema *schema, NSString *prefix);
Class RLMStandaloneAccessorClassForObjectClass(Class objectClass, RLMObjectSchema *schema);

// Check if a given class is a generated accessor class
bool RLMIsGeneratedClass(Class cls);

//
// Dynamic getters/setters
//
Expand All @@ -46,7 +49,7 @@ FOUNDATION_EXTERN RLMProperty *RLMValidatedGetProperty(RLMObjectBase *obj, NSStr
FOUNDATION_EXTERN id __nullable RLMDynamicGet(RLMObjectBase *obj, RLMProperty *prop);

// by property/column
void RLMDynamicSet(RLMObjectBase *obj, RLMProperty *prop, id val, RLMCreationOptions options);
FOUNDATION_EXTERN void RLMDynamicSet(RLMObjectBase *obj, RLMProperty *prop, id val, RLMCreationOptions options);

//
// Class modification
Expand Down
2 changes: 1 addition & 1 deletion Realm.framework/Versions/A/PrivateHeaders/RLMObjectStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ RLMObjectBase *RLMCreateObjectAccessor(RLMRealm *realm,
NSUInteger index) NS_RETURNS_RETAINED;

// switch List<> properties from being backed by standalone RLMArrays to RLMArrayLinkView
void RLMInitializeSwiftListAccessor(RLMObjectBase *object);
void RLMInitializeSwiftAccessorGenerics(RLMObjectBase *object);

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ FOUNDATION_EXTERN const NSUInteger RLMDescriptionMaxDepth;
+ (NSArray *)getGenericListPropertyNames:(id)obj;
+ (void)initializeListProperty:(RLMObjectBase *)object property:(RLMProperty *)property array:(RLMArray *)array;

+ (NSArray *)getOptionalPropertyNames:(id)obj;
+ (NSDictionary *)getOptionalProperties:(id)obj;
+ (NSArray *)requiredPropertiesForClass:(Class)cls;

@end
34 changes: 34 additions & 0 deletions Realm.framework/Versions/A/PrivateHeaders/RLMOptionalBase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2015 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 <Foundation/Foundation.h>
#import <Realm/RLMConstants.h>

@class RLMObjectBase, RLMProperty;

@interface RLMOptionalBase : NSProxy

- (instancetype)init;

@property (nonatomic, weak) RLMObjectBase *object;

@property (nonatomic, unsafe_unretained) RLMProperty *property;

@property (nonatomic) id underlyingValue;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@class RLMObjectBase;

FOUNDATION_EXTERN BOOL RLMPropertyTypeIsNullable(RLMPropertyType propertyType);
FOUNDATION_EXTERN BOOL RLMPropertyTypeIsNumeric(RLMPropertyType propertyType);

// private property interface
@interface RLMProperty ()
Expand All @@ -40,6 +41,10 @@ FOUNDATION_EXTERN BOOL RLMPropertyTypeIsNullable(RLMPropertyType propertyType);
ivar:(Ivar)ivar
objectClassName:(NSString *)objectClassName;

- (instancetype)initSwiftOptionalPropertyWithName:(NSString *)name
ivar:(Ivar)ivar
propertyType:(RLMPropertyType)propertyType;

// private setters
@property (nonatomic, assign) NSUInteger column;
@property (nonatomic, readwrite, assign) RLMPropertyType type;
Expand All @@ -49,8 +54,9 @@ FOUNDATION_EXTERN BOOL RLMPropertyTypeIsNullable(RLMPropertyType propertyType);

// private properties
@property (nonatomic, assign) char objcType;
@property (nonatomic, copy) NSString *objcRawType;
@property (nonatomic, assign) BOOL isPrimary;
@property (nonatomic, assign) Ivar swiftListIvar;
@property (nonatomic, assign) Ivar swiftIvar;

// getter and setter names
@property (nonatomic, copy) NSString *getterName;
Expand Down
4 changes: 4 additions & 0 deletions Realm.framework/Versions/A/PrivateHeaders/RLMRealm_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ FOUNDATION_EXTERN NSData *RLMRealmValidatedEncryptionKey(NSData *key);

FOUNDATION_EXTERN void RLMRealmSetEncryptionKeyForPath(NSData *encryptionKey, NSString *path);

FOUNDATION_EXTERN NSUInteger RLMRealmSchemaVersionForPath(NSString *path);
FOUNDATION_EXTERN RLMMigrationBlock RLMRealmMigrationBlockForPath(NSString *path);
FOUNDATION_EXTERN void RLMRealmSetSchemaVersionForPath(uint64_t version, NSString *path, RLMMigrationBlock migrationBlock);

FOUNDATION_EXTERN void RLMRealmAddPathSettingsToConfiguration(RLMRealmConfiguration *configuration);
Expand Down Expand Up @@ -86,4 +88,6 @@ FOUNDATION_EXTERN void RLMRealmAddPathSettingsToConfiguration(RLMRealmConfigurat
- (void)registerEnumerator:(RLMFastEnumerator *)enumerator;
- (void)unregisterEnumerator:(RLMFastEnumerator *)enumerator;

+ (NSString *)writeableTemporaryPathForFile:(NSString *)fileName;

@end
Binary file modified Realm.framework/Versions/A/Realm
Binary file not shown.
80 changes: 80 additions & 0 deletions Realm.framework/Versions/A/Resources/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
0.96.2 Release notes (2015-10-26)
=============================================================

Prebuilt frameworks are now built with Xcode 7.1.

### Bugfixes

* Fix ignoring optional properties in Swift.
* Fix CocoaPods installation on case-sensitive file systems.

0.96.1 Release notes (2015-10-20)
=============================================================

### Bugfixes

* Support assigning `Results` to `List` properties via KVC.
* Honor the schema version set in the configuration in `+[RLMRealm migrateRealm:]`.
* Fix crash when using optional Int16/Int32/Int64 properties in Swift.

0.96.0 Release notes (2015-10-14)
=============================================================

* No functional changes since beta2.

0.96.0-beta2 Release notes (2015-10-08)
=============================================================

### Bugfixes

* Add RLMOptionalBase.h to the podspec.

0.96.0-beta Release notes (2015-10-07)
=============================================================

### API breaking changes

* CocoaPods v0.38 or greater is now required to install Realm and RealmSwift
as pods.

### Enhancements

* Functionality common to both `List` and `Results` is now declared in a
`RealmCollectionType` protocol that both types conform to.
* `Results.realm` now returns an `Optional<Realm>` in order to conform to
`RealmCollectionType`, but will always return `.Some()` since a `Results`
cannot exist independently from a `Realm`.
* Aggregate operations are now available on `List`: `min`, `max`, `sum`,
`average`.
* Committing write transactions (via `commitWrite` / `commitWriteTransaction` and
`write` / `transactionWithBlock`) now optionally allow for handling errors when
the disk is out of space.
* Added `isEmpty` property on `RLMRealm`/`Realm` to indicate if it contains any
objects.
* The `@count`, `@min`, `@max`, `@sum` and `@avg` collection operators are now
supported in queries.

### Bugfixes

* Fix assertion failure when inserting NSData between 8MB and 16MB in size.
* Fix assertion failure when rolling back a migration which removed an object
link or `RLMArray`/`List` property.
* Add the path of the file being opened to file open errors.
* Fix a crash that could be triggered by rapidly opening and closing a Realm
many times on multiple threads at once.
* Fix several places where exception messages included the name of the wrong
function which failed.

0.95.3 Release notes (2015-10-05)
=============================================================

### Bugfixes

* Compile iOS Simulator framework architectures with `-fembed-bitcode-marker`.
* Fix crashes when the first Realm opened uses a class subset and later Realms
opened do not.
* Fix inconsistent errors when `Object(value: ...)` is used to initialize the
default value of a property of an `Object` subclass.
* Throw an exception when a class subset has objects with array or object
properties of a type that are not part of the class subset.

0.95.2 Release notes (2015-09-24)
=============================================================

Expand Down
4 changes: 2 additions & 2 deletions Realm.framework/Versions/A/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.95.2</string>
<string>0.96.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.95.2</string>
<string>0.96.2</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
Expand Down
14 changes: 7 additions & 7 deletions Realm.framework/Versions/A/Resources/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,15 @@ EXPORT COMPLIANCE
You understand that the Software may contain cryptographic functions that may be
subject to export restrictions, and you represent and warrant that you are not
located in a country that is subject to United States export restriction or embargo,
including Cuba, Iran, North Korea, Sudan, or Syria, and that you are not on the
Department of Commerce list of Denied Persons, Unverified Parties, or affiliated
with a Restricted Entity.
including Cuba, Iran, North Korea, Sudan, Syria or the Crimea region, and that you
are not on the Department of Commerce list of Denied Persons, Unverified Parties,
or affiliated with a Restricted Entity.

You agree to comply with all export, re-export and import restrictions and
regulations of the Department of Commerce or other agency or authority of the
United States or other applicable countries. You also agree not to transfer, or
authorize the transfer of, directly or indirectly, the Software to any prohibited
country, including Cuba, Iran, North Korea, Sudan, or Syria, or to any person or
organization on or affiliated with the Department of Commerce lists of Denied
Persons, Unverified Parties or Restricted Entities, or otherwise in violation of any
such restrictions or regulations.
country, including Cuba, Iran, North Korea, Sudan, Syria or the Crimea region,
or to any person or organization on or affiliated with the Department of
Commerce lists of Denied Persons, Unverified Parties or Restricted Entities, or
otherwise in violation of any such restrictions or regulations.
Loading

0 comments on commit 1929242

Please sign in to comment.