Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ViewController: UIViewController, UITableViewDataSource {
- var myView: UIView!
- override func viewDidLoad() {
- super.viewDidLoad()
- var myView = UIView(frame: CGRectMake((width-50)/2, (height-50)/2, 50, 50))
- myView.backgroundColor = UIColor(red: 16/255.0, green: 57/255.0, blue: 100/255.0, alpha: 0.9)
- myView.layer.cornerRadius = 16
- self.view.addSubview(myView)
- myView.alpha = 0
- }
- func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
- self.myView.alpha = 1 // <-- Error: fatal error: unexpectedly found nil while unwrapping an Optional value
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement