Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/epam/road-ios-framework

ROAD – Rapid Objective-C Applications Development
https://github.com/epam/road-ios-framework

Last synced: about 1 month ago
JSON representation

ROAD – Rapid Objective-C Applications Development

Awesome Lists containing this project

README

        

[![License](https://cocoapod-badges.herokuapp.com/l/ROADFramework/badge.svg)](http://opensource.org/licenses/BSD-3-Clause)
[![Platform](https://cocoapod-badges.herokuapp.com/p/ROADFramework/badge.png)](https://github.com/epam/road-ios-framework/)
[![Version](https://cocoapod-badges.herokuapp.com/v/ROADFramework/badge.png)](https://github.com/epam/road-ios-framework/)
[![Coverage Status](http://img.shields.io/coveralls/epam/road-ios-framework/master.svg?style=flat)](https://coveralls.io/r/epam/road-ios-framework?branch=master)
[![Build Status](http://img.shields.io/travis/epam/road-ios-framework/master.svg?style=flat)](https://travis-ci.org/epam/road-ios-framework)

A set of reusable components taking advantage of extra dimension [Attribute-Oriented Programming](https://en.wikipedia.org/wiki/Attribute-oriented_programming) adds.

## Components

**Core** - support for attributes, reflection and helper-extensions on Foundation classes.
**Services** - implementation of Service Locator pattern, centralized replacement for singletons.
**Serialization** - attribute-based JSON and XML parsers for easy DOM (de)serializations.
**Web Services** - attribute-based HTTP client API.

## Snippet
Connection to the test HTTP server, that returns JSON from headers you send, could look as follows:

RF_ATTRIBUTE(RFWebService, serviceRoot = @"http://headers.jsontest.com/")
@interface JsonTestWebClient : RFWebServiceClient

RF_ATTRIBUTE(RFWebServiceCall, method = @"GET", prototypeClass = [MyWebServiceResponse class])
RF_ATTRIBUTE(RFWebServiceHeader, headerFields = @{@"Text" : @"A lot of text",
@"Number" : [@1434252.234 stringValue],
@"Date" : [[NSDate dateWithTimeIntervalSince1970:100000000] description]})
- (id)echoRequestHeadersAsJSONWithSuccess:(void(^)(MyWebServiceResponse result))successBlock failure:(void(^)(NSError *error))failureBlock;

@end

then we define the model:

RF_ATTRIBUTE(RFSerializable)
@interface MyWebServiceResponse : NSObject

RF_ATTRIBUTE(RFSerializable, serializationKey = @"Text")
@property NSString *text;

RF_ATTRIBUTE(RFSerializable, serializationKey = @"Number")
@property NSNumber *number;

RF_ATTRIBUTE(RFSerializable, serializationKey = @"Date")
RF_ATTRIBUTE(RFSerializableDate, format = @"yyyy-MM-dd HH:mm:ss Z")
@property NSDate *date;

@end

and make singleton instance of JsonTestWebClient accessible through RFServiceProvider:

@interface RFServiceProvider (JsonTestWebClient)

RF_ATTRIBUTE(RFService, serviceClass = [JsonTestWebClient class])
+ (JsonTestWebClient *)jsonTestWebClient;

@end

Now we can use it:

[[RFServiceProvider jsonTestWebClient] echoRequestHeadersAsJSONWithSuccess:^(MyWebServiceResponse *result) {
NSLog(@"%@", result);
} failure:^(NSError *error) {
NSLog(@"Something terrible happened! Here are details : %@", error);
}];

## Requirements

ROAD requires **iOS 5.0** and above. The compatibility with **4.3** and older is not tested.

ROAD initially designed to use **ARC**.

## Jump Start
[CocoaPods](http://cocoapods.org) is the only recommended way of ROAD integration. Besides the standard configuration of pod dependencies, pod_install hook is required as shown below. A typical Podfile will look as follows:

pod 'ROADFramework'

post_install do |installer|
require File.expand_path('ROADConfigurator.rb', './Pods/libObjCAttr/libObjCAttr/Resources/')
ROADConfigurator::post_install(installer)
end

**Note:**
If you want to get rid of warning from Xcodeproj gem, copy-paste and run in terminal next command before running `pod install`:

```shell
export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES
```

**Using components separately**
If you'd like to embed only specific components from the framework it can be done with CocoaPods as well.

pod 'ROADFramework/ROADServices'
pod 'ROADFramework/ROADWebService'

Detailed information on internals of ROAD integration as well as advanced topics like integration with predefined workspace, multiple projects or targets is available in [the documentation](./Documents/Configuration/Cocoapods.md).

## Documentation

User documentation for the following components is available in **Documents** folder:

* [Core](./Documents/ROADCore.md)
* [Services](./Documents/ROADServices.md)
* [Serialization](./Documents/ROADSerialization.md)
* [Web Services](./Documents/ROADWebService.md)

Classes reference is available in [cocoadocs.org](http://cocoadocs.org/docsets/ROADFramework/)

## License
ROAD is made available under the terms of the [BSD-3](http://opensource.org/licenses/BSD-3-Clause). Open the LICENSE file that accompanies this distribution in order to see the full text of the license.

## Contribution

There are three ways you can help us:

* **Raise an issue.** You found something that does not work as expected? Let us know about it.
* **Suggest a feature.** It's even better if you come up with a new feature and write us about it.
* **Write some code.** We would love to see more pull requests to our framework, just make sure you have the latest sources. For more information, check out [the guidelines for contributing](./Contributing.md).