Skip to content

Latest commit

 

History

History
46 lines (29 loc) · 1.92 KB

README.md

File metadata and controls

46 lines (29 loc) · 1.92 KB

Build Status TFSwipeShrink

A UIView subclass that mimics the video player panning in the current YouTube iOS and Android apps.

Example

Screenshot

Installation

Copy the TFSwipeShrinkView.swift file into your Xcode project and you are ready.

Usage

View ExampleViewController.swift to see an example of adding a video on top of a TFSwipeShrinkView.

  1. Create a UIView in storyboard giving it a custom class of TFSwipeShrinkView. I suggest placing it at the top of your viewcontroller just as the YouTube app does.
  2. In the viewcontroller implementing your TFSwipeShrinkView, within the viewDidAppear method call the configureSizeAndPosition(parentViewFrame: CGRect) on your swipe shrink object.

From here, everything should just work. It is up to you the developer to add whatever you want on top of the swipe shrink view, such as a video or an image. In it's default state, you should have something that looks like this.

Screenshot

Author

Created by Taylor Franklin (tfrank64)

TODO

  • Create a secondary view below shrink view, similar to YouTube app.

Contributing

Feel free to fork the repo and open a pull request. Using fairly normal convention, make changes in your forked repo, then submit a pull request.

To view some of the original Objective-C code for this project, check out the ObjCSwipeShrink directory.

License

TFSwipeShrink is licensed under the MIT license.