草庐IT

RLMEntityCapableCell

全部标签

ios - swift 3 : Is there a way to cast an object to a class and protocol at the same time?

我已经通读了Apple的SwiftiBook(类型转换和协议(protocol))的相关部分,但我似乎可以找到一种方法来指定对象是符合特定协议(protocol)的特定类的实例。作为tableView(_:,cellForRowAt:)中的示例,我想转换tableView.dequeueReusableCell(withIdentifier:reuseID,for:indexPath)返回的单元格作为UITableViewCell的子类,它符合RLMEntityCapableCell协议(protocol)(只是指定符合者有一个名为item的变量,它是的一个实例>Object,或其子类

ios - swift 3 : Is there a way to cast an object to a class and protocol at the same time?

我已经通读了Apple的SwiftiBook(类型转换和协议(protocol))的相关部分,但我似乎可以找到一种方法来指定对象是符合特定协议(protocol)的特定类的实例。作为tableView(_:,cellForRowAt:)中的示例,我想转换tableView.dequeueReusableCell(withIdentifier:reuseID,for:indexPath)返回的单元格作为UITableViewCell的子类,它符合RLMEntityCapableCell协议(protocol)(只是指定符合者有一个名为item的变量,它是的一个实例>Object,或其子类