Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.
Open

Fix #72

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Classes/MMPopupCategory.m
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ - (void)mm_hideDimBackground
if ( finished )
{
self.mm_dimBackgroundAnimating = NO;
self.mm_dimBackgroundBlurEnabled = NO;

if ( self == [MMPopupWindow sharedWindow].attachView )
{
Expand Down
15 changes: 7 additions & 8 deletions Classes/MMPopupView.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ - (MMPopupBlock)alertShowAnimation
MMWeakify(self);
MMPopupBlock block = ^(MMPopupView *popupView){
MMStrongify(self);

if ( !self.superview )
{
[self.attachedView.mm_dimBackgroundView addSubview:self];
Expand Down Expand Up @@ -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
Expand All @@ -256,7 +256,7 @@ - (MMPopupBlock)sheetShowAnimation
[self mas_updateConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.attachedView.mas_bottom).offset(0);
}];

[self.superview layoutIfNeeded];

}
Expand All @@ -266,7 +266,6 @@ - (MMPopupBlock)sheetShowAnimation
{
self.showCompletionBlock(self, finished);
}

}];
};

Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Classes/MMPopupWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ @interface MMPopupWindow()

@implementation MMPopupWindow

- (void)dealloc {
printf("dealloc");
}

- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
Expand Down
3 changes: 3 additions & 0 deletions MMPopupView/MMDateView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
19 changes: 12 additions & 7 deletions MMPopupView/MMPopupView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand All @@ -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 */
Expand All @@ -31,8 +31,6 @@
ED1E99331B9BD5C20093760A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
ED1E99351B9BD5C20093760A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
ED1E99361B9BD5C20093760A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
ED1E99381B9BD5C20093760A /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
ED1E99391B9BD5C20093760A /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
ED1E993C1B9BD5C20093760A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
ED1E993E1B9BD5C20093760A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
ED1E99411B9BD5C20093760A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand All @@ -54,6 +52,8 @@
ED1E995E1B9C22F50093760A /* MMPinView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MMPinView.m; path = ../MMPinView.m; sourceTree = "<group>"; };
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 = "<group>"; };
FEE3EB201BDF7155009D7AEA /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
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 = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -181,11 +181,12 @@
ED1E99271B9BD5C20093760A /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0700;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = LJC;
TargetAttributes = {
ED1E992E1B9BD5C20093760A = {
CreatedOnToolsVersion = 7.0;
DevelopmentTeam = J7XJK67HUB;
};
};
};
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
16 changes: 10 additions & 6 deletions MMPopupView/MMPopupView/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8187.4" systemVersion="15A263e" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8151.3"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -13,10 +18,9 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
Expand Down
Empty file modified MMPopupView/MMPopupView/ViewController.h
100644 → 100755
Empty file.
5 changes: 3 additions & 2 deletions MMPopupView/MMPopupView/ViewController.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#import "MMDateView.h"
#import "MMPopupWindow.h"


@interface ViewController ()
<
UITableViewDelegate,
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -177,7 +179,6 @@ - (void)action:(NSUInteger)index;

break;
}

default:
break;
}
Expand Down