I have found this code to add GIF Background on the landing screen and worked great,
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let filePath = NSBundle.mainBundle().pathForResource("MovingClouds", ofType: "gif")
let gif = NSData(contentsOfFile: filePath!)
let webViewBG = UIWebView(frame: self.view.frame)
webViewBG.loadData(gif!, MIMEType: "image/gif", textEncodingName: "utf-8", baseURL: NSURL())
webViewBG.userInteractionEnabled = false;
self.view.addSubview(webViewBG)
let filter = UIView()
filter.frame = self.view.frame
filter.backgroundColor = UIColor.blackColor()
filter.alpha = 0.05
self.view.addSubview(filter)
let welcomeLabel = UILabel(frame: CGRectMake(0, 100, self.view.bounds.size.width, 100))
welcomeLabel.text = "KeepON"
welcomeLabel.textColor = UIColor.whiteColor()
welcomeLabel.font = UIFont(name: "Zapfino", size: 35)
welcomeLabel.textAlignment = NSTextAlignment.Center
self.view.addSubview(welcomeLabel)
}
this shows my GIF background and my Title, but When I try to add Buttons in story board in View Controller they don't appear when I run my app, only the GIF background with the title, and I don't want to add buttons using code.
So any ideas ? Thanks