-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathProgramingExampleViewController.swift
66 lines (45 loc) · 1.58 KB
/
ProgramingExampleViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// ProgramingExampleViewController.swift
// PPMusicImageShadow
//
// Created by Pierre Perrin on 06/03/2017.
// Copyright © 2017 Pierre Perrin. All rights reserved.
//
import UIKit
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
}
// MARK: - Navigation
@IBAction func dismiss(_ sender: Any) {
self.dismiss(animated: true, completion: nil)
}
/*
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}