• The Basics


    “Swift is a new programming language for iOS and OS X app development. Nonetheless, many parts of Swift will be familiar from your experience of developing in C and Objective-C.”

    “Swift provides its own versions of all fundamental(基本的,根本的) C and Objective-C types, including Int for integers; Double and Float for floating-point values; Bool for Boolean values; and String for textual data. Swift also provides powerful versions of the two primary collection types, Array and Dictionary, as described in Collection Types.”
    “Like C, Swift uses variables to store and refer to values by an identifying name. Swift also makes extensive use of variables whose values cannot be changed. These are known as constants, and are much more powerful than constants in C. Constants are used throughout Swift to make code safer and clearer in intent when you work with values that do not need to change.”

    “In addition to familiar types, Swift introduces advanced types not found in Objective-C. These include tuples, which enable you to create and pass around groupings of values. Tuples can return multiple values from a function as a single compound value.”

    “Swift also introduces optional types, which handle the absence of a value. Optionals say either “there is a value, and it equals x” or “there isn’t a value at all”. Optionals are similar to using nil with pointers in Objective-C, but they work for any type, not just classes. Optionals are safer and more expressive than nil pointers in Objective-C and are at the heart of many of Swift’s most powerful features.

    Optionals are an example of the fact that Swift is a type safe language. Swift helps you to be clear about the types of values your code can work with. If part of your code expects a String, type safety prevents you from passing it an Int by mistake. This enables you to catch and fix errors as early as possible in the development process.”


  • 相关阅读:
    集合的泛型
    Strom的集群停止以及启动
    Strom简介,以及安装,和官方案例测试
    089实战 Nginx的安装
    088实战 项目技术框架
    087实战 集群的规模
    086实战 项目开发流程,以及什么是数据分析平台,再者为什么要做数据分析平台,数据来源,数据处理流程
    085 HBase的二级索引,以及phoenix的安装(需再做一次)
    084 HBase的数据迁移(含HDFS的数据迁移)
    083 HBase的完全分布式的搭建与部署,以及多master
  • 原文地址:https://www.cnblogs.com/ghgyj/p/4048098.html
Copyright © 2020-2023  润新知