TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jul 2017 |
SwiftSwift Version | 3.0.2 |
SPMSupports SPM | ✗ |
Maintained by Pierre Perrin.
PPMusicImageShadow is a view that imitates in real time the shadow blurred effect of iOS Music App.
If you prefer you can clone the project, release the framework or use the view swift file directly.
Insert a normal UIView in your viewController.
Change it class with "PPMusicImageShadow". Now you can set an image like an imageView, a blur radius, and a corner radius.
import PPMusicImageShadow
class ProgramingExampleViewController: UIViewController {
var exampleView : PPMusicImageShadow!
override func viewDidLoad() {
super.viewDidLoad()
self.addEffectView()
self.prepareExampleView()
self.setImageToExampleView()
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
self.exampleView.center = self.view.center
}
//MARK: Example
func addEffectView(){
self.exampleView = PPMusicImageShadow(frame: CGRect.init(x: 0, y: 0, width: 300, height: 300))
self.view.addSubview(self.exampleView)
}
func setImageToExampleView(){
let image = UIImage(named: "prairie-679016_1920.jpg")
self.exampleView.image = image
}
func prepareExampleView(){
self.exampleView.cornerRaduis = 10
self.exampleView.blurRadius = 5
}
}