I built an animated button on the entry screen and tried to make the animated button a storyboard seque to but I keep getting this error (fatal error: unexpectedly found nil
while unwrapping an Optional value) after it crashes.
Here is my code:
//
// ViewController.swift
// MyChapel
//
// Created by Kamau Exom on 6/10/15.
// Copyright (c) 2015 SevenCreative. All rights reserved.
//
import UIKit
import WebKit
class ViewController: UIViewController {
@IBOutlet weak var LoginLogoReveal: LogoRevealView!
@IBOutlet weak var PhotosFade: PhotosFadeView!
@IBOutlet weak var LoginBG: UIImageView!
@IBOutlet weak var LoginLogo: UIImageView!
@IBOutlet weak var LoginButton: UIButton!
@IBOutlet weak var SignupButton: UIButton!
@IBOutlet weak var LoginScreen: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
LoginLogoReveal.addRevealAnimation()
PhotosFade.addPhotoFadeAnimation()
self.LoginLogoReveal.alpha = 1.0
UIView.animateWithDuration(1.0, delay: 2.0, options: nil, animations: { self.LoginLogoReveal.alpha = 0
}, completion: nil)
self.PhotosFade.alpha = 0
UIView.animateWithDuration(1.0, delay: 2.5, options: nil, animations: { self.PhotosFade.alpha = 1
}, completion: nil)
self.LoginBG.alpha = 0
UIView.animateWithDuration(1.0, delay: 2.0, options: nil, animations: { self.LoginBG.alpha = 1
}, completion: nil)
self.LoginLogo.alpha = 0
UIView.animateWithDuration(1.0, delay: 2.5, options: nil, animations: { self.LoginLogo.alpha = 1
}, completion: nil)
self.LoginButton.alpha = 0
UIView.animateWithDuration(1.0, delay: 3.0, options: nil, animations: { self.LoginButton.alpha = 1
}, completion: nil)
self.SignupButton.alpha = 0
UIView.animateWithDuration(1.0, delay: 3.5, options: nil, animations: { self.SignupButton.alpha = 1
}, completion: nil)
let loginurl = NSURL(string: "http://www.mychapel.net/?memberful_endpoint=auth")
let request = NSURLRequest(URL: loginurl!)
LoginScreen?.scalesPageToFit = true
LoginScreen?.loadRequest(request)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
The error appears at "LoginLogoReveal.addRevealAnimation()
"