• Stars
    star
    570
  • Rank 78,245 (Top 2 %)
  • Language
    Objective-C
  • Created almost 9 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a loading indicator like water wave

WaveLoadingView

A loading indicator like water wave

###You can play a demo with appetize.io


#**Features:**


#**Property:** - cycle —— 循环次数,在控件宽度范围内,该正弦函数图形循环的次数,数值越大控件范围内看见的正弦函数图形周期数越多,波长约短波浪也越陡。 - term —— 正弦周期,在layoutSubviews中根据cycle重新计算,==修改无效== - phasePosition —— 正弦函数相位,==不可修改==,否则图形错乱 - amplitude —— 波幅,数值越大,波浪幅度越大,波浪越陡,反之越平缓,可通过代码调用`waveAmplitude`修改 - position —— 正弦曲线的X轴 相对于 控件Y坐标的位置,在-drawRect中通过progress计算,==修改无效== - waveMoveSpan —— 波浪移动的单位跨度,数值越大波浪移动越快,数值过大会出现不连续动画现象 - animationUnitTime —— 重画单位时间,数值越小,重画速度越快频率越大 - heavyColor —— demo中较深的绿色部分 - lightColor —— demo中较浅的绿色部分 - clipCircleColor —— 玻璃球边界颜色 - clipCircleLineWidth —— 玻璃球边线宽度,可通过代码调用`borderWidth`修改 - progressTextFontSize —— 中央进度提示百分比字号大小
#**Usage:** 1. include the file WaveLoadingView.swift to your project, and about objectiveC, you can create a bridge Header and import it 2. creat a waveLoadingIndicator instance ```swift let waveLoadingIndicator: WaveLoadingIndicator = WaveLoadingIndicator(frame: CGRectZero) ``` 3. add waveLoadingIndicator to your imageView, equal bounds here i do , and FlexibleWidth,height ```swift self.displayImageView.addSubview(self.waveLoadingIndicator) self.waveLoadingIndicator.frame = self.displayImageView.bounds self.waveLoadingIndicator.autoresizingMask = [.FlexibleWidth, .FlexibleHeight] ``` 4. and your can used combine with SDWebImage: ```swift self.displayImageView.sd_setImageWithURL(url, placeholderImage: nil, options: .CacheMemoryOnly, progress: { [weak self](receivedSize, expectedSize) -> Void in
guard let weakSelf = self else {
    return
}

weakSelf.waveLoadingIndicator.progress = Double(CGFloat(receivedSize)/CGFloat(expectedSize))
}) {
    [weak self](image, error, _, _) -> Void in
    // 不要忘记在完成下载回调中,移除waveLoadingIndicator
    guard let weakSelf = self else {
        return
    }
    
    weakSelf.waveLoadingIndicator.removeFromSuperview()

}

> <br>
> Don't worry, after -removeFromSuperview(), the animation have been stop
  
##Relation  
[@liuzhiyi1992](https://github.com/liuzhiyi1992) on Github  
[WaveLoadingIndicator](http://zyden.vicp.cc/waveloadingindicator/) in my Blog  


<br>
#**License:** 
WaveLoadingIndicator is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

ZYCornerRadius

一句代码,圆角风雨无阻。A Category to make cornerRadius for UIImageView have no Offscreen-Rendered, be more efficiency.
Objective-C
1,450
star
2

ZYThumbnailTableView

a TableView have thumbnail cell only, and you can use gesture let it expands other expansionView, all diy
Swift
945
star
3

ZYSideSlipFilter

Awesome side slip filter for your display rack, 侧边栏条件筛选器,筛选区域模块插拔,AutoLayout动态适配区域高度
Objective-C
661
star
4

SpreadButton

a Button can spread its sub path button like the flower if you click,once again,close. oc & swift
Swift
529
star
5

ZYKeyboardUtil

一个Block,全自动处理键盘遮挡输入控件问题。Util Handed all keyboard events with Block Conveniently
Objective-C
421
star
6

PreLoader

A Loading Indicator to draw attention effectively.
Objective-C
139
star
7

UCToutiaoClone

1:1超高仿UC头条, 品质阅读资讯App, 官方主页http://toutiao.uc.cn/, 开源项目, 欢迎补充
Objective-C
112
star
8

MyshareBlogs

Record articles i has been share
66
star
9

ZYLocationManager

Request location information any time any where conveniently
Objective-C
18
star
10

DynamicNavigationBar

动态(展开-收缩)NavigationBar
Objective-C
9
star
11

ZYCarouselScroller

carousel scroller with your custom CardCell
Objective-C
6
star
12

SpeedFreezingVideo

Objective-C
6
star
13

FlagProgressBar

a progress bar(index, volume) with above image flag, and bottom title flag if you need
Objective-C
5
star
14

UIImageView-sport-category-

图片下载进度指示器(category方式实现)
Objective-C
1
star
15

ImageLoadingIndicator

图片加载指示器(oc,swift)
Objective-C
1
star
16

GhostTheme

CSS
1
star
17

MyStore

Objective-C
1
star