Swift初体验之HelloWord+苹果Swift编程语言入门教程【中文版】

AppDelegate.swift :

<span style="font-size:24px;"><strong>//
//  AppDelegate.swift
//  SwiftHelloWord
//
//  Created by jason on 14-6-5.
//  Copyright (c) 2014年 JasonApp. All rights reserved.
//

import UIKit

@UIApplicationMain
class 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 an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to 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 resources, save user data, invalidate timers, and store enough application state information to restore your application to its current 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 you can undo many of the changes made on entering the background.
    }

    func applicationDidBecomeActive(application: UIApplication) {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    }

    func applicationWillTerminate(application: UIApplication) {
        // Called when the application is about to terminate. 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 UIKit

class ViewController: UIViewController {

    @IBOutlet var swiftLabel : UILabel

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    @IBAction func swiftButtonPressed(sender : UIButton) {

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}
</strong></span>

Main.storyboard:



下载:

苹果Swift编程语言入门教程【中文版】.pdf

时间: 2024-10-23 05:39:29

Swift初体验之HelloWord+苹果Swift编程语言入门教程【中文版】的相关文章

Swift 编程语言入门教程_Swift

原文地址:http://gashero.iteye.com/blog/2075324 目录 1   简介 2   Swift入门 3   简单值 4   控制流 5   函数与闭包 6   对象与类 7   枚举与结构 1   简介 今天凌晨Apple刚刚发布了Swift编程语言,本文从其发布的书籍<The Swift Programming Language>中摘录和提取而成.希望对各位的iOS&OSX开发有所帮助. Swift是供iOS和OS X应用编程的新编程语言,基于C和Obj

程序员眼中的苹果Swift语言:简单 易学 高效

[摘要]Swift正式曝光在镁光灯前,叹息声.惊呼声此起彼伏.不过不用太过担心,Objective-C.Swift能够在同一个应用程序中并存.程序员眼中的苹果Swift语言:简单 易学 高效6月8日消息,对于苹果开发者来说,如今已经进入了"Swift时代".虽然编程语言Objective C备受喜爱,不过它作为苹果主流编程语言的日子已经所剩无几.随着WWDC开发者大会的落幕,Swift即将取而代之,成为苹果新iOS 8.OS X Yosemite的新宠.美国时间6月2日举行的苹果WWD

苹果公司编程语言Swift语言简介_Swift

Swift 是一门新的编程语言,用于编写 iOS 和 OS X 应用程序.Swift 结合了 C 和 Objective-C 的优点并且不受C兼容性的限制.Swift 使用安全的编程模式并添加了很多新特性,这将使编程更简单,扩展性更强,也更有趣.Swift 支持 Cocoa 和 Cocoa Touch 框架. Swift 的开发从很久之前就开始了.为了给 Swift 打好基础,苹果公司改进了编译器,调试器和框架结构,让 Swift 使用自动引用计数(Automatic Reference Cou

15个快速学习苹果Swift编程语言的入门教程

要说今年最火的编程语言是什么.那就非Swift莫属了.当然最主要还是市场炒的比较热,加上官方Swift教程<The Swift Programming Language>在北航的大三学生发起在github上进行协同翻译获得了很高的人气,短短几天时间内<Swift中文版>第一版就发布.这真是不火不行了. Swift是苹果公司在WWDC2014上发布的全新开发语言.从演示视频及随后在appstore上线的标准文档看来,语法内容混合了OC,JS,Python,语法简单,使用方便,并可与O

苹果公司推出的新编程语言Swift简介和入门教程_IOS

一.Swift是什么? Swift是苹果于WWDC 2014发布的编程语言,这里引用The Swift Programming Language的原话: 复制代码 代码如下: Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility.Swift adopts sa

揭秘苹果新编程语言Swift:用时不到4年 底层架构一个人完成

揭秘苹果新编程语言Swift:用时不到4年 底层架构一个人完成据国外媒体报道,苹果新编程语言Swift,从开始研发到最终发布仅用了不足4年时间.该语言背后的创造者为苹果 开发者工具部门总监克里斯·拉特纳 (Chris Lattner),根据其在博客上的表述,Swift的底层架构大多由其一人开发完成,而开发期间,仅少数内部人士对此项目知晓.Swift语言开发工作是从2010年7月开始,但直到2013年才获得了苹果开发者工具部门的重视.拉特纳表示,大多数早期架构的开发是由其个人独自完成的,但到了20

苹果新编程语言Swift仅耗时4年完成开发

Swift创造者克里斯·拉特纳 &http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 6月5日消息,据国外媒体报道,苹果新编程语言Swift,从开始研发到最终发布仅用了不足4年时间.该语言背后的创造者为苹果开发者工具部门总监克里斯·拉特纳(Chris Lattner),根据其在博客上的表述,Swift的底层架构大多由其一人开发完成,而开发期间,仅少数内部人士对此项目知晓. Swift语言开发工作是从2010年7月开始,

swift编程语言入门介绍

  swift是什么? swift是苹果于wwdc 2014发布的编程语言,这里引用the swift programming language的原话: swift is a new programming language for ios and os x apps that builds on the best of c and objective-c without the constraints of c compatibility. swift adopts safe programm

苹果Swift编程的优缺点:即时预览 排他性

6月9日消息,据Fool报道,苹果上周一召开了WWDC大会,让数以百万计消费者失望的是,本次大会并没有发布新款硬件. 不过请记住,"WWDC"中的"D"是"Developers(开发者)"的缩写,本次会议的主题完全以软件为中心.除了发布iOS 8之外,苹果还公布了两个广受期待的智能家居和健康数据聚合套件.   但是对于软件工程师而言,本次WWDC大会上最重要的是名为Swift的新编程语言的发布.   Swift的优势   具体说来,苹果表示Swi