Appdelegate.swift:
<span style= "FONT-SIZE:24PX;" ><strong>////appdelegate.swift//swifthelloword////Created by Jason on 14-6-5.//Copyright (c) 2014 Jasona Pp. All rights Reserved.//import Uikit@uiapplicationmainclass Appdelegate:uiresponder, uiapplicationdelegate { var Window:uiwindow? Func application (application:uiapplication, Didfinishlaunchingwithoptions launchoptions:nsdictionary?)), Bool {//Override point for customization after application launch. return true} func applicationwillresignactive (application:uiapplication) {//Sent when the application is About-to-move from active-to-inactive state. This can occur for certain types of temporary interruptions (such as a incoming phone call or SMS message) or when the US Er quits the application and it begins the transition to the background state. Use the This method to the pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func Applicationdidenterbackground (application:uiapplication) {//Use this method to release shared resource s, save user data, invalidate timers, and store enough application state information to restore your application to its CU Rrent state in case it is terminated later. If your application supports background execution, this method is called instead of aPplicationwillterminate:when the user quits. } func Applicationwillenterforeground (application:uiapplication) {//called as part of the transition from the Background to the inactive state; Here's can undo many of the changes made on entering the background. } func applicationdidbecomeactive (application:uiapplication) {//Restart any tasks, were paused (or not ye T started) while the application was inactive. If the application is previously in the background, optionally refresh the user interface. } func applicationwillterminate (application:uiapplication) {//Called when the application are about to Termina Te. Save data if appropriate. See also Applicationdidenterbackground:. }}</strong></span>
Viewcontroller.swift:
<span style= "FONT-SIZE:24PX;" ><strong>//// viewcontroller.swift// swifthelloword//// Created by Jason on 14-6-5.// Copyright (c) 2014 Jasonapp. All rights Reserved.//import Uikitclass Viewcontroller:uiviewcontroller { @IBOutlet var swiftlabel:uilabel Override Func Viewdidload () { super.viewdidload () //Do any additional setup after loading the view, typically fro M a nib. } @IBAction func swiftbuttonpressed (Sender:uibutton) { } override Func didreceivememorywarning () { Super.didreceivememorywarning () //Dispose of any resources, can be recreated. }} </strong></span>
Main.storyboard:
Download:
Apple Swift programming language Beginner Tutorial "Chinese version". pdf
Swift first experience helloword+ Apple Swift programming language beginner's Tutorial "Chinese version"