I want to make an app that says hello in the center of the view, waits a few seconds and animates to the top (kind of like a login view you'd see in many apps)
No matter what I try, I cannot keep the text centered in the x axis. Could you look into my code and tell what the mistake is?
Thank you
// Blur Effect
var blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Light)
var blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = view.bounds
view.addSubview(blurEffectView)
// Vibrancy Effect
var vibrancyEffect = UIVibrancyEffect(forBlurEffect: blurEffect)
var vibrancyEffectView = UIVisualEffectView(effect: vibrancyEffect)
vibrancyEffectView.frame = view.bounds
// Add label to the vibrancy view
vibrancyEffectView.contentView.addSubview(vibrantLabel)
vibrantLabel.textAlignment = NSTextAlignment.Center
// Add the vibrancy view to the blur view
blurEffectView.contentView.addSubview(vibrancyEffectView)
UIView.animateWithDuration(1, delay: 1, options: .CurveEaseIn, animations: {() -> Void in
self.vibrantLabel.frame = CGRectMake(0, 100, self.vibrantLabel.frame.width, self.vibrantLabel.frame.height)
}, completion: {(finished: Bool) -> Void in
self.view.alpha = 1
})