Small frames common to iOS

Source: Internet
Author: User

In iOS development, some of the requests for KVC drop-down list picture requests and so on their own handwriting code is very troublesome, but also prone to a series of problems, now tidy up some common small framework.

The two frames of Mjextension and Mjrefresh were written by MJ himself,


1. Afnetworking-master is used for data request

Usage:

1. Create a request Management Object    Afhttprequestoperationmanager *mgr = [Afhttprequestoperationmanager manager];        2. Package request parameter    nsmutabledictionary *params = [nsmutabledictionary dictionary];    params[@ "Access_token"] = [Iwaccounttool account].access_token;        3. Send    the request [Mgr get:@ "Https://api.weibo.com/2/statuses/home_timeline.json" Parameters:params      success:^ ( Afhttprequestoperation *operation, id responseobject) {              } failure:^ (Afhttprequestoperation *operation, NSError * Error) {                }];

2, Mbprogresshud is a process of the dialog

Usage

[Mbprogresshud showmessage:@ "is helping you load ..."];

3, Mjextention is a tool of KVC, dictionary to model, the disadvantage of KVC is the dictionary to model, the model data must be corresponding to the dictionary one by one, does not correspond to the problem, in fact, sometimes the server value of the client is not used, then there will be some problems,

Mjextention solves this problem, and the framework iterates through the properties in the model data, and if there is a property then the value is transferred, no matter what the object is encapsulated in the Mjextention, any objects can be used in the encapsulation method

Usage

Convert the dictionary array to the model array (the Iwstatus model is placed inside)          nsarray *statusarray = [Iwstatus objectarraywithkeyvaluesarray:responseobject[ @ "statuses"];


The 4,mjrefresh framework is not yet ready to be updated.

5, Sdwebimage-master frame is specialized in processing pictures

We ask for pictures on the network, there are some problems, 1, in the main thread request Picture 2, request the picture returned when item has changed also can say position from 0 to display the position of the entry +1, or has been recycled, so easy to appear picture a sparkle, 3, Picture request due to the mobile phone traffic is limited, so that we need to cache images, cache image space management and so on .....

Sdwebimage-master, these questions are all done for us.

Usage

2. Avatar    [Self.iconview setimagewithurl:[nsurl urlwithstring:@ "http://xxxxxxxxxxxxx.jpg"] placeholderimage:[ UIImage imagewithname:@ "Avatar_default_small"];

A word.



Frame: http://download.csdn.net/detail/codywangziham01/7895209

No points can add my QQ I preach you: 476959930




Small frames common to iOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.