GithubHelp home page GithubHelp logo

jashion / ytknetwork Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kanyun-inc/ytknetwork

0.0 2.0 0.0 1.06 MB

YTKNetwork is a high level request util based on AFNetworking.

License: MIT License

Ruby 0.59% Objective-C 99.41%

ytknetwork's Introduction

YTKNetwork

License MIT Pod version Carthage Compatible Platform info Build Status

What

YTKNetwork is is a high level request util based on AFNetworking. It's developed by the iOS Team of YuanTiKu. It provides a High Level API for network request.

YTKNetwork is used in all products of YuanTiKu, including: YuanTiKu, YuanSoTi, YuanFuDao, FenBiZhiBoKe.

中文说明

Features

  • Response can be cached by expiration time
  • Response can be cached by version number
  • Set common base URL and CDN URL
  • Validate JSON response
  • Resume download
  • block and delegate callback
  • Batch requests (see YTKBatchRequest)
  • Chain requests (see YTKChainRequest)
  • URL filter, replace part of URL, or append common parameter 
  • Plugin mechanism, handle request start and finish. A plugin for show "Loading" HUD is provided

Who

YTKNetowrk is suitable for a slightly more complex project, not for a simple personal project.

YTKNetwork is helpful if you want to cache requests, manage the dependences of requests, or validate the JSON response. And if you want to cache requests based on request version, this is one of the greatest advantages of YTKNetwork.

Why 

YTKNetwork provides YTKRequest to handle every network request. You should inherit it and override some methods to define custom requests in your project.

The main idea is use the Command Pattern. The benefits are:

  • Your code is decoupled to detail network request framework, it's easy to replace it. Actually, YTKNetwork is originally based on ASIHttpRequest, we just spent two days to switch to AFNetworking.
  • Handle common logic in base class.
  • Easier Persistence

But YTKNetwork is not suitable if your project is very simple. You can use AFNetworking directly in controller.

Installation

To use YTKNetwork add the following to your Podfile

pod 'YTKNetwork'

Or add this in your Cartfile:

github "yuantiku/YTKNetwork" ~> 2.0

Requirements

YTKNetwork Version AFNetworking Version Minimum iOS Target Note
2.x 3.x iOS 7 Xcode 7+ is required.
1.x 2.x iOS 6 n/a

YTKNetwork is based on AFNetworking. You can find more detail about version compability at AFNetworking README.

Guide & Demo

Contributors

Acknowledgements

Thanks for their great work.  

License

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

ytknetwork's People

Contributors

averyliu avatar demonnico avatar extrajordanary avatar forkpanda avatar lancy avatar ll128 avatar maojj avatar skyline75489 avatar tangqiaoboy avatar veecci avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.