Skip to content

Instantly share code, notes, and snippets.

@TarasShu
Created July 6, 2020 14:07
Show Gist options
  • Save TarasShu/ec1aba0dc09f26c6b8c47144ea363d94 to your computer and use it in GitHub Desktop.
Save TarasShu/ec1aba0dc09f26c6b8c47144ea363d94 to your computer and use it in GitHub Desktop.
d
lass myViewController: UIViewController{
@IBOutlet weak var viewForLayer: UIView!
var layer: CALayer {
return viewForLayer.layer
}
func setUpLayer() {
layer.contents = UIImage(named: "omry")?.cgImage // adress -
}
let lable = UILabel()
//let image = UIImage()
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemRed
view.addSubview(lable)
lable.text = "weqqw"
lable.frame = CGRect(x: 0, y: 0, width: 1000, height: 100)
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
// lable.backgroundColor = .systemGray
// lable.frame.origin.y += 100
// lable.text = "Don't touch me "
setUpLayer()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment