Sina Weibo iOS client development process

Source: Internet
Author: User

1. First customize the Appdelegate

(1). If: First login to this version: New feature show, OAuth page get accesstoken-> main interface

and save the account information with access token, by: Singleton mode.

Else:if: If you do not pass OAuth authorization (that is, there is no account information in the Singleton mode Class), go to the OAuth page, the main interface

else: Go directly to the main page and read the information in the singleton to get the data.

(2): New features ScrollView use scrolling view and pagination (Uipagecontrol) and add pictures to page them and add them to the last page to share Weibo's button.

2. Define the main interface structure

1). Implement the option action bar below

Define the Dock class (the Action bar is a view in its entirety) and Dockitem (each action entry is a button) Dockcontroller (Uiviewcontroller)

Dockitem: rewrite the inner imageView with the label frame to keep the text picture centered at the right position

Dock: Sets the frame and background image of the entire view, as well as the position and size of each item, as the item number changes, and listens for each item, setting the Proxy method "automatically" invokes the proxy method when an item is clicked

Dockcontroller: Add a dock to the controller and set the frame, and implement the button proxy method in Dockdelegate. Proxy method function: Implement click on item to jump to current view

Maincontroller (host controller inherits from dock Controller), add item from Dock of parent class

2). Custom navigation Bar (the iOS7 status bar defaults to Transparent, does not occupy a height, problems occur)

3). Define five TableView classes, each view is wrapped by a navigation controller and added to the host controller

--At this time the general framework and the completion of the building, you can switch to different pages--------------

3. Design more (client Setup) modules. Custom TableView

Custom TableView subclasses, table with Group mode

---Start main function writing---------------------------

4. Design Home-Weibo section to view Weibo

1) Set the initial UI interface

2) Rewrite the table method numberofrowsinsection A few rows per group, The number of cells is the number of micro-Bo obtained

Cellforrowatindexpath cell initialization per row - -operation, etc. by:statuscell

Heightforrowatindexpath The height of each row of cells is calculated by the content of the microblog By:statuscellframe

3) access to Weibo data

First encapsulate your own tool class, Httptool get the resources through the classes that you have packaged instead of using afnetworking directly

This can reduce the lotus-to-goodness,

The status represents the various attributes of a microblog, customizing a statustool to obtain the microblog data through the OAuth-authorized Accesstoken, and calling the tool in the controller to get the micro-blog data into the array. and by customizing the Statuscellframe class (calculating the part of the microblog and the whole frame) to get a frame into the corresponding array to set the cell height

Finally, Statuscell to show the microblog.


To be continued .....

Sina Weibo iOS client development process

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.