Original Cool Code Disclosure--Connect Dong Platinum to GitHub

Source: Internet
Author: User

Open the GitHub section of the project (both original) more code see Https://github.com/dsxNiubility
Sxwaveanimate Sxfivescoreshow Sxphotoshow Sxnews

Main Introduction:

Used to make a circular container in the irrigation effect, the demo program is the previous page to send the value of the painting, you can also make the current page to get the data refreshed after the draw. Now the package is also basically perfect, the user needs to reuse my custom cell written. Available in three styles, the following will also improve some of the expansion of the infinite flow of water and other features.

Main Introduction:

This program is about drawing a chart. Pass in five parameter value 0~5.0, will calculate according to scale and draw out Pentagon, and can provide one comparison value to draw another (green chart) compare with own score, also set the animation expands effect, visual effect is better. Users can customize a lot of places, now provides three kinds of dimensions, according to you want to pass several values to judge the triangle, quadrilateral or Pentagon.

Main introduction:

This is mainly used for image display. There are three custom layouts written in CollectionView, as well as ideas that users can associate themselves with to make more layouts. It's also easy to use: Layout files are dragged into the project, and a layout is passed in when the collection is established. Add a click to delete the effect, also very interesting.

main introduction:

fine imitation of NetEase news. The author of the work, on the NetEase UI, grilled netease image material, crawl NetEase interface and so on. Inside completed the main navigation page, news detail page, picture view page, Comment page. The effect is good, than the online spread of various and NetEase news UI architecture related code is better. Similar to this imitation of the project I have a lot of GitHub, such as Baidu Doctor, Sina Weibo, the old version of the United States and so on.

 

For more than half a month 300+ star

Click to go to GitHub to download

Just Open has no star, welcome everyone to learn from, point Star

Click to go to GitHub to download

Just Open has no star, welcome everyone to learn from, point Star

Click to go to GitHub to download

Formerly small-scale public, there were 40 of stars

Click to go to GitHub to download

Below is a detailed description of these projects

SXWaveAnimate6 Month 2nd upgrade version (recommended update)

The animation code is encapsulated inside the cell, providing a uniform interface and assignment method

How to use

1. Drag the Classes folder in the code into the project, which contains the custom cell and a convenient class for calculating the frame
2. Introduce a header file in a class that you need to use (that is, the class you want to write TableView data source methods and proxy methods)
#import "SXWaveCell.h"
3. In the cellforrow of the data source method, replace the previous UITableView Cell *cell and so on where you need it.
SXWaveCell *cell = [SXWaveCell cell];
self.waveCell = cell;
[cell setPrecent:self.precent textColor:[UIColor orangeColor] type:0 alpha:1];
return cell;
4. The third line of this setPrecent:textColor:type:alpha: The method is an assignment method, now must be four parameters are passed, and subsequently set multiple interfaces can only pass the required values.
5. Now there are two methods in the source code, one is to click on the cell to trigger the animation after the page is displayed, one is to display the animation in the first, if you want to set the viewDidAppear method to add a line to start the animation method[self.waveCell addAnimateWithType:0];

The code is very clear and easy to read in the sample program.

Initial version

Because the main function in the early stage, the temporary interface package is not very perfect, will be continuously improved. And now the code structure is very clear and can be reused to welcome attention.

Available in three styles for the time being.

第一种是,纯白背景橙色文字。第二种是,半透明背景深绿文字。 后续会提供颜色的接口。第三种是,颜色纯白,背景较深,相比于前两种,第三种是先把水位灌满再降到指定的高度。

can also be modified according to user preferences

Sxfivescoreshow

Achieve a pentagon similar to the five-ability value display of players in live football.

This program is about drawing a chart. Pass in five parameter value 0~5.0, will calculate according to scale and draw out Pentagon, and can provide one comparison value to draw another (green chart) compare with own score, also set the animation expands effect, visual effect is better. Users can customize a lot of places, now provides three kinds of dimensions, according to you want to pass several values to judge the triangle, quadrilateral or Pentagon.

Home of the Demo sample program, set up a more complete example, the general reference to this third-party library can generally be done in this way.

Two styles

You can set the properties internally by controlling ShowType to 1 or 2 to enable Pentagon to display Narimi colors or borders.

Three types of dimensions

In the example program, the first page gives a score of five dimensions, and a comparison score of five dimensions is passed, and dimension five is drawn with the value passed in (an array is passed in). Then dimension three and dimension four take the preceding three values and four values to plot the plot.

How to use:
1.将代码中resource文件夹中的SXFiveScore拖入项目中2.引入主头文件#import "SXFiveScoreCell.h"3.有两种使用方法,一种是用SXFiveScoreCell加在tableView中来展示,一种是直接将   SXAnimateView加在ViewController中显示。但暂时第二种方法封装的还不是很完善,暂时建议第一种。4.在tableView的数据源方法中 使用SXFiveScoreCell类来创建cell。5.获得数据,可以是这个页面发请求得到的,也可以是前一个页面传得,总之要得到3~5个0~5.0之间数值,并整合成一个数组。(如果想要设置对比view那就要写两个数组)6.然后为cell的两个成员变量传值     cell.scores = mScoreArray;    cell.compareScores = mCompareArray;    (现在就默认了主要分数是桔色,对比分数是绿色,后续会把颜色的接口开放到前面可以自行设置)7.如果想要设置进入页面后自动产生动画,可参见demo中使用成员变量并在viewdidappear中控制的方法。

Sxphotoshow

Uicollectionviewflowlayout water layout is a common and common layout method in the present CollectionView. This code also wrote three good-looking layouts, where linelayout and water layout have a very large same point directly inherit Uicollectionviewflowlayout, and then Stacklayout, Circlelayout both of these are directly inherited from the original uicollectionviewlayout layout scheme.

Sxstacklayout

Similar to the card dislocation stacked together layout, temporarily can do is symmetrical on both sides. When you click cell Delete or the number of cells changes, it will be re-layout, and the angle will animate with the change.

Sxlinelayout

is a straight line layout, but in the process of dragging, the size of the cell will change according to its own position changes, sliding to the middle of the largest, both sides of the smallest. and has done the treatment has a adsorption effect, each close to stop will be closest to the middle of the cell placed in the middle is not crooked.

Sxcirclelayout

This is a circular layout, and the position will change with the overall number of changes. Demo settings can be clicked to delete, pro can try to delete the last 5 when the cool effect occurs.

How to use

1. Build the project you need, with CollectionView and Collectioncell in the first place (demo is the most simple wording)

2. Drag the folder in the project Layout into the project. There are three layouts, which type of header file you want to import.
#import "SXStackLayout.h"--corresponding to the top of the
#import "SXLineLayout.h"--The corresponding is the middle
#import "SXCircleLayout.h"--The corresponding yes below

3. Create a layout in the Viewdidload method
SXCircleLayout *layout = [[SXCircleLayout alloc] init];
and fill in the collection's initialization method with this introduced layout
UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 235)) collectionViewLayout:layout];

Sxnews

Imitate the news software made by NetEase News

The fine imitation of NetEase news. The author of the work, on the NetEase UI, grilled netease image material, crawl NetEase interface and so on. Inside completed the main navigation page, news detail page, picture view page, Comment page. The effect is good, more than the online spread of various and NetEase news UI architecture related code to complete, are better.

Main function point of main navigation page is that the title bar at the top can slide, Scrowview and CollectionView are recycled and the following page will slide to the current page when you click on the title bar or when the gesture is sliding. And the news module is lazy loading, you have to see which pages he will load. This is accomplished by controlling the proxy method of the Scrowview two gesture stop. The following news module provides 4 custom cells to determine which custom cell to load into by parsing the data. The results make the homepage look rich.

About the News details page, NetEase original interface in the previous page returned data in both a URL address, there is an XML string, the URL address is not beautiful, so the practice is to parse the XML format string and display in the WebView, which achieved the text mix and set the CSS style. The main highlight of this page is the value between the JS code and the OC code. After clicking on the picture in WebView, the following pop-up can be saved, which is implemented by controlling a page redirection method to intercept the request.

The comment page is relatively simple and is the normal custom cell. There is no problem in controlling the custom lines well. The user introduction of the label can be filtered with regular, but the main focus on writing this thing in the core function is not carefully done here.

Picture Viewer page is also basically to achieve the effect of imitation, the following text and 9/16 style are calculated by the scrowview of the offset dynamic, and the same as the home page is also lazy loading the image, in the picture download is not shown when there will be a netease placeholder image.

    • This project also uses the pull-up loading drop-down refresh and some technical knowledge about parent-child controller nesting and custom navigation bar, these are also helpful to the development of peacetime.

不定时更新 欢迎点星。

 

Original Cool Code Disclosure--Connect Dong Platinum to GitHub

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.