随笔分类 -  swift

摘要:Premature optimisation is the root of all evil. But, there are moments where we need to optimise our code. Let’s see how to improve the performance of 阅读全文
posted @ 2019-09-07 15:03 三江汇流 阅读(251) 评论(0) 推荐(0)
摘要:throws抛出异常, 那么就必须通过try来处理 try : 标准的处理方式, 该方式必须结合do catch来处理 try? :告诉系统可能有错, 也可能没错, 如果发生错误, 那么返回nil, 如果没有发生错误, 会见数据包装成一个可选类型的值返回给我们这种使用方式, 相当于忽略错误 try! 阅读全文
posted @ 2019-07-23 20:09 三江汇流 阅读(1536) 评论(0) 推荐(0)
摘要:let age = 22 let sex = "girl" if (sex == "girl" && age = 18 && age 阅读全文
posted @ 2019-07-22 23:57 三江汇流 阅读(1670) 评论(0) 推荐(0)