rsp

RSPlayPauseButton

A button with a play/pause icon that nicely morphs between the two.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

57

Maintenance

Last Commit

2yrs ago

Contributors

0

Package

Dependencies

0

License

Public domain

Categories

Readme

RSPlayPauseButton

A UIControl with a play/pause icon that nicely morphs between the two.

RSPlayPauseButton Morph Animation

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. I originally released this code in early 2014 as a gist and was happy to see Google (or should one say Alphabet now?) adding the Split style in mid-2015 to the YouTube.com player.

Feel free to reach out to @RaphaelSchaad and say hi.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100