读书笔记-2019年03月13日

今日见闻

今日重要的三件事

今日记录

参观极光的产品

极光推送 - JPush 产品简介 - 极光文档
极光IM - JMessage 产品简介 - 极光文档

极光IM导入文档里引起了我对IOS第三方库安装的兴趣

读书笔记-2019年03月13日

像Android的jcenter,maven仓库等。这个引起了我的兴趣。

CocoaPods.org所有的pod库在这里可以找到

CocoaPods/Specs: The CocoaPods Master Repo在这个github库里有所有的repo,里面放的是spec文件

podspec.json文件是描述这个库的文件。

读书笔记-2019年03月13日

如何写一个Pod,并发布到CocoaPods上 - 程小龙 - ****博客

这篇博文说明了怎么发布一个库。

ReactNative

关于ScrollView的RefreshControl靠谱的

React-Native RefreshControl下拉刷新 - 简书
ReactNative 填坑 通过 ScrollView的refreshControl 进行刷新页面数据-Android学习-朝舞网
ReactNative ScrollView 实现上拉加载/下拉刷新功能 - 简书

Kotlin在android中的使用

活捉一个妹子程序员还是个Androider
会撒娇的犀犀利 - 简书

Kotlin 文档

Reference - Kotlin Programming Language

Kotlin可空类型与? ?: ?. !! - 落幕夜未央 - 博客园

Null Safety - Kotlin Programming Language
Elvis operator - Wikipedia

val a : String? = null

val b : Double? = 10.0

var list : List<String?> = listOf(null, null)

var list : List<String?>? = listOf(null, null)

list.size
//以上这五行代码都对

val a : String = null //这个错误,Remember that if a var is not nullable then you cannot set it to null.

Remember that you can use the question mark "?" to declare a variable as null, but you can still set a value to it.

Remember that a list in Kotlin can contain null items as well as be null itself
Remember that you can check if a variable is equal to null using the equality operator "==" or using the question mark "?" when using it

var rainbowColor = "red"
rainbowColor = "blue"
val blackColor = "black"
blackColor = "white" // Error


var greenColor = null
var blueColor: Int? = null



listOf(null,null)
[null, null]
var list: List<Int?> = listOf(null, null)
var list2:List<Int>? = null

println(nullTest2?.inc() ?:0)

读书笔记-2019年03月13日
读书笔记-2019年03月13日
读书笔记-2019年03月13日

val trout = "trout"
var haddock = "haddock"
var snapper = "snapper"
println("I like to eat $trout and $snapper, but not a big fan of $haddock.")


when(fishName.length){
    0 -> println("Fish name cannot be empty")
    in 3..12 -> println("Good fish name")
    else -> println("OK fish name")
}

读书笔记-2019年03月13日

读书笔记-2019年03月13日

读书笔记-2019年03月13日

读书笔记-2019年03月13日


读书笔记-2019年03月13日
读书笔记-2019年03月13日

var list3 : MutableList<Int> = mutableListOf()
for (i in 0..100 step 7) list3.add(i)
print(list3)
[0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98]
OR

for (i in 0..100 step 7) println(i.toString() + " - ")

读书笔记-2019年03月13日