Giter VIP home page Giter VIP logo

pxsiriwave9's Introduction

PRs Welcome

PXSiriWave9: Objective-C

If this project has helped you out, please support us with a star ๐ŸŒŸ

๐Ÿ“– Getting started

  • Please run below command in your app in order to install cocoapods required by the library:

pod init

pod 'PXSiriWave', '~> 0.0.2'

๐Ÿ’ป Usage

PXSiriWave *siriWave = [[PXSiriWave alloc] initWithFrame: CGRectMake(0, 0, 1000, 1000)];
siriWave.frequency = 1.5;
siriWave.amplitude = 0.01;
siriWave.intensity = 0.3;

siriWave.colors = [NSArray arrayWithObjects: [UIColor brownColor], [UIColor blueColor], [UIColor blackColor], nil];


[siriWave configure];

[self.view addSubview: siriWave];
  • Start Animation

Please setup Timer in order to animate waves:

    
    NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval: 0.10
    target:self
    selector: @selector(targetMethod:)
    userInfo: siriWave
    repeats:YES];
  • Set Timer Target
-(void)targetMethod:(NSTimer *)timer  {
    PXSiriWave *siriWave = [timer userInfo];
    
    [siriWave updateWithLevel: [self _normalizedPowerLevelFromDecibels: .1]];
}

- (CGFloat)_normalizedPowerLevelFromDecibels:(CGFloat)decibels {
    if (decibels < -60.0f || decibels == 0.0f) {
        return 0.0f;
    }
    
    return powf((powf(10.0f, 0.05f * decibels) - powf(10.0f, 0.05f * -60.0f)) * (1.0f / (1.0f - powf(10.0f, 0.05f * -60.0f))), 1.0f / 2.0f);
}
  • Stop Animation
[timer invalidate];
timer = NULL;

๐Ÿ’ก Properties

Prop Type Default Note
amplitude number 0.01 Amplitude of Waves
frequency number 1.5 Frequency of Waves
intensity number 0.3 Specify intensity of wave
colors array ["#2085fc", "#5efca9", "#fd4767"] Specify colors of siri wave 9 colors

โœจ Credits

๐Ÿค” How to contribute

Have an idea? Found a bug? Please raise to ISSUES. Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.

๐Ÿ’ซ Where is this library used?

If you are using this library in one of your projects, add it in this list below. โœจ

๐Ÿ“œ License

This library is provided under the Apache License.

PXSiriWave @ prscX

๐Ÿ’– Support my projects

I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

  • Starring and sharing the projects you like ๐Ÿš€

  • If you're feeling especially charitable, please follow prscX on GitHub.

    Buy Me A Coffee

    Thanks! โค๏ธ
    prscX.github.io
    </ Pranav >

pxsiriwave9's People

Contributors

prscx avatar

Watchers

 avatar  avatar

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.