Coder Social home page Coder Social logo

hkswift4.0basicdemo's Introduction

HKSwift4.0BasicDemo

swit4.0的基本使用

  1. Swift的基本数据类型 // 整型: Int, Int8, Int16, Int32, Int64 // 浮点型: Double, Float // 布尔类型: Bool // 字符型: Character // 文本类型: String // 集合类型: Array, Dictionary, Set // 元组: 创建或者传递一组数据 // 可选类型: 用于处理值缺失的情况

// 2. 常量和变量 // 常量 let // 变量 var

// 类型安全与推断 -- swift不用在变量后面加(:变量类型)系统可以自动推断

// 数值字面量

//3、元组--就是把多个值组合成一个复合值,而且可以是不同的类型

//4、可选类型-- 使用可选类型可以处理值缺失的情况

//5、基本运算符 //5.1区间运算符 //5.1.1闭区间运算符 (a...b) -- 定义一个包含从 a到 b所有值的区间,b的值大于 a; 在迭代一个区间的值时非常有用 //5.1.2半闭(开)区间群算符(a..<b) -- 定义一个从 a 到 b 但不包含 b的区间 //5.2空合运算符 ??

//6、字符串

//7、集合类型 //7.1 Array //字典

//控制流 //for循环 //while循环 //repeat while也就是OC中的do while //switch 匹配区间

//9函数

// 10. 闭包

hkswift4.0basicdemo's People

Contributors

hk13581836891 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.