BLOCK

#import <UIKit/UIKit.h>

 

typedef void (^BLOCK)(UIColor *);

 

@interface SecondViewController : UIViewController

 

@property(nonatomic,copy)BLOCK backColorBlcok;

 

@end

 

 

 

 

 

 

 SecondViewController *secondVc = [[SecondViewController alloc] init];

    secondVc.backColorBlcok = ^(UIColor *color){

        self.view.backgroundColor = color;

    };

    [self.navigationController pushViewController:secondVc animated:YES];

posted @ 2016-01-27 20:22  sunflower-lhb  阅读(98)  评论(0编辑  收藏  举报