开发者

Xcode add same view from different controllers using class method

开发者 https://www.devze.com 2023-04-01 22:25 出处:网络
I am using loading indicator with background image and label. IBOutlet UIActivityIndicatorView *isLoading;

I am using loading indicator with background image and label.

IBOutlet UIActivityIndicatorView *isLoading;
IBOutlet UIImageView *isLoadingImageView;
IBO开发者_Python百科utlet UILabel *loadingLabel;

In my app this loading set is called like 5 6 times from different controllers. Is there any easy way to write a class like:IndicatorClass and class methods like:showLoadingSet hideLoadingSet to bring this set infront of my view. For example in mapController, i just only want to call [IndicatorClass showLoadingSet] and [IndicatorClass hideLoadingSet].

What I am doing is that I am creating IBOutlets for each controller, it is totally waste of time.

Is there any suggestion?

Thanks


You can have a peak at the MBLoadingHUD example. It sounds like you are trying to implement something similar to this. If not, you can always see how that class is used.

0

精彩评论

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