爲了實現這一點,您需要先設置根視圖控制器。
var window: UIWindow?
var navController:UINavigationController?
var viewController:ViewController?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
viewController = ViewController(nibName: "subview", bundle: nil);
navController = UINavigationController(rootViewController: viewController!);
navController?.navigationBarHidden = true
window?.rootViewController = navController;
window?.makeKeyAndVisible()
return true
}
之後單擊項目
You can see now PROJECT and TARGET
Click your project of TARGETS
Click General.
Now you can see the Deployment Info
Delete the Main from Dropbox of Main Interface
現在去子視圖XIB
Click Files's Owner of Placeholder'e.
Then click Identity Inspector of Utility Area which is in right side.
Click Class of CustomClass
Then choose ViewController from Dropdown box of class and click Enter.
And go to Connection's Inspector of Utility Area which is in right side.
Now See the Outlets.Under Outlets, there is View.Now You have drag(Contorl+ drag the Empty Circle to Xib View) the view empty circle to the Xib View.Now empty circle is filled with black or gray color.
Finally connect the textField and Button to Outlet.
現在,它的工作原理perfectly- :)
Bhavic我想你的項目,我得到了解決。 – user3182143
請寄給我你的mai ID。我將發送解決的項目。 – user3182143
Bhavik告訴我你的郵件ID。 – user3182143