diff --git a/Classes/MMPopupCategory.m b/Classes/MMPopupCategory.m index 432ff4c..4f5ef73 100644 --- a/Classes/MMPopupCategory.m +++ b/Classes/MMPopupCategory.m @@ -326,6 +326,7 @@ - (void)mm_hideDimBackground if ( finished ) { self.mm_dimBackgroundAnimating = NO; + self.mm_dimBackgroundBlurEnabled = NO; if ( self == [MMPopupWindow sharedWindow].attachView ) { diff --git a/Classes/MMPopupView.m b/Classes/MMPopupView.m index 6fa9a5d..767d4de 100644 --- a/Classes/MMPopupView.m +++ b/Classes/MMPopupView.m @@ -167,7 +167,7 @@ - (MMPopupBlock)alertShowAnimation MMWeakify(self); MMPopupBlock block = ^(MMPopupView *popupView){ MMStrongify(self); - + if ( !self.superview ) { [self.attachedView.mm_dimBackgroundView addSubview:self]; @@ -241,13 +241,13 @@ - (MMPopupBlock)sheetShowAnimation { [self.attachedView.mm_dimBackgroundView addSubview:self]; - [self mas_updateConstraints:^(MASConstraintMaker *make) { + [self mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.attachedView); make.bottom.equalTo(self.attachedView.mas_bottom).offset(self.attachedView.frame.size.height); }]; - [self layoutIfNeeded]; + [self.superview layoutIfNeeded]; } - + [UIView animateWithDuration:self.animationDuration delay:0 options:UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState @@ -256,7 +256,7 @@ - (MMPopupBlock)sheetShowAnimation [self mas_updateConstraints:^(MASConstraintMaker *make) { make.bottom.equalTo(self.attachedView.mas_bottom).offset(0); }]; - + [self.superview layoutIfNeeded]; } @@ -266,7 +266,6 @@ - (MMPopupBlock)sheetShowAnimation { self.showCompletionBlock(self, finished); } - }]; }; @@ -318,10 +317,10 @@ - (MMPopupBlock)customShowAnimation if ( !self.superview ) { [self.attachedView.mm_dimBackgroundView addSubview:self]; - [self mas_updateConstraints:^(MASConstraintMaker *make) { + [self mas_makeConstraints:^(MASConstraintMaker *make) { make.center.equalTo(self.attachedView).centerOffset(CGPointMake(0, -self.attachedView.bounds.size.height)); }]; - [self layoutIfNeeded]; + [self.superview layoutIfNeeded]; } [UIView animateWithDuration:self.animationDuration diff --git a/Classes/MMPopupWindow.m b/Classes/MMPopupWindow.m index 00c8c10..6a65982 100644 --- a/Classes/MMPopupWindow.m +++ b/Classes/MMPopupWindow.m @@ -20,6 +20,10 @@ @interface MMPopupWindow() @implementation MMPopupWindow +- (void)dealloc { + printf("dealloc"); +} + - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; diff --git a/MMPopupView/MMDateView.m b/MMPopupView/MMDateView.m index 6986785..e650def 100644 --- a/MMPopupView/MMDateView.m +++ b/MMPopupView/MMDateView.m @@ -58,6 +58,9 @@ - (instancetype)init [self.btnConfirm setTitleColor:MMHexColor(0xE76153FF) forState:UIControlStateNormal]; self.datePicker = [UIDatePicker new]; + self.datePicker.datePickerMode = UIDatePickerModeDate; + NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; + self.datePicker.locale = locale; [self addSubview:self.datePicker]; [self.datePicker mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self).insets(UIEdgeInsetsMake(50, 0, 0, 0)); diff --git a/MMPopupView/MMPopupView.xcodeproj/project.pbxproj b/MMPopupView/MMPopupView.xcodeproj/project.pbxproj index fa80695..c68130c 100644 --- a/MMPopupView/MMPopupView.xcodeproj/project.pbxproj +++ b/MMPopupView/MMPopupView.xcodeproj/project.pbxproj @@ -10,7 +10,6 @@ C3A6D7C7352C468FC6AFBD15 /* libPods-MMPopupView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A4EBFF7F54A0C418E7302440 /* libPods-MMPopupView.a */; }; ED1E99341B9BD5C20093760A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = ED1E99331B9BD5C20093760A /* main.m */; }; ED1E99371B9BD5C20093760A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = ED1E99361B9BD5C20093760A /* AppDelegate.m */; }; - ED1E993A1B9BD5C20093760A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ED1E99391B9BD5C20093760A /* ViewController.m */; }; ED1E993D1B9BD5C20093760A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED1E993B1B9BD5C20093760A /* Main.storyboard */; }; ED1E993F1B9BD5C20093760A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ED1E993E1B9BD5C20093760A /* Assets.xcassets */; }; ED1E99421B9BD5C20093760A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ED1E99401B9BD5C20093760A /* LaunchScreen.storyboard */; }; @@ -22,6 +21,7 @@ ED1E995C1B9BEE8F0093760A /* MMSheetView.m in Sources */ = {isa = PBXBuildFile; fileRef = ED1E995B1B9BEE8F0093760A /* MMSheetView.m */; }; ED1E995F1B9C22F50093760A /* MMPinView.m in Sources */ = {isa = PBXBuildFile; fileRef = ED1E995E1B9C22F50093760A /* MMPinView.m */; }; EDB365121B9D3323003A0B05 /* MMDateView.m in Sources */ = {isa = PBXBuildFile; fileRef = EDB365111B9D3323003A0B05 /* MMDateView.m */; }; + F727A5501F4DD578009CB7FF /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FEE3EB201BDF7155009D7AEA /* ViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -31,8 +31,6 @@ ED1E99331B9BD5C20093760A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; ED1E99351B9BD5C20093760A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; ED1E99361B9BD5C20093760A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - ED1E99381B9BD5C20093760A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - ED1E99391B9BD5C20093760A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; ED1E993C1B9BD5C20093760A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; ED1E993E1B9BD5C20093760A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; ED1E99411B9BD5C20093760A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -54,6 +52,8 @@ ED1E995E1B9C22F50093760A /* MMPinView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMPinView.m; path = ../MMPinView.m; sourceTree = ""; }; EDB365101B9D3323003A0B05 /* MMDateView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMDateView.h; sourceTree = SOURCE_ROOT; }; EDB365111B9D3323003A0B05 /* MMDateView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMDateView.m; sourceTree = SOURCE_ROOT; }; + FEE3EB1F1BDF7155009D7AEA /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + FEE3EB201BDF7155009D7AEA /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; FF8DF09A03ED96B87C4FB5EA /* Pods-MMPopupView.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MMPopupView.release.xcconfig"; path = "Pods/Target Support Files/Pods-MMPopupView/Pods-MMPopupView.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -110,8 +110,8 @@ children = ( ED1E99351B9BD5C20093760A /* AppDelegate.h */, ED1E99361B9BD5C20093760A /* AppDelegate.m */, - ED1E99381B9BD5C20093760A /* ViewController.h */, - ED1E99391B9BD5C20093760A /* ViewController.m */, + FEE3EB1F1BDF7155009D7AEA /* ViewController.h */, + FEE3EB201BDF7155009D7AEA /* ViewController.m */, ED1E995D1B9C22F50093760A /* MMPinView.h */, ED1E995E1B9C22F50093760A /* MMPinView.m */, EDB365101B9D3323003A0B05 /* MMDateView.h */, @@ -181,11 +181,12 @@ ED1E99271B9BD5C20093760A /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0830; ORGANIZATIONNAME = LJC; TargetAttributes = { ED1E992E1B9BD5C20093760A = { CreatedOnToolsVersion = 7.0; + DevelopmentTeam = J7XJK67HUB; }; }; }; @@ -258,8 +259,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F727A5501F4DD578009CB7FF /* ViewController.m in Sources */, ED1E99551B9BDE4B0093760A /* MMPopupCategory.m in Sources */, - ED1E993A1B9BD5C20093760A /* ViewController.m in Sources */, ED1E995F1B9C22F50093760A /* MMPinView.m in Sources */, ED1E994C1B9BD8520093760A /* MMPopupView.m in Sources */, ED1E99521B9BDAFA0093760A /* MMPopupitem.m in Sources */, @@ -307,8 +308,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -351,8 +354,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; diff --git a/MMPopupView/MMPopupView/Base.lproj/Main.storyboard b/MMPopupView/MMPopupView/Base.lproj/Main.storyboard index 3dd8261..97eae7e 100644 --- a/MMPopupView/MMPopupView/Base.lproj/Main.storyboard +++ b/MMPopupView/MMPopupView/Base.lproj/Main.storyboard @@ -1,7 +1,12 @@ - - + + + + + - + + + @@ -13,10 +18,9 @@ - + - - + diff --git a/MMPopupView/MMPopupView/ViewController.h b/MMPopupView/MMPopupView/ViewController.h old mode 100644 new mode 100755 diff --git a/MMPopupView/MMPopupView/ViewController.m b/MMPopupView/MMPopupView/ViewController.m old mode 100644 new mode 100755 index 2e872d6..d88a137 --- a/MMPopupView/MMPopupView/ViewController.m +++ b/MMPopupView/MMPopupView/ViewController.m @@ -15,6 +15,7 @@ #import "MMDateView.h" #import "MMPopupWindow.h" + @interface ViewController () < UITableViewDelegate, @@ -109,7 +110,8 @@ - (void)action:(NSUInteger)index; NSArray *items = @[MMItemMake(@"Done", MMItemTypeNormal, block), MMItemMake(@"Save", MMItemTypeHighlight, block), - MMItemMake(@"Cancel", MMItemTypeNormal, block)]; +// MMItemMake(@"Cancel", MMItemTypeNormal, block) + ]; MMAlertView *alertView = [[MMAlertView alloc] initWithTitle:@"AlertView" detail:@"each button take one row if there are more than 2 items" @@ -177,7 +179,6 @@ - (void)action:(NSUInteger)index; break; } - default: break; }