ROAD – Rapid Objective-C Applications Development

Overview

License Platform Version Coverage Status Build Status

A set of reusable components taking advantage of extra dimension 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<RFWebServiceCancellable>)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 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:

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.

Documentation

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

Classes reference is available in cocoadocs.org

License

ROAD is made available under the terms of the BSD-3. 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.
Comments
  • Web response caching

    Web response caching

    • Supports native http cache header(Last-Modified, ETag, Pragma, Cache-Control)
    • Added attribute RFWebServiceCache to override default bevaiour
    • Direct access to Cache manager to get, set or drop cache manually
    opened by yuriy-tolstoguzov 13
  • Attempt to fix the arm64 issue (#241) for the variadic argument list.

    Attempt to fix the arm64 issue (#241) for the variadic argument list.

    forwardInvocation is used instead of resolveInstanceMethod in the RFWebServiceClient (DynamicMethod). Also the dynamicWebServiceCall:... was replaced to avoid using va_args with - dynamicWebServiceCallWithArguments:forInvocation:

    Additional testing is needed.

    opened by sandor-gazdag 4
  • Added the import of Foundation.h to .h files

    Added the import of Foundation.h to .h files

    Xcode 6 doesn't create .pch file by default so there isn't the import of Foundation. The empty projects with ROAD pod don't work. Also you can delete .pch file from iTunes example project and the project will not run.

    opened by dydus0x14 3
  • Difficult to add a new library dependency to the project with CocoaPods

    Difficult to add a new library dependency to the project with CocoaPods

    It is not easy and leads to unexpected consequences if a new developer adds a library dependency with CocoaPods. Usual patterns do not work here and newcomer waste a lot of time guessing what happens. Post install hook should be fixed.

    invalid 
    opened by AlexeyAfanasyev 3
  • Created new parameter syncCall for RFWebServiceCall attribute

    Created new parameter syncCall for RFWebServiceCall attribute

    Created new parameter syncCall for RFWebServiceCall attribute that force web service request to perform synchronously with the thread it was created from.

    opened by AlexeyAfanasyev 3
  • Updating Serialisation documentation. Added multiplier for unixTimestamp.

    Updating Serialisation documentation. Added multiplier for unixTimestamp.

    Added multiplier for unixTimestamp. Now we can serialise date without custom code that had to divide unix timestamp by 1000, so objc methods can transform it to date properly

    opened by yuriy-tolstoguzov 3
  • SFWebServiceClient: Requirements to blocks

    SFWebServiceClient: Requirements to blocks

    I propose to change the requirements for blocks (success, failure) for web client. I consider that some blocks can be a optional. We shouldn't force realize all blocks, because It's depend on requirements for request. Also I see that if we try to set nil for block, we will receive a error with non-obvious explanation.

    We need to discuss this point.

    enhancement 
    opened by edl00k 3
  • WebService request queue

    WebService request queue

    _User story_: I as user want to add have option to add some web service calls to queue.

    _Possible implementation_:

    New class: RFWebServiceQueue (queueId, requests, sync/async and so on) New parameter for RFWebServiceCall attribute: queueId. In case web service call method contains this parameter, it will be added to queue with specified id instead of direct launching.

    enhancement WebService 
    opened by yuriy-tolstoguzov 0
Releases(1.4.3)
  • 1.4.3(Mar 8, 2015)

    Changelog:

    • Added ROAD Class generator for easy generation of model classes from json. Thanks to @Arkadiy-Tsoy
    • Added Foundation framework explicit imports. Thanks to @dydus0x14
    • Added namespace support for xml serialization. Thanks to @ptiz
    • Added new interface method for json coder and encoder.
    Source code(tar.gz)
    Source code(zip)
  • 1.4.2(Nov 23, 2014)

  • 1.4.1(Nov 6, 2014)

    Changelog:

    • Added local simian check to ROAD workspace. Thanks to @Arkadiy-Tsoy
    • Fixed xml deserialization issues with non Latin-1 charset. Thanks to @AlexeyAfanasyev
    • Added simple way for retrieving header fields from http response. Thanks to @Arkadiy-Tsoy
    • Test fix for thread-safety of RFServiceProvider. Thanks to @Arkadiy-Tsoy
    Source code(tar.gz)
    Source code(zip)
  • 1.4.0-beta2(Sep 30, 2014)

  • 1.4.0-beta(Sep 27, 2014)

    It's pre-release version for 1.4.0. With hot fix of handing web service cache.

    Changelog:

    • ROADWebService.md was updated. Thanks to @Arkadiy-Tsoy
    • Authentication provider now should return cancelable protocol for multistep or other heavy authentications. Thanks to @AlexeyAfanasyev
    • Fixed deserialization behavior for empty json structures. Thanks to @Aledor
    • Separating Web Service unit tests from integration tests. Thanks to @Arkadiy-Tsoy
    • Fixing rare problem with losing result of NSInvocation in WebService component. Thanks to @ptiz
    • Fixing rare race condition in WebService cache manager that leads to network freeze. Thanks to @ptiz
    Source code(tar.gz)
    Source code(zip)
  • 1.3.8(Aug 10, 2014)

    Changelog:

    • Small refactoring of Core component. Thanks to @ptiz
    • -concurentAuthentication added to public method for subclassing
    • Implemented synchronous call to web service with attribute parameter syncCall (RFWebServiceCall). Thanks to @AlexeyAfanasyev
    • Added progress block support with parameter progressBlockParameter(RFWebServiceCall). Thanks to @ArkadiyTsoy
    • All methods can send body now. PUT and POST use auto-detection for that (any that can be send in http body, will be sent).
    Source code(tar.gz)
    Source code(zip)
  • 1.3.7(Jul 21, 2014)

    Changelog:

    • Default NSURLCaching is completely disabled, ROAD Caching will work instead;
    • Web Service Caching moved to private queue, no more operation on UI thread;
    • Small performance optimization for Web Service Caching (thanks to @Pitsko);
    • Adding missing headers to common compound headers for web service and serialization components.
    Source code(tar.gz)
    Source code(zip)
  • 1.3.6(Jun 16, 2014)

    Changelog:

    • Fixing crash of deserialization when data is nil;
    • Implemented the way for providing cache when ROAD can't validate it, so called offlineCaching;
    • Adding logging for cases when web response was provided by cache manager;
    • Fixing returning result when cached response is valid (not expired) and app is in offline.
    Source code(tar.gz)
    Source code(zip)
  • 1.3.5(Jun 6, 2014)

  • 1.3.4(Jun 2, 2014)

    Changelog:

    • Added performance tests for reflection and attributes
    • Fixed date serialization unixTimestamp range. Now it covers full NSTimeInterval range. #304
    • Serialization block preprocessor is available for NSDate. #303
    • Added logging for HTTPBody when connection is going start.
    Source code(tar.gz)
    Source code(zip)
  • 1.3.3(May 17, 2014)

    Changelog:

    • Giving the possibility to include an additional request processor in the dynamic method based web service invocation chain (by @BalazsGollner);
    • Added property preprocessor block support for JSON serialization.
    Source code(tar.gz)
    Source code(zip)
  • 1.3.2(Apr 14, 2014)

  • 1.3.1(Apr 6, 2014)

    Changelog:

    Major:

    • Added cancel with reason functionality.
    • Added options for encoding and allowed charset for URL builder attribute.

    Minor:

    • Removed all Mac targets and associated files.
    • Fixed custom serialization of booleans on some iOS versions.
    • Fixed double invocation of failure block when canceling sometimes.
    • Fixing all Xcode 5.1 warnings
    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Mar 16, 2014)

    Changelog:

    Major:

    • Removed Logger(will be distributed in separated repo) and Observation components
    • Attribute and Reflection functionality moved to different repo (https://github.com/epam/lib-obj-c-attr)
    • New logging approach (via preprocessor macros, see - Documents/Logging.md)
    • Added example project (Examples/iTunesSearch)

    Minor:

    • Added cache identifier (WebService) to manage cache entries
    • Added class name serialization option via attributes
    • Added option for unix timestamp multiplication.
    • RFWebServiceHeader attribute is available for web service client class (shared headers for web client)
    • XML serialization uses date formatter too now
    • Documentation updates (Services, WebService, Serialization)
    • NSDictionary - key subscript fix for iOS < 6
    • Fixing formatting of some files
    • Added aggregation target for local OCLint check
    • Fixing serialization tests which sometime failed
    • Small fix in OData possible operation
    Source code(tar.gz)
    Source code(zip)
  • 1.2.1(Jan 23, 2014)

  • 1.2.0(Dec 27, 2013)

Owner
EPAM Systems
Better software and stronger communities are only possible when technology is accessible to everyone.
EPAM Systems
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Perfect: Server-Side Swift 简体中文 Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

PerfectlySoft Inc. 13.9k Jan 6, 2023
🌏 A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications.

A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications. ?? TermiNetwork was tested in a produc

Bill Panagiotopoulos 90 Dec 17, 2022
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines.

Why Zewo? • Support • Community • Contributing Zewo Zewo is a lightweight library for web applications in Swift. What sets Zewo apart? Zewo is not a w

Zewo 1.9k Dec 22, 2022
Frank is a DSL for quickly writing web applications in Swift

Frank Frank is a DSL for quickly writing web applications in Swift with type-safe path routing. Sources/main.swift import Frank // Handle GET request

Kyle Fuller Archive 377 Jun 29, 2022
Swift implementation of WalletConnect v.2 protocol for native iOS applications

Wallet Connect v.2 - Swift Swift implementation of WalletConnect v.2 protocol for native iOS applications. Requirements iOS 13 XCode 13 Swift 5 Usage

WalletConnect 142 Jan 4, 2023
A resource based, protocol oriented networking library designed for pure-SwiftUI applications.

Monarch ?? - WIP A resource based, protocol oriented networking library designed for pure-SwiftUI applications. Features: Async/Await Resource Based P

Emilio Pelaez Romero 4 Oct 17, 2022
Login-screen-using-Swift - Firebase Apple Open Source Development

Firebase Apple Open Source Development This repository contains all Apple platfo

Kushal Shingote 1 Feb 3, 2022
A conforming Objective-C WebSocket client library.

SocketRocket A conforming WebSocket (RFC 6455) client library for iOS, macOS and tvOS. Test results for SocketRocket here. You can compare to what mod

Facebook Incubator 9.4k Dec 27, 2022
Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone

ASIHTTPRequest is an easy to use wrapper around the CFNetwork API that makes some of the more tedious aspects of communicating with web servers easier

Ben Copsey 5.8k Dec 14, 2022
Happy DNS for Objective-C

Happy DNS for Objective-C 用途 调用系统底层Dns解析库,可以使用114 等第三方dns解析,可以使用 Doh 协议的 Dns 解析方案,也可以集成dnspod等httpdns。另外也有丰富的hosts 域名配置。 安装 通过CocoaPods pod "HappyDNS"

Qiniu Cloud 475 Dec 28, 2022
FakeGithub is an iOS application written using Objective-C

FakeGithub FakeGithub is an iOS application written using Objective-C. Opensource this project for learning purpose. Hope this could be a little usefu

FakeCoder 5 Oct 12, 2022
A Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and other native frameworks.

ZamzamKit ZamzamKit is a Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and othe

Zamzam Inc. 261 Dec 15, 2022
A light weight network library with automated model parser for rapid development

Gem A light weight network library with automated model parser for rapid development. Managing all http request with automated model parser calls in a

Albin CR 10 Nov 19, 2022
Effective DI library for rapid development in 200 lines of code.

Effective DI library for rapid development in 200 lines of code.

Tinkoff.ru 100 Sep 16, 2022
JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally used to hotfix iOS App.

JSPatch 中文介绍 | 文档 | JSPatch平台 请大家不要自行接入 JSPatch,统一接入 JSPatch 平台,让热修复在一个安全和可控的环境下使用。原因详见 这里 JSPatch bridges Objective-C and JavaScript using the Object

bang 11.4k Jan 1, 2023
Magical Data Modeling Framework for JSON - allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS and tvOS apps.

JSONModel - Magical Data Modeling Framework for JSON JSONModel allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS

JSONModel 6.9k Dec 8, 2022
Magical Data Modeling Framework for JSON - allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS and tvOS apps.

JSONModel - Magical Data Modeling Framework for JSON JSONModel allows rapid creation of smart data models. You can use it in your iOS, macOS, watchOS

JSONModel 6.8k Nov 19, 2021
Flexible JSON traversal for rapid prototyping

RBBJSON RBBJSON enables flexible JSON traversal at runtime and JSONPath-like que

Robb Böhnke 164 Dec 27, 2022
A rapid prototype of UISwitch built with Swift and PaintCode.

LTJelloSwitch A cute UISwitch prototype built in about 8 hours. One of my co-worker gave me this concept last year. It was written in Objective-C and

Lex Tang 366 Aug 5, 2022
A guide on setting up Xcode with all the essential Applications, Tools, and Frameworks to make your development experience with Xcode great!

A guide on setting up Xcode with all the essential Applications, Tools, and Frameworks to make your development experience with Xcode great!

Michael Royal 24 Jan 4, 2023