This is custom subclass of UIView, which indicates the progress of task in percent.
- SPWaterProgressIndicatorView_README.md
- SPWaterProgressIndicatorView.hm
- SPWaterProgressIndicatorView.swift
- WaterWaveDemo project demostrates how to use this class in Objective-C Project.
- WaterWaveDemo_Swift project demostrates how to use this class in Swift Project.
- Add SPWaterProgressIndicatorView.hm files to the project.
- There are two ways to use this class:
- Specify a
UIView
's class as SPWaterProgressIndicatorView in IB. - Using
alloc
|initWithFrame:
(Objective-C) to create and initialize an instance, then add it to aUIView
. - Using
UIView
|init(frame: CGRect)
(Swift) to create and initialize an instance, then add it to aUIView
.
- Specify a
Objective-C
- (void)viewDidLoad {
[super viewDidLoad];
self.waterView = [[SPWaterProgressIndicatorView alloc] initWithFrame:self.view.bounds];
self.waterView.center = self.view.center;
[self.view addSubview:self.waterView];
}
Swift
override func viewDidLoad() {
super.viewDidLoad()
self.wave = SPWaterProgressIndicatorView(frame: self.view.bounds)
self.wave.center = self.view.center;
self.view.addSubview(self.wave)
}
1.0