Latest 0.1.5
Homepage https://github.com/dmsl1805/Spider
License MIT
Platforms ios 8.0
Authors

[![CI Status](http://img.shields.io/travis/Dmitriy Shulzhenko/Spider.svg?style=flat)](https://travis-ci.org/Dmitriy Shulzhenko/Spider)
Version
License
Platform

Update your model more easily. With cleaner architecture in your project.

Example

//sends http request, handles response, deletes old data and writes a new one

self.spider.request().delete().write().execute()

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

To use Spider you have to conform these protocols

// This is your storage for any network responce
// Storage will be used to update model

@objc public protocol TempObjectStorageProtocol: class{}
// Entity object. Can be subclass of NSManagedObject, or smth else

@objc public protocol EntityProtocol {

@objc static var entityName: String { get }

// Entity that contains some data (NSData, Image, ets.)

@objc optional var dataRemoutePaths: [String] { get }

@objc optional var dataNames: [String] { get }

}
// Persistant storage controller. E.g. Core data stack controller or other.

@objc public protocol PersistentStorageControllerProtocol {

@objc optional func update(name: String, with objects: TempObjectStorageProtocol)

@objc optional func remove(name: String, new objects: TempObjectStorageProtocol)

@objc optional func fetchWithoutData(name: String) -> [EntityProtocol]?

@objc optional func write(data dataStore: [TempObjectStorageProtocol], completed:((_ error: Error?) -> Void))

//    @objc func delete(data named: String, completed:((_ error: Error?) -> Void))

@objc optional func get(data named: String) -> Data?

}
// Network manager

public typealias NetworkResponseBlock = (_ objects: TempObjectStorageProtocol? , _ error: Error? ) -> (Void)

@objc public protocol NetworkControllerProtocol {

@objc func executeRequest(_ request: URLRequest,
response: @escaping NetworkResponseBlock) -> URLSessionTask

}

Installation

Spider is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'Spider'

Author

Dmitriy Shulzhenko, [email protected]

License

Spider is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Spider",
    "version": "0.1.5",
    "summary": "Update models easily",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/dmsl1805/Spider",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Dmitriy Shulzhenko": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dmsl1805/Spider.git",
        "branch": "master",
        "tag": "0.1.5"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Spider/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This