Swift first experience helloword+ Apple Swift programming language beginner's Tutorial "Chinese version"

Source: Internet
Author: User

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.