1. filter (过滤器):返回符合条件的一个数组 let arr = [1,5,6,7,10,0] //写法1 let arr1 = arr.filter { (item) -> Bool in return item % 2 == 0 ... ...
分类:
编程语言 时间:
2018-10-23 14:49:29
阅读次数:
145
首先我们了解一下Ceph系统中的寻址流程,如下图所示:本文部分参考来自http://www.csdn.net/article/2014-04-08/2819192-ceph-swift-on-openstack-m/2
分类:
其他好文 时间:
2018-10-17 18:32:49
阅读次数:
165
if #available(iOS 8.0, *){ if let url = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(url){ ... ...
分类:
移动开发 时间:
2018-10-17 12:14:22
阅读次数:
201
App架构:(Swift) App设计模式: Coordinator[k??'?:d?ne?t?] 协调者 ?Model-View-Controller(MVC) ?Model-View-ViewModel+Coordinator(MVVM-C) ?Model-View-Controller+Vie ...
分类:
移动开发 时间:
2018-10-16 10:56:05
阅读次数:
245
Shorthand Argument Names Swift automatically provides shorthand argument names to inline closures, which can be used to refer to the values of the clo ...
分类:
其他好文 时间:
2018-10-10 14:15:33
阅读次数:
147
代码如上,结果显示的时候竟然出现scroll滚动之后,背景里面还有未滚动的样子,傻眼了,差了几小时才记起来在父Controller里面已经吊用了setupUI方法,这里super后重复调用了setupUI导致此bug,回去抽自己个嘴巴。。。。 ...
分类:
编程语言 时间:
2018-10-09 12:19:48
阅读次数:
202
[TOC] 前言 程序 算法 + 数据结构 = 程序 数据是一切程序的核心. 数据结构是数据在计算机中的类型和组织方式 算法是处理数据的方式,算法有优劣之分 写程序难点 理不清数据 搞不清处理方法 无法把数据设计转换成数据结构,无法把处理方法转换成算法 无法用设计范式来进行程序设计 时间程序皆有bu ...
分类:
编程语言 时间:
2018-10-07 11:03:58
阅读次数:
234
try You have 2 options when you try calling a function that may throw. You can take responsibility of handling errors by surrounding your call within ...
分类:
编程语言 时间:
2018-09-30 18:24:08
阅读次数:
175
C 语言是最佳选择 从2000年5月29日发布至今,SQLite 一直都是用 C 语言实现。C 一直是实现像 SQLite 这类软件库的最佳语言。目前,还没有任何计划要采用另外一门语言对 SQLite 进行重新开发。 为什么 C 语言是实现 SQLite 的最佳选择?原因主要体现在这几个方面: 性能 ...
分类:
数据库 时间:
2018-09-30 14:49:09
阅读次数:
157
除了使用函数做为获取接口的方法外,在swift中给出了private(set)申明的方式来限制外部对属性的修改.但在当前文件中依然可改. 例:private(set) var name : String? ...
分类:
编程语言 时间:
2018-09-28 12:52:14
阅读次数:
145