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初体验之HelloWord+苹果Swift编程语言新手教程【中文版】的更多相关文章
- Swift开发实例:苹果Swift编程语言新手教程中文版+FlappyBird,2048游戏源代码
源代码: 用IOS Swift语言实现的Flappy Bird源代码:http://download.csdn.net/detail/estellise/7449547 用IOS Swift实现的游戏 ...
- 苹果Swift编程语言新手教程【中国版】
Swift代码语言教程:在刚刚过去的WWDC2014大会上,苹果公司新公布了一种编程语言Swift.据悉.Swift语言继承了C语言以及Objective-C的特性,且克服了C语言的兼容性问题.对于广 ...
- swift编程语言基础教程 中文版
swift编程语言基础教程 中文版 http://download.csdn.net/detail/u014036026/7845491
- Swift初体验(两)
// 写功能初体验 func getMyName(firstName first:String, lastName last:String) -> String{ //return first ...
- 苹果Swift编程语言新手教程【中文版】
文件夹 1 简单介绍 2 Swift入门 3 简单值 4 控制流 5 函数与闭包 6 对象与类 7 枚举与结构 1 简单介绍 Swift是供iOS和OS X应用编程的新编程语言,基于C和Objecti ...
- swift初体验
swift是一门类型安全的语言,同样也是基于c语言 那么c语言的一些类型也是实用的,不同的是:swift声明变量和常量是不一样的 let:用来修饰常量:var用来修饰变量 e.g: let num=1 ...
- Swift初体验之图案锁
这篇在应用上貌似没有价值,貌似我写了好多实际上都没有价值,这里贴出来就是分享下. 自己写swift好多天了,感觉好多东西还是不太懂,边学边做,互勉! 先上图: 代码:下载
- Swift初体验(三)
/*******************************************************************************/ // 协议 protocol Des ...
- Swift初体验 (一)
// 声明一个常量 let maxNumberOfStudents: Int = 47 // 声明一个变量,假设没有在声明的时候初始化,须要显示的标注其类型 var currentNumberOfSt ...
随机推荐
- Unity Shader-热空气扭曲效果
GrabPass GrabPass是Unity为我们提供的一个很方便的功能,可以直接将当前屏幕内容渲染到一张贴图上,我们可以直接在shader中使用这张贴图而不用自己去实现渲染到贴图这样的一个过程,大 ...
- C-基础:memcpy、memset、memmove、memcmp、memchr
一,原型 void * memcpy ( void * destination, const void * source, size_t num ); 功能:将以source作为起始地址的数据复制nu ...
- ImportError: pycurl: libcurl link-time ssl backend (nss) is different
reference pip uninstall pycurl export PYCURL_SSL_LIBRARY=nss easy_install pycurl
- python interview questions
referce:python interview questions top 50 refercence:python interview questions top 15 summary Q: wh ...
- Puppeteer-常规操作一
这里不讲 Puppeteer 怎么使用,主要讲一些常规操作在这里如何通过另类方法实现.等实现后,你就会感觉,嗯~~ 真香! 场景一 已经找出要的元素,现在有需求再继续寻找他的子元素 第一种.将父元素带 ...
- XML 解析 & 特殊字符报错
在xml文件中,有一些符号是具有特殊意义的,如果直接使用会导致xml解析报错,为了避免错误,我们需要将特殊的字符使用其对应的转义实体进行操作.这些字符如下 < == < > = ...
- python解决鸡兔同笼问题
# 这个问题,是我国古代著名趣题之一. # 大约在1500年前,<孙子算经>中就记载了这个有趣的问题. # 书中是这样叙述的:“今有雉兔同笼,上有三十五头,下有九十四足, # 问雉兔各几何 ...
- 利用system-config-kickstart实现半自动化安装
老司机开车了… 上车请坐稳… centos7系统 首先确认已经安装了system-config-kickstart包,如果没有安装就yum install system-config-kickstar ...
- 上传文件到Ubuntu阿里云服务器(windows到Linux的文件上传)
上传文件到Ubuntu阿里云服务器(windows到Linux的文件上传) 最近在阿里云上面租了一个轻量级服务器玩玩,学习学习怎么在服务器部署网站.然后嘞,在想要将本地文件上传到服务器的时候,自己研究 ...
- perl学习之:@_ $_
question 1 :数组@xxx调用时,每个元素应该用$xxx[0]/$xxx[1]... 来表示所以$_[0]表示@_的一个元素,和默认缺省变量$_无关,是两个东西请查阅数组元素调用相关章节 ...