我想在swift中为我的ios应用程序创建一个类似twitter的启动图像.
我理解动画启动图像的一般问题,我基本上知道创建这样一个动画的步骤:
我找到了这个精彩的来源:http://iosdevtips.co/post/88481653818/twitter-ios-app-bird-zoom-animation
但是这个家伙使用了一个面具而且我无法改变他的代码来获得没有面具的"真正的"推特动画,而只是一个动画(放大)图像.
那么如何在当前视图中添加新视图?如果我使用子视图,当我需要删除animationDidStop中的子视图时,如何在进度后识别该视图?
哦,我喜欢在AppDelegate中做所有这些.
这是我目前的做法:
在AppDelegate中设置视图:
import UIKit
import QuartzCore
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var viewForLayer: UIView!
var window: UIWindow?
var emoji: CALayer {
return viewForLayer.layer
}
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
// step 1: recreate the launch image
self.emoji.backgroundColor = UIColor(red: 52/255, green: 52/255, blue: 52/255, alpha: 0).CGColor
self.emoji.contents = UIImage(named: "SplashScreenEmoji")!.CGImage
self.emoji.bounds = CGRect(x: 0, y: 0, width: 100, …Run Code Online (Sandbox Code Playgroud)