gpt4 book ai didi

objective-c - Objective-C 到 Swift 问题

转载 作者:行者123 更新时间:2023-11-28 13:20:33 25 4
gpt4 key购买 nike

多年来,我一直在尝试将此 Objective-C 转换为 Swift,但没有成功!有什么想法吗?

UIButton *button = (UIButton *)[self.view viewWithTag:recognizer.view.tag];

最佳答案

你可以这样做:

let button = view.viewWithTag(recognizer.view!.tag) as UIButton

关于objective-c - Objective-C 到 Swift 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26325562/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com