Skip to content

Commit

Permalink
updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
prscms committed Mar 30, 2018
1 parent bd109dd commit e71b289
Show file tree
Hide file tree
Showing 5 changed files with 163 additions and 14 deletions.
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

# OSX
#
.DS_Store

# node.js
#
node_modules/
npm-debug.log
yarn-error.log


# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace


# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml

# BUCK
buck-out/
\.buckd/
*.keystore

.history/*
24 changes: 12 additions & 12 deletions PXSiriWaveExample/PXSiriWaveExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
CE25A647206B8A6D0092D3DC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE25A646206B8A6D0092D3DC /* Assets.xcassets */; };
CE25A64A206B8A6D0092D3DC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE25A648206B8A6D0092D3DC /* LaunchScreen.storyboard */; };
CE25A64D206B8A6D0092D3DC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CE25A64C206B8A6D0092D3DC /* main.m */; };
CE25A65E206B93B20092D3DC /* libPXSiriWave.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CE25A659206B8ACE0092D3DC /* libPXSiriWave.a */; };
CEA86C05206C7359002EB229 /* libPXSiriWave.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CEA86C04206C7355002EB229 /* libPXSiriWave.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
CE25A658206B8ACE0092D3DC /* PBXContainerItemProxy */ = {
CEA86C03206C7355002EB229 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = CE25A654206B8ACE0092D3DC /* PXSiriWave.xcodeproj */;
containerPortal = CEA86BFF206C7355002EB229 /* PXSiriWave.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = CE25A625206B8A340092D3DC;
remoteInfo = PXSiriWave;
Expand All @@ -37,15 +37,15 @@
CE25A649206B8A6D0092D3DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
CE25A64B206B8A6D0092D3DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CE25A64C206B8A6D0092D3DC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
CE25A654206B8ACE0092D3DC /* PXSiriWave.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PXSiriWave.xcodeproj; path = ../PXSiriWave/PXSiriWave.xcodeproj; sourceTree = "<group>"; };
CEA86BFF206C7355002EB229 /* PXSiriWave.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PXSiriWave.xcodeproj; path = ../PXSiriWave.xcodeproj; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
CE25A637206B8A6D0092D3DC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
CE25A65E206B93B20092D3DC /* libPXSiriWave.a in Frameworks */,
CEA86C05206C7359002EB229 /* libPXSiriWave.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -88,15 +88,15 @@
CE25A653206B8ACD0092D3DC /* Frameworks */ = {
isa = PBXGroup;
children = (
CE25A654206B8ACE0092D3DC /* PXSiriWave.xcodeproj */,
CEA86BFF206C7355002EB229 /* PXSiriWave.xcodeproj */,
);
name = Frameworks;
sourceTree = "<group>";
};
CE25A655206B8ACE0092D3DC /* Products */ = {
CEA86C00206C7355002EB229 /* Products */ = {
isa = PBXGroup;
children = (
CE25A659206B8ACE0092D3DC /* libPXSiriWave.a */,
CEA86C04206C7355002EB229 /* libPXSiriWave.a */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -149,8 +149,8 @@
projectDirPath = "";
projectReferences = (
{
ProductGroup = CE25A655206B8ACE0092D3DC /* Products */;
ProjectRef = CE25A654206B8ACE0092D3DC /* PXSiriWave.xcodeproj */;
ProductGroup = CEA86C00206C7355002EB229 /* Products */;
ProjectRef = CEA86BFF206C7355002EB229 /* PXSiriWave.xcodeproj */;
},
);
projectRoot = "";
Expand All @@ -161,11 +161,11 @@
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
CE25A659206B8ACE0092D3DC /* libPXSiriWave.a */ = {
CEA86C04206C7355002EB229 /* libPXSiriWave.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libPXSiriWave.a;
remoteRef = CE25A658206B8ACE0092D3DC /* PBXContainerItemProxy */;
remoteRef = CEA86C03206C7355002EB229 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
Expand Down
Binary file not shown.
106 changes: 104 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,104 @@
# PXSiriWave9
iOS: Siri Wave 9
# PXSiriWave9: Objective-C

<p align="center">
<img src="./assets/siriwave9.gif" width="600" height="300" />
</p>


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


## Getting started

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

`pod init`

`pod 'PXSiriWave',:git => 'https://github.com/prscX/PXSiriWave9.git', :commit =>'bd109dd'`


## Usage

```objectivec
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:
```objectivec
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval: 0.10
target:self
selector: @selector(targetMethod:)
userInfo: siriWave
repeats:YES];
```

- **Set Timer Target**

```objectivec

-(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**

```objectivec
[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 |


## Credit
- Siri Wave 9 Implementation by: [GreatPotter](https://github.com/GreatPotter)

## Contribution
Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.

## License
Copyright @ Pranav Raj Singh Chauhan

PXSiriWave is provided under the Apache 2 License.


Binary file added assets/siriwave9.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e71b289

Please sign in to comment.