Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotintent/WobbleView
https://github.com/dotintent/WobbleView
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dotintent/WobbleView
- Owner: dotintent
- License: mit
- Created: 2015-04-08T14:26:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-30T20:56:02.000Z (over 7 years ago)
- Last Synced: 2024-05-23T05:28:00.506Z (6 months ago)
- Language: Swift
- Size: 280 KB
- Stars: 2,191
- Watchers: 61
- Forks: 117
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WobbleView
WobbleView is an implementation of a recently popular wobble effect for any view in your app. It can be used to easily add dynamics to user interactions and transitions.
Check this [project on Dribble](https://dribbble.com/shots/2009891-Bits-and-pixels-Wobble-Effect).
![Wobble](https://github.com/inFullMobile/WobbleView/blob/master/wobble.gif?raw=true)
## Installation
There are two options:
1. WobbleView is available via CocoaPods.
2. Manually add the files into your Xcode project. Slightly simpler, but updates are also manual.## Usage
Just create a WobbleView and change its position.
```swift
self.wobbleView.frame.origin = CGPoint(x: randomX, y: randomY)
```or
```swift
self.wobbleView.center = CGPoint(x: randomX, y: randomY)
```or animate the view's constraints.
## Properties
```swift
internal var frequency: CGFloat = 3
```The frequency of oscillation for the wobble behavior.
```swift
internal var damping: CGFloat = 0.3
```The amount of damping to apply to the wobble behavior.
```swift
var edges: ViewEdge = ViewEdge.Right
```A bitmask value that identifies the edges that you want to wobble. You can use this parameter to wobble only a subset of the sides of the rectangle.
## Requirements
- Swift 2.0
- Xcode 7## License
Released under the MIT license. See the LICENSE file for more info.