开发者

How would I use a method from another class?

开发者 https://www.devze.com 2023-03-17 23:38 出处:网络
I have a class with a specific uisearchbar method.. How would I use the same method in another view (i.e. another class) that has another uisearchbar... Besides simply copying over the code? Would sub

I have a class with a specific uisearchbar method.. How would I use the same method in another view (i.e. another class) that has another uisearchbar... Besides simply copying over the code? Would subcla开发者_高级运维ssing work in this case?

Thanks


Put it as a method in the App delegate.You can access the app delegate in any of the views. [I know its ugly, but it seems the simplest way, If subclassing or category are too much of an overhead.]

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号