Make any UIView
glow ✨
To run the example project, clone the repo, and run pod install
from the Example directory first.
Swift 4
ViewGlower is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ViewGlower'
Import the framework:
import ViewGlower
Initialize an instance of ViewGlower
:
class ViewController: UIViewController {
let viewGlower = ViewGlower()
...
}
Pass it a UIView
:
let barButton: UIBarButtonItem!
let button: UIButton!
...
viewGlower.glow(barButton.customView)
viewGlower.glow(button.imageView)
Note: Calling
glow()
inviewDidLoad()
does not work.
func glow(_ view: UIView?,
color: UIColor = UIColor.white,
from: CGFloat = 0,
to: CGFloat = 0.9,
duration: CFTimeInterval = 1,
shouldRepeat: Bool = true)
func stopGlowing(_ view: UIView?)
Modified from https://github.com/thesecretlab/UIView-Glow.
Icon in example from https://www.shareicon.net/cute-emoticons-emoji-feelings-smileys-847494.
quanvo87, qvo1987@gmail.com
ViewGlower is available under the MIT license. See the LICENSE file for more info.