forked from jhinericusername/TheraView
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFeedbackViewController.swift
50 lines (34 loc) · 1.7 KB
/
FeedbackViewController.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
import UIKit
class FeedbackViewController: UIViewController {
let circleView = UIView()
let circleLabel = UILabel()
override func viewDidLoad() {
super.viewDidLoad()
circleView.backgroundColor = UIColor.systemPink
circleView.layer.cornerRadius = circleView.bounds.width / 2
circleView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(circleView)
circleLabel.text = "Hello, World!"
circleLabel.textColor = UIColor.white
circleLabel.textAlignment = .center
circleLabel.translatesAutoresizingMaskIntoConstraints = false
circleView.addSubview(circleLabel)
// Add positioning constraints
NSLayoutConstraint.activate([
circleView.topAnchor.constraint(equalTo: view.topAnchor, constant: 20),
circleView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20),
circleView.widthAnchor.constraint(equalToConstant: 100),
circleView.heightAnchor.constraint(equalTo: circleView.widthAnchor),
circleLabel.centerXAnchor.constraint(equalTo: circleView.centerXAnchor),
circleLabel.centerYAnchor.constraint(equalTo: circleView.centerYAnchor),
circleLabel.widthAnchor.constraint(equalTo: circleView.widthAnchor, multiplier: 0.8),
circleLabel.heightAnchor.constraint(equalTo: circleView.heightAnchor, multiplier: 0.8)
])
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Add any code you need to run when the view is about to appear
}
// MARK: - IBActions
// MARK: - Private Methods
}