From cc9025f1a76ef0301b4e402d9ec68b38974d39a2 Mon Sep 17 00:00:00 2001 From: mrdaios Date: Thu, 28 May 2015 17:01:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0visibleViews=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E6=98=BE=E7=A4=BA=E4=B8=80=E7=B1=BBView=E3=80=82[[MMP?= =?UTF-8?q?laceHolderConfig=20defaultConfig].visibleViews=20addObject:[UIB?= =?UTF-8?q?utton=20class]];?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MMPlaceHolder/MMPlaceHolder.h | 1 + MMPlaceHolder/MMPlaceHolder.m | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/MMPlaceHolder/MMPlaceHolder.h b/MMPlaceHolder/MMPlaceHolder.h index 02328e8..e74219a 100644 --- a/MMPlaceHolder/MMPlaceHolder.h +++ b/MMPlaceHolder/MMPlaceHolder.h @@ -25,6 +25,7 @@ @property (nonatomic, assign) BOOL visible; @property (nonatomic, assign) BOOL autoDisplay; +@property (nonatomic, strong) NSMutableArray *visibleViews; @end diff --git a/MMPlaceHolder/MMPlaceHolder.m b/MMPlaceHolder/MMPlaceHolder.m index 7a61aaf..9aedf17 100644 --- a/MMPlaceHolder/MMPlaceHolder.m +++ b/MMPlaceHolder/MMPlaceHolder.m @@ -35,6 +35,7 @@ - (id)init self.visible = YES; self.autoDisplay = NO; + self.visibleViews = [NSMutableArray array]; } return self; @@ -253,6 +254,13 @@ - (void)checkAutoDisplay { [self showPlaceHolder]; } + else if ([MMPlaceHolderConfig defaultConfig].visibleViews.count>0) + { + if([[MMPlaceHolderConfig defaultConfig].visibleViews containsObject:[self class]]) + { + [self showPlaceHolder]; + } + } } }