76

使用Kotlin高效地开发Android App(二) - 简书

 6 years ago
source link: https://www.jianshu.com/p/768bc9310c5e?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
继上一篇文章介绍了项目中所使用的Kotlin特性,本文继续整理当前项目所用到的特性。 一.apply 函数 和 run 函数 with、apply、run函数都是Kotlin标准库中的函数。with在第一篇文章中已经介绍过。 1.1 apply函数 apply函数是指在函数块内可以通过 this 指代该对象,返回值为该对象自己。在链式调用中,可以考虑使用它来不破坏链式。 举个例子: 执行结果...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK