TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Custom |
ReleasedLast Release | Nov 2016 |
Maintained by Raphael Schaad.
A UIControl
with a play/pause icon that nicely morphs between the two.
You can choose from two morphing styles: Split, and Split & Rotate.
If using CocoaPods, the quickest way to try it out is to type this on the command line:
$ pod try RSPlayPauseButton
To add it to your app, copy the class RSPlayPauseButton.h/.m
into your Xcode project or add via CocoaPods by adding this to your Podfile:
pod 'RSPlayPauseButton', '~> 1.0'
In your code, #import "RSPlayPauseButton.h"
, create the control, and setup an action to toggle it:
// ... e.g. in `-viewDidLoad:` ...
RSPlayPauseButton *playPauseButton = [[RSPlayPauseButton alloc] init];
[playPauseButton addTarget:self action:@selector(playPauseButtonDidPress:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:playPauseButton];
}
- (void)playPauseButtonDidPress:(RSPlayPauseButton *)playPauseButton {
[playPauseButton setPaused:!playPauseButton.isPaused animated:YES];
}
Since I release RSPlayPauseButton as free and unencumbered software into the public domain you can do with it whatever you want including using it in any app on the App Store.
Feel free to reach out to @RaphaelSchaad and say hi.