Swift简介

Apple在2014 WWDC上发布了新的编程语言Swift,用于iOS/OS X上的项目开发。 


Swift是一种强类型(strongly typed)语言,变量类型在编译的时候决定,但是它支持类型推导(type inference),所以很多时候不需要指明类型。

            var name = "Jonathan"  //type inference, variable name is String

  

Swift借鉴了很多现代编程语言的特性,比如闭包(Closure),自动内存管理(ARC),泛型(Generics),函数编程等等。同时Swift非常关注编程的安全性,比如变量使用前初始化,数组和整数的越界检查,自动内存管理等。Swift会通过LLVM编译成原生代码,来保持在iOS/OS X设备上运行的高性能。

   

为了保证开发人员可以继续使用以前开发的代码和库,Swift和Objective-C有很好的互操作性。在Swift中可以非常容易的调用Objective-C,在Objective-C中也可以非常容易的调用Swift代码。


Swift自带REPL(Read-Eval-Print-Loop)环境用于代码测试,一边写代码,一边就可以看到运行结果。


Swift开发的程序可以运行在新的iOS 8和OS X Yosemite上,Xcode 6 Beta版提供Swift的开发环境。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Swift iOS Programming for Kids by Steffen D. Sommer English | 22 Mar. 2017 | ASIN: B01N6E8EB9 | 296 Pages | AZW3 | 11.33 MB Key Features Children can express their creativity while learning through interactive Swift Playgrounds Empower children to think critically about problems Learning programming basics can help children gain confidence in problem solving Help children put their imagination into action building their first iOS app Book Description This book starts at the beginning by introducing programming through easy to use examples with the Swift Playgrounds app. Kids are regularly encouraged to explore and play with new concepts to support knowledge acquisition and retention – these newly learned skills can then be used to express their own unique ideas. Children will be shown how to create their first iOS application and build their very own movie night application. What you will learn Basic programming and coding fundamentals Write code using the fun and interactive Swift Playgrounds app Make animations, including creating your own starry night Utilise functions by making pizza in code Create an interactive toy bin Learn how to use control flow statements to further enhance your toy bin Build a simple movie night app working with tableviews and arrays About the Author Since Swift was announced at WWDC, Steffen D. Sommer has had a passionate interest in the programming language. He's currently working as a lead Vapor developer at a company called Nodes in Copenhagen, where he focuses on developing backend systems using Swift. In his spare time, he helps organize the local iOS meet up, visits iOS conferences around the world, and explores the different aspects of and use cases for Swift, such as putting Swift on the server and doing functional programming in Swift. You can also find him contributing to open source projects on GitHub or blogging on his personal website. Jim Campagno is an iOS developer and teacher living in New York City. He's currently working as an iOS instructor at the Flatiron School, helping beginners of Swift and iOS become iOS developers. Jim has a deep desire and high level of creativity that he brings to teaching. He created the Swift online course offered at Flatiron School, which includes in-depth readings along with test-driven labs, challenging the student to write code in Swift. Jim also runs an active YouTube channel, putting out in-depth content and helping students understand everything in iOS and Swift—from the basics to complex topics. Most importantly, Jim ensures that the content he creates is accessible, fun, and interactive. He enjoys putting together a story behind every topic to make it more enjoyable for the reader. Table of Contents What is Programming? Getting Set Up Say Hello Favorite Things Factories Making Pizza Toy Bin Smarter Toy Bin Making Some Friends Pokemon Battle Simon Says Starry Night Space Pizza Delivery Movie Night - iOS App
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值