https://github.com/quanvo87/viewglower
Make any UIView glow ✨
https://github.com/quanvo87/viewglower
animate glow swift uibutton uiview
Last synced: 5 months ago
JSON representation
Make any UIView glow ✨
- Host: GitHub
- URL: https://github.com/quanvo87/viewglower
- Owner: quanvo87
- License: mit
- Created: 2018-01-05T05:37:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-05T15:52:06.000Z (almost 8 years ago)
- Last Synced: 2025-05-17T23:18:39.424Z (6 months ago)
- Topics: animate, glow, swift, uibutton, uiview
- Language: Shell
- Homepage:
- Size: 1.08 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ViewGlower
Make any `UIView` glow ✨
[](http://cocoapods.org/pods/ViewGlower)
[](http://cocoapods.org/pods/ViewGlower)
[](http://cocoapods.org/pods/ViewGlower)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
Swift 4
## Installation
ViewGlower is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'ViewGlower'
```
## Usage
Import the framework:
```swift
import ViewGlower
```
Initialize an instance of `ViewGlower`:
```swift
class ViewController: UIViewController {
let viewGlower = ViewGlower()
...
}
```
Pass it a `UIView`:
```swift
let barButton: UIBarButtonItem!
let button: UIButton!
...
viewGlower.glow(barButton.customView)
viewGlower.glow(button.imageView)
```
> Note: Calling `glow()` in `viewDidLoad()` does not work.
#### Customize
```swift
func glow(_ view: UIView?,
color: UIColor = UIColor.white,
from: CGFloat = 0,
to: CGFloat = 0.9,
duration: CFTimeInterval = 1,
shouldRepeat: Bool = true)
```
#### Stop glowing
```swift
func stopGlowing(_ view: UIView?)
```
## Acknowledgements
Modified from [https://github.com/thesecretlab/UIView-Glow](https://github.com/thesecretlab/UIView-Glow).
Icon in example from [https://www.shareicon.net/cute-emoticons-emoji-feelings-smileys-847494](https://www.shareicon.net/cute-emoticons-emoji-feelings-smileys-847494).
## Author
quanvo87, qvo1987@gmail.com
## License
ViewGlower is available under the MIT license. See the LICENSE file for more info.