Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. //
  2. // ViewController.swift
  3. // TableViewNotification
  4. //
  5. // Created by Mihai Muntean on 18/07/2019.
  6. // Copyright © 2019 Mihai Muntean. All rights reserved.
  7. //
  8.  
  9. import UIKit
  10.  
  11. class ViewController: UIViewController, CustomViewProtocol {
  12.  
  13. func but2pressed(indexPath: IndexPath) {
  14. label.text="The cell that was pressed is found at \(indexPath)"
  15. }
  16.  
  17. @IBOutlet weak var label: UILabel!
  18.  
  19. var customView: CustomView!
  20.  
  21. override func viewDidLoad() {
  22. super.viewDidLoad()
  23.  
  24. createCustomView()
  25. }
  26.  
  27. func createCustomView() {
  28. customView = CustomView(frame: CGRect(x: 20.0, y: 180.0, width: view.frame.width/2.0, height: view.frame.height / 2.0))
  29.  
  30. customView.delegate = self
  31.  
  32. view.addSubview(customView)
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement