NSRails alternatives and similar libraries
Based on the "Networking" category.
Alternatively, view NSRails alternatives based on common mentions on social networks and blogs.
-
AFNetworking
A delightful networking framework for iOS, macOS, watchOS, and tvOS. -
CocoaAsyncSocket
Asynchronous socket networking library for Mac and iOS -
RestKit
RestKit is a framework for consuming and modeling RESTful web resources on iOS and OS X -
YTKNetwork
YTKNetwork is a high level request util based on AFNetworking. -
Reachability.swift
Replacement for Apple's Reachability re-written in Swift with closures -
ASIHTTPRequest
Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone -
apollo-ios
📱 A strongly-typed, caching GraphQL client for iOS, written in Swift. -
swift-protobuf
Plugin and runtime library for using protobuf with Swift -
RealReachability
We need to observe the REAL reachability of network. That's what RealReachability do. -
Netfox
A lightweight, one line setup, iOS / OSX network debugging library! 🦊 -
MonkeyKing
MonkeyKing helps you to post messages to Chinese Social Networks. -
SwiftHTTP
Thin wrapper around NSURLSession in swift. Simplifies HTTP requests. -
APIKit
Type-safe networking abstraction layer that associates request type with response type. -
ResponseDetective
Sherlock Holmes of the networking layer. :male_detective: -
Networking
Easy HTTP Networking in Swift a NSURLSession wrapper with image caching support -
XMNetworking
A lightweight but powerful network library with simplified and expressive syntax based on AFNetworking. -
Pitaya
🏇 A Swift HTTP / HTTPS networking library just incidentally execute on machines -
Reach
A simple class to check for internet connection availability in Swift. -
SOAPEngine
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app. -
Digger
Digger is a lightweight download framework that requires only one line of code to complete the file download task -
TWRDownloadManager
A modern download manager based on NSURLSession to deal with asynchronous downloading, management and persistence of multiple files. -
Restofire
Restofire is a protocol oriented networking client for Alamofire -
ws ☁️
⚠️ Deprecated - (in favour of Networking) :cloud: Elegantly connect to a JSON api. (Alamofire + Promises + JSON Parsing) -
EVURLCache
a NSURLCache subclass for handling all web requests that use NSURLRequest -
AFNetworking+RetryPolicy
Nice category that adds the ability to set the retry interval, retry count and progressiveness. -
MultiPeer
📱📲 A wrapper for the MultipeerConnectivity framework for automatic offline data transmission between devices -
AFNetworking-Synchronous
Synchronous requests for AFNetworking 1.x, 2.x, and 3.x
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of NSRails or a related project?
README
NSRails is a lightweight framework that makes mapping client-side objects to remote Rails objects a breeze, and calling CRUD operations and others super easy. It's accessible while also extremely flexible and customizable, to the point that it'll work with any RESTful server, not just Rails. Also, CoreData support is seamless.
Here's how easy it is to get started. Set the root URL of your app somewhere during launch:
NSRConfig.defaultConfig().rootURL = NSURL(string:"http://localhost:3000")
[NSRConfig defaultConfig].rootURL = [NSURL URLWithString:@"http://localhost:3000"];
Inherit model objects from NSRRemoteObject
, or NSRRemoteManagedObject
with CoreData:
@objc(Post) class Post : NSRRemoteObject {
var author: String
var content: String
var createdAt: NSDate
var responses: [Response]
}
@interface Post : NSRRemoteObject
@property (nonatomic, strong) NSString *author, *content;
@property (nonatomic, strong) NSDate *createdAt;
@property (nonatomic, strong) NSArray *responses;
@end
Note: @objc(<ClassName>)
is currently required for Swift so the class name bridges over nicely.
That's it! Instances inherit methods to remotely create, read, update, or destroy their corresponding remote object:
let post = Post()
post.author = "Me"
post.content = "Some text"
// POST /posts.json => {post:{author:"Me", content:"Some text"}}
post.remoteCreateAsync() { error in
...
}
post.content = "Changed!"
// PATCH /posts/1.json => {post:{author:"Me", content:"Changed!"}}
post.remoteUpdateAsync() { error in ... }
// Fetch any latest data for this post and update locally
// GET /posts/1.json
post.remoteFetchAsync() { error in ... }
// DELETE /posts/1.json
post.remoteDestroyAsync() { error in ... }
// GET /posts.json
Post.remoteAllAsync() { allPosts, error in ... }
// GET /posts/1.json
Post.remoteObjectWithID(1) { post, error in ... }
// Retrieve a collection based on an object
// GET /posts/1/responses.json
Response.remoteAllViaObject(post) { responses, error in ... }
A lot of behavior is customized via overrides. For instance, in the previous example, in order to populate a Post's responses
array with Response
objects automatically when a Post is retrieved, we have to specify the Response
class as the type for that property.
@implementation Post
//override
- (Class) nestedClassForProperty:(NSString *)property {
if ([property isEqualToString:@"response"]) {
return [Response class];
}
return [super nestedClassForProperty:property];
}
@end
(Sidenote: This is necessary for Objective-C of course, but at least in Swift, there's probably a good way to automatically infer the type from the generic specified in the array, which I haven't looked into it yet. Let me know if this is possible!)
See the documentation for more on what you can do with NSRails-charged classes, or the cookbook for quick NSRRemoteObject
override recipes.
NSRRequest
Requests themselves can be customized with query parameters (/?a=b&c=d
), additional HTTP headers, or to go to custom routes (i.e. for custom controller methods) using the NSRRequest class. The results of these requests can easily be converted from JSON into native model objects using inherited convenience methods such as +[MyClass objectWithRemoteDictionary:]
and +[MyClass objectsWithRemoteDictionaries:]
.
Support
- Documentation
- CoreData guide
- Cookbook with various override recipes
- [Issues](https//github.com/dingbat/nsrails/issues)
- Gitter, if you need any help, or just want to talk!
Installation
The best way to install NSRails is to use the Great CocoaPods. Add pod 'NSRails'
to your Podfile, or pod 'NSRails/CoreData'
if you're using CoreData.
- Getting started using NSRails with Ruby has been moved here.
- Also, autogenerate NSRails-ready classes from a Rails project.
Dependencies
- iOS 5.0+ / OS X 10.7+
- Automatic Reference Counting (ARC)
Credits
NSRails is written and maintained by Dan Hassin. A lot of it was inspired by the ObjectiveResource project, many thanks there!
http://nsrails.com – an open forum -type thing running on Rails/Heroku and powered by the included NSRails demo app!