代理的实现

#import <UIKit/UIKit.h>

@class ZBTabBar;

@protocol ZBTabBarDelegate <NSObject>

 

-(void)tabBar:(ZBTabBar *)tabBar didSelectButtonFrom:(int)from to:(int)to;

 

@end

 

@interface ZBTabBar : UIView

-(void)AddTabBarItemWithTabBarItem:(UITabBarItem *)item;

 

@property(nonatomic,weak)id<ZBTabBarDelegate> delegate;

 

@end

 

 

 

 

 

  if ( [self.delegate respondsToSelector:@selector(tabBar:didSelectButtonFrom:to:)]) {

        [self.delegate tabBar:self didSelectButtonFrom:self.tempButton.tag to:btn.tag];

    }

posted @ 2014-11-25 20:54  銱ル╬鎯噹  阅读(103)  评论(0编辑  收藏  举报