Skip to content

Commit cea3386

Browse files
committed
Updated the README.
1 parent 3d4b61f commit cea3386

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

README.md

+18-11
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ ParseModel-iOS
33

44
Hassel-free data models for the Parse iOS SDK.
55

6+
The `ParseModel` class automatically maps the properties of your subclass to entries in an underlying `PFObject` and handles any neccesary conversions (e.g. if yuor property is an `int` it is converted to an `NSNumber` for storage).
7+
68
## Why ParseModel?
79

810
[Parse](https://parse.com/) is a cloud backend as-a-service (or BaaS) that allows developers to quickly get their apps up and running with little or no backend setup.
911

1012
More often than not, we developers like to work with out own classes and not use the out-of-the-box data models that come with many of these services. Regardless of our approach there comes a time when we need to map the properties of our objects to the backend object. Sometimes we accomplish this by overriding the getters and setters of our properties like this:
1113

12-
```
14+
```obc-c
1315
@interface MyObject : NSObject
1416
1517
@property (nonatomic, strong) NSString *someString;
@@ -31,11 +33,11 @@ More often than not, we developers like to work with out own classes and not use
3133
}
3234
3335
@end
34-
```
36+
```
3537

3638
The benefits to this approach is that we can define an Objective-C `protocol` to house these properties and have our model objects conform to this protocol:
3739

38-
```
40+
```obc-c
3941
@interface MyObject : NSObject <MyObjectProtocol>
4042
@property (nonatomic, strong) PFObject *parseObject;
4143
@end
@@ -49,7 +51,7 @@ Now in our app code, we can just deal with `id<MyObjectProtocol>` pointers inste
4951

5052
Setting up models like this, however, can be time consuming. Nobody likes typing out getters/setters, creating lots of static keys, etc.
5153

52-
This is where ParseModel comes in.
54+
*This is where ParseModel comes in.*
5355

5456

5557
## What does ParseModel do?
@@ -61,7 +63,7 @@ Parse Model was based off an idea from [CouchCocoa](https://github.com/couchbase
6163
Here's an example:
6264

6365

64-
```
66+
```obc-c
6567
@interface MyObject : ParseModel
6668
6769
@property (nonatomic, strong) NSString *someString;
@@ -85,30 +87,35 @@ Here's an example:
8587

8688
Afer declaring the `MyObject` class above we can do things like this:
8789

88-
```
89-
MyObject *myObject = [[MyObject alloc] init];
90+
```obc-c
91+
MyObject *myObject = [MyObject parseModel];
9092
myObject.someString = @"Hello there";
9193
[myObject.parseObject saveInBackground];
9294
```
9395

9496
When `someString` is set it is automatically mapped to the underlying `PFObject`.
9597

96-
Lastly, you can created models with the following ParseModel method:
98+
Lastly, you can created models with existing the following method:
9799

98-
```
100+
```obc-c
99101
+ (id)modelWithParseObject:(PFObject *)parseObject;
100102
```
101103

104+
#### Using ParseModelUser
105+
106+
A `PFUser` flavored object is also available called `ParseModelUser`.
107+
102108
## Installing
103109

104-
I've created a [CocoaPods](http://cocoapods.org/) podspec here but some of the dependencies seem to be acting up at the moment. Seems like an small outage on Github's side. When I'm able to test I'll push the podspec to the specs repo. For now, just copy the files in the **ParseModel** folder into your project.
110+
I've created a [CocoaPods](http://cocoapods.org/) podspec. I'm currently submitting it to the official specs repo so if you are reading this just point your podfile here.
105111

106112
## Limitations
107113

108114
ParseModel currently works with all types that `PFObject` [supports](https://parse.com/docs/ios_guide#objects-types/iOS). This means don't try using a UIImage and expect it to work! If you need to store UIImage data (or something that is unsupported) you have a few alternatives:
109115

110116
1. Don't declare the `property` as `dynamic` and write your own code to handle that particular `property`.
111-
2. Use `PFFile`.
117+
2. Use `PFFile`'s for images.
118+
3. `PFGeoPoint`'s are not yet supported. (Would be easy to add…)
112119
3. Fork this repo and add support for serializing your object type to JSON :)
113120

114121
## How does this work?

0 commit comments

Comments
 (0)