摘要:
可以在类、结构体、协议中定义属性,属性可以是变量,也可以是常量。 ###1.在结构体中声明属性: struct RectStore{ var length : Int var breadth : Int } var r = RectStore(length:5,breadth:5)//length 阅读全文
posted @ 2021-07-06 13:41
蓬松小辉煌
阅读(169)
评论(0)
推荐(1)
摘要:
###1.声明protocol protocol myFirstProtocol{ //properties and methods declarations go in here. } ###2.引用协议 结构体、类、枚举都可以实现协议 class A : myFirstProtocol{ //e 阅读全文
posted @ 2021-07-06 10:18
蓬松小辉煌
阅读(75)
评论(0)
推荐(1)
浙公网安备 33010602011771号