Git Product home page Git Product logo

spwaterwaveprogressindicatorview's Introduction

SPWaterProgressIndicatorView

This is custom subclass of UIView, which indicates the progress of task in percent.

What it looks like?

Presentation

Directory

  • 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.

How to use it?

  • 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 a UIView.
    • Using UIView | init(frame: CGRect) (Swift) to create and initialize an instance, then add it to a UIView.

Important to Know

  1. Init with init(frame: CGRect)
  2. No matter what CGRect being passed to initialize it, the view will be trunked to be a square.

Objective-C

// Initialization.
- (void)viewDidLoad {
    [super viewDidLoad];
    self.waterView = [[SPWaterProgressIndicatorView alloc] initWithFrame:self.view.bounds];
    self.waterView.center = self.view.center;
    [self.view addSubview:self.waterView];
    
}

// Update percent
[self.waterView updateWithPercentCompletion:percent];

Detailed Example in Objc.

Swift

// Initialization
override func viewDidLoad() {
    super.viewDidLoad()
        
    self.wave = SPWaterProgressIndicatorView(frame: self.view.bounds)
    self.wave.center = self.view.center;
    self.view.addSubview(self.wave)        
}

// Update percent
self.wave.completionInPercent = percent

Detailed Example in Swift.

Version

1.0

Reference & Thanks

spwaterwaveprogressindicatorview's People

Contributors

antonio081014 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

spwaterwaveprogressindicatorview's Issues

square view loading

Hello. Thanks you for great library. I need to display loading view in square, not circle. Can you give some help to implement this

Add Pod support

Add pod support to make this easier to be added/installed.

The height of the wave

Hello @antonio081014 , using WaterAnimatorView(frame: view.bounds) still gives me half of my entire screen.

I am looking forward to making the wave fill up an entire view controller, could there be anything I am doing wrong pls.

NOTE: I have also tried to set both the bottom and top constraints, but still having the same issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.