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:
[OBJC]View Plaincopy
- 1. Create a Request Management object
- Afhttprequestoperationmanager *mgr = [Afhttprequestoperationmanager manager];
- //2. Package Request Parameters
- nsmutabledictionary *params = [nsmutabledictionary dictionary];
- params[@ "Access_token"] = [Iwaccounttool account ]. Access_token;
- //3. Send 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
[OBJC]View Plaincopy
- [Mbprogresshud ShowMessage:@ "Brother is helping you to 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
[OBJC]View Plaincopy
- Convert a dictionary array to a 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
[OBJC]View Plaincopy
- 2. Avatar
- [self. IconView setimagewithurl:[nsurl urlwithstring:@ "http://xxxxxxxxxxxxx.jpg"] Placeholderimage:[uiimage imagewithname:@ "Avatar_default_small"];
Frame: http://download.csdn.net/detail/codywangziham01/7895209
Small frames common to iOS