设置App图标
在Assets.xcassets的AppIcon中添加图片。
设置App名称
工程 -》 Info -》 添加Key:“Bundle Display Name“ 和 Value:App名称
设置App启动图片
在Assets.xcassets的LaunchImage中添加图片。
工程 -》 General -》 App Icons and Launch Images -》 Launch Images Source设置为LaunchImage
-》 Launch Screen File内容删除为空
将LaunchScreen.storyboard中的Use as Launch Screen复选框取消勾选,如下图所示。
若第一次运行不能正确显示,可以把App删掉重装试一下。
设置启动App之后的首界面
在AppDelegate.swift中设置viewController:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { self.window = UIWindow(frame: UIScreen.mainScreen().bounds) self.window?.makeKeyAndVisible() let root = RootViewController() self.window?.rootViewController = root // Override point for customization after application launch. return true }
此时会出现"loaded 'XXXnib' but the view outlet was not set"的错误,需要关联xib。
关联xib:
在xib的File's Owner中设置Custom Class。
control键 + File's Owner,将弹出的提示框中Outlets的view关联到xib的View上。
文本框输入为密码形式
在xib中将文本框属性的Secure Text Entry复选框选中。