测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布最后发布 | 2015年5月 |
由 Fabian Canas 维护。
依赖关系 | |
SafeCast | ~> 1.1.1 |
FXKeychain | ~> 1.5.2 |
身份验证和网路处理,以便您可以在 RESTful API 中存储模型。
// Configure a network client
FFCNetworkClient *networkClient = [[FFCNetworkClient alloc] initWithHost:@"api.example.com" path:@"v1"];
[networkClient makeDefaultClient];
// Get some models
FFCNetworkStore *networkStore = [[FFCNetworkStore alloc] init];
[networkStore getClass:[Foo class] completion:^(NSArray *foos, NSError *error) {
// we have foos
}];
可进行 CRUD 操作的模型类只需实现一个简单的协议
@protocol FFCStoreModel <NSObject>
@property (nonatomic, assign) NSInteger id; // remote id
- (NSString *)route; // route for instance
+ (NSString *)route; // route for class
- (NSDictionary *)asJSON; // Serialize into dictionary if class is POST/PUTable
@end