swift program to interface

后端 未结 2 1837
故里飘歌
故里飘歌 2021-01-26 13:44

class Car and Truck are written here as an example but they could be unknown to the program at compile time.

there could be more kinds of cars not yet known

for

2条回答
  •  猫巷女王i
    2021-01-26 14:23

    You want to use Self. In a protocol, it means "the type that actually adopts me". In a method of a class, it means "the class in which this method is actually called".

提交回复
热议问题