Home

Awesome

<h1 align="center"> <p align="center"> <a href="https://github.com/prscX/PXSiriWave9/pulls"><img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" /></a> <a href="https://github.com/prscX/PXSiriWave9#License"><img src="https://img.shields.io/npm/l/react-native-siri-wave-view.svg?style=flat" /></a> </p>
PXSiriWave9: Objective-C

If this project has helped you out, please support us with a star 🌟

</h1>
<img src="https://raw.githubusercontent.com/prscX/PXSiriWave9/master/assets/siriwave9.gif" />

📖 Getting started

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];

Please setup Timer in order to animate waves:

    
    NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval: 0.10
    target:self
    selector: @selector(targetMethod:)
    userInfo: siriWave
    repeats:YES];


-(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);
}

[timer invalidate];
timer = NULL;

💡 Properties

PropTypeDefaultNote
amplitudenumber0.01Amplitude of Waves
frequencynumber1.5Frequency of Waves
intensitynumber0.3Specify intensity of wave
colorsarray["#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: