Skip to content

Commit 20bb5c4

Browse files
committed
smoother dismiss
1 parent e0cf62e commit 20bb5c4

28 files changed

Lines changed: 26 additions & 1097 deletions

.DS_Store

6 KB
Binary file not shown.

MIBlurPopup.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'MIBlurPopup'
3-
spec.version = '0.1.0'
3+
spec.version = '0.1.1'
44
spec.license = { :type => 'MIT', :file => 'LICENSE' }
55
spec.homepage = 'https://github.com/MarioIannotta/MIBlurPopup'
66
spec.authors = { 'Mario Iannotta' => 'info@marioiannotta.com' }

Pods/MIBlurPopup/MIBlurPopup/MIBlurPopup.swift renamed to MIBlurPopup/MIBlurPopup.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ open class MIBlurPopup: NSObject {
5656

5757
guard let presentedControllerView = transitionContext.view(forKey: UITransitionContextViewKey.to) else { return }
5858

59+
presentedControllerView.alpha = 0
60+
5961
transitionContext.containerView.addSubview(presentedControllerView)
6062

6163
visualEffectBlurView.frame = transitionContext.containerView.bounds
62-
transitionContext.containerView.insertSubview(visualEffectBlurView, at: 0)
64+
visualEffectBlurView.alpha = 1
6365

64-
presentedControllerView.alpha = 0
66+
transitionContext.containerView.insertSubview(visualEffectBlurView, at: 0)
6567

6668
delegate?.popupView.alpha = 0
6769
delegate?.popupView.transform = CGAffineTransform(scaleX: delegate?.initialScaleAmmount ?? DefaultConfig.initialScaleAmmount, y: delegate?.initialScaleAmmount ?? DefaultConfig.initialScaleAmmount)
@@ -115,12 +117,14 @@ open class MIBlurPopup: NSObject {
115117

116118
presentedControllerView.alpha = 0
117119

118-
self.visualEffectBlurView.effect = nil
120+
self.visualEffectBlurView.alpha = 0
119121
self.delegate?.popupView.transform = CGAffineTransform(scaleX: self.delegate?.initialScaleAmmount ?? DefaultConfig.initialScaleAmmount, y: self.delegate?.initialScaleAmmount ?? DefaultConfig.initialScaleAmmount)
120122

121123
}, completion: {(completed: Bool) -> Void in
122124

125+
self.visualEffectBlurView.effect = nil
123126
self.visualEffectBlurView.removeFromSuperview()
127+
124128
transitionContext.completeTransition(completed)
125129

126130
}

MIBlurPopupDemo.xcodeproj/project.pbxproj

Lines changed: 12 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,17 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
61D291FEE439B48B5FA450B4 /* Pods_PopupWithBlurBackgroundPresenterDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FF659CBF1246EFA9C8A5FA8 /* Pods_PopupWithBlurBackgroundPresenterDemo.framework */; };
1110
ACC0DE6F1E2A955000B72A23 /* PopupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACC0DE6E1E2A955000B72A23 /* PopupViewController.swift */; };
1211
ACCCB4F11E2A3E39006F63B5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACCCB4E61E2A3E39006F63B5 /* AppDelegate.swift */; };
1312
ACCCB4F21E2A3E39006F63B5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ACCCB4E71E2A3E39006F63B5 /* Assets.xcassets */; };
1413
ACCCB4F31E2A3E39006F63B5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ACCCB4E81E2A3E39006F63B5 /* LaunchScreen.storyboard */; };
1514
ACCCB4F41E2A3E39006F63B5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = ACCCB4EA1E2A3E39006F63B5 /* Main.storyboard */; };
1615
ACCCB4F51E2A3E39006F63B5 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = ACCCB4EC1E2A3E39006F63B5 /* Info.plist */; };
1716
ACCCB4F81E2A3E39006F63B5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACCCB4F01E2A3E39006F63B5 /* ViewController.swift */; };
17+
ACD6CBA41E2B6DA600FBB991 /* MIBlurPopup.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACD6CBA31E2B6DA600FBB991 /* MIBlurPopup.swift */; };
1818
/* End PBXBuildFile section */
1919

2020
/* Begin PBXFileReference section */
21-
0EC1DA707AFCA715CDBB878E /* Pods-PopupWithBlurBackgroundPresenterDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopupWithBlurBackgroundPresenterDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PopupWithBlurBackgroundPresenterDemo/Pods-PopupWithBlurBackgroundPresenterDemo.debug.xcconfig"; sourceTree = "<group>"; };
22-
2759B3B3D4D666C096217773 /* Pods-PopupWithBlurBackgroundPresenterDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopupWithBlurBackgroundPresenterDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-PopupWithBlurBackgroundPresenterDemo/Pods-PopupWithBlurBackgroundPresenterDemo.release.xcconfig"; sourceTree = "<group>"; };
23-
9FF659CBF1246EFA9C8A5FA8 /* Pods_PopupWithBlurBackgroundPresenterDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PopupWithBlurBackgroundPresenterDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2421
ACC0DE6E1E2A955000B72A23 /* PopupViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopupViewController.swift; sourceTree = "<group>"; };
2522
ACCCB4BF1E2A1BD9006F63B5 /* MIBlurPopupDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MIBlurPopupDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
2623
ACCCB4E61E2A3E39006F63B5 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -29,14 +26,14 @@
2926
ACCCB4EB1E2A3E39006F63B5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
3027
ACCCB4EC1E2A3E39006F63B5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3128
ACCCB4F01E2A3E39006F63B5 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
29+
ACD6CBA31E2B6DA600FBB991 /* MIBlurPopup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MIBlurPopup.swift; sourceTree = "<group>"; };
3230
/* End PBXFileReference section */
3331

3432
/* Begin PBXFrameworksBuildPhase section */
3533
ACCCB4BC1E2A1BD8006F63B5 /* Frameworks */ = {
3634
isa = PBXFrameworksBuildPhase;
3735
buildActionMask = 2147483647;
3836
files = (
39-
61D291FEE439B48B5FA450B4 /* Pods_PopupWithBlurBackgroundPresenterDemo.framework in Frameworks */,
4037
);
4138
runOnlyForDeploymentPostprocessing = 0;
4239
};
@@ -46,26 +43,16 @@
4643
64BB32909BED86DEEAFE7864 /* Frameworks */ = {
4744
isa = PBXGroup;
4845
children = (
49-
9FF659CBF1246EFA9C8A5FA8 /* Pods_PopupWithBlurBackgroundPresenterDemo.framework */,
5046
);
5147
name = Frameworks;
5248
sourceTree = "<group>";
5349
};
54-
995991506E3CC4BE49893592 /* Pods */ = {
55-
isa = PBXGroup;
56-
children = (
57-
0EC1DA707AFCA715CDBB878E /* Pods-PopupWithBlurBackgroundPresenterDemo.debug.xcconfig */,
58-
2759B3B3D4D666C096217773 /* Pods-PopupWithBlurBackgroundPresenterDemo.release.xcconfig */,
59-
);
60-
name = Pods;
61-
sourceTree = "<group>";
62-
};
6350
ACCCB4B61E2A1BD8006F63B5 = {
6451
isa = PBXGroup;
6552
children = (
53+
ACD6CBA21E2B6DA600FBB991 /* MIBlurPopup */,
6654
ACCCB4E51E2A3E39006F63B5 /* MIBlurPopupDemo */,
6755
ACCCB4C01E2A1BD9006F63B5 /* Products */,
68-
995991506E3CC4BE49893592 /* Pods */,
6956
64BB32909BED86DEEAFE7864 /* Frameworks */,
7057
);
7158
sourceTree = "<group>";
@@ -92,19 +79,24 @@
9279
path = MIBlurPopupDemo;
9380
sourceTree = "<group>";
9481
};
82+
ACD6CBA21E2B6DA600FBB991 /* MIBlurPopup */ = {
83+
isa = PBXGroup;
84+
children = (
85+
ACD6CBA31E2B6DA600FBB991 /* MIBlurPopup.swift */,
86+
);
87+
path = MIBlurPopup;
88+
sourceTree = "<group>";
89+
};
9590
/* End PBXGroup section */
9691

9792
/* Begin PBXNativeTarget section */
9893
ACCCB4BE1E2A1BD8006F63B5 /* PopupWithBlurBackgroundPresenterDemo */ = {
9994
isa = PBXNativeTarget;
10095
buildConfigurationList = ACCCB4D11E2A1BD9006F63B5 /* Build configuration list for PBXNativeTarget "PopupWithBlurBackgroundPresenterDemo" */;
10196
buildPhases = (
102-
3716AD89C4DB3EBAA0947BED /* [CP] Check Pods Manifest.lock */,
10397
ACCCB4BB1E2A1BD8006F63B5 /* Sources */,
10498
ACCCB4BC1E2A1BD8006F63B5 /* Frameworks */,
10599
ACCCB4BD1E2A1BD8006F63B5 /* Resources */,
106-
D8C23F4C6A5085B15F7042DC /* [CP] Embed Pods Frameworks */,
107-
F908F2DBD85754E0D072C6F9 /* [CP] Copy Pods Resources */,
108100
);
109101
buildRules = (
110102
);
@@ -163,54 +155,6 @@
163155
};
164156
/* End PBXResourcesBuildPhase section */
165157

166-
/* Begin PBXShellScriptBuildPhase section */
167-
3716AD89C4DB3EBAA0947BED /* [CP] Check Pods Manifest.lock */ = {
168-
isa = PBXShellScriptBuildPhase;
169-
buildActionMask = 2147483647;
170-
files = (
171-
);
172-
inputPaths = (
173-
);
174-
name = "[CP] Check Pods Manifest.lock";
175-
outputPaths = (
176-
);
177-
runOnlyForDeploymentPostprocessing = 0;
178-
shellPath = /bin/sh;
179-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
180-
showEnvVarsInLog = 0;
181-
};
182-
D8C23F4C6A5085B15F7042DC /* [CP] Embed Pods Frameworks */ = {
183-
isa = PBXShellScriptBuildPhase;
184-
buildActionMask = 2147483647;
185-
files = (
186-
);
187-
inputPaths = (
188-
);
189-
name = "[CP] Embed Pods Frameworks";
190-
outputPaths = (
191-
);
192-
runOnlyForDeploymentPostprocessing = 0;
193-
shellPath = /bin/sh;
194-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PopupWithBlurBackgroundPresenterDemo/Pods-PopupWithBlurBackgroundPresenterDemo-frameworks.sh\"\n";
195-
showEnvVarsInLog = 0;
196-
};
197-
F908F2DBD85754E0D072C6F9 /* [CP] Copy Pods Resources */ = {
198-
isa = PBXShellScriptBuildPhase;
199-
buildActionMask = 2147483647;
200-
files = (
201-
);
202-
inputPaths = (
203-
);
204-
name = "[CP] Copy Pods Resources";
205-
outputPaths = (
206-
);
207-
runOnlyForDeploymentPostprocessing = 0;
208-
shellPath = /bin/sh;
209-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PopupWithBlurBackgroundPresenterDemo/Pods-PopupWithBlurBackgroundPresenterDemo-resources.sh\"\n";
210-
showEnvVarsInLog = 0;
211-
};
212-
/* End PBXShellScriptBuildPhase section */
213-
214158
/* Begin PBXSourcesBuildPhase section */
215159
ACCCB4BB1E2A1BD8006F63B5 /* Sources */ = {
216160
isa = PBXSourcesBuildPhase;
@@ -219,6 +163,7 @@
219163
ACCCB4F81E2A3E39006F63B5 /* ViewController.swift in Sources */,
220164
ACCCB4F11E2A3E39006F63B5 /* AppDelegate.swift in Sources */,
221165
ACC0DE6F1E2A955000B72A23 /* PopupViewController.swift in Sources */,
166+
ACD6CBA41E2B6DA600FBB991 /* MIBlurPopup.swift in Sources */,
222167
);
223168
runOnlyForDeploymentPostprocessing = 0;
224169
};
@@ -337,7 +282,6 @@
337282
};
338283
ACCCB4D21E2A1BD9006F63B5 /* Debug */ = {
339284
isa = XCBuildConfiguration;
340-
baseConfigurationReference = 0EC1DA707AFCA715CDBB878E /* Pods-PopupWithBlurBackgroundPresenterDemo.debug.xcconfig */;
341285
buildSettings = {
342286
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
343287
INFOPLIST_FILE = MIBlurPopupDemo/Info.plist;
@@ -350,7 +294,6 @@
350294
};
351295
ACCCB4D31E2A1BD9006F63B5 /* Release */ = {
352296
isa = XCBuildConfiguration;
353-
baseConfigurationReference = 2759B3B3D4D666C096217773 /* Pods-PopupWithBlurBackgroundPresenterDemo.release.xcconfig */;
354297
buildSettings = {
355298
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
356299
INFOPLIST_FILE = MIBlurPopupDemo/Info.plist;

MIBlurPopupDemo.xcworkspace/contents.xcworkspacedata

Lines changed: 0 additions & 10 deletions
This file was deleted.

MIBlurPopupDemo/Base.lproj/Main.storyboard

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
<rect key="frame" x="0.0" y="0.0" width="375" height="70"/>
128128
<autoresizingMask key="autoresizingMask"/>
129129
<subviews>
130-
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="0.5" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="mq3-Dz-BiS">
130+
<textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="0.5" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="mq3-Dz-BiS">
131131
<rect key="frame" x="50" y="20" width="90" height="30"/>
132132
<constraints>
133133
<constraint firstAttribute="width" constant="90" id="WmG-GF-y8W"/>
@@ -180,7 +180,7 @@
180180
<rect key="frame" x="0.0" y="0.0" width="375" height="70"/>
181181
<autoresizingMask key="autoresizingMask"/>
182182
<subviews>
183-
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="0.7" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="tN6-ba-5zC">
183+
<textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="0.7" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="tN6-ba-5zC">
184184
<rect key="frame" x="50" y="20" width="90" height="30"/>
185185
<constraints>
186186
<constraint firstAttribute="width" constant="90" id="Qog-LK-259"/>
@@ -219,7 +219,7 @@
219219
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
220220
</state>
221221
<connections>
222-
<segue destination="HI1-R6-fZ5" kind="custom" customClass="MIBlurPopupSegue" customModule="MIBlurPopup" id="LMr-hZ-ntr"/>
222+
<segue destination="HI1-R6-fZ5" kind="custom" customClass="MIBlurPopupSegue" customModule="MIBlurPopupDemo" customModuleProvider="target" id="LMr-hZ-ntr"/>
223223
</connections>
224224
</button>
225225
</subviews>

MIBlurPopupDemo/PopupViewController.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
import UIKit
10-
import MIBlurPopup
10+
1111

1212
class PopupViewController: UIViewController {
1313

@@ -30,9 +30,8 @@ class PopupViewController: UIViewController {
3030
var customInitialScaleAmmount: CGFloat!
3131
var customAnimationDuration: TimeInterval!
3232

33-
override func viewDidLoad() {
34-
super.viewDidLoad()
35-
33+
override var preferredStatusBarStyle: UIStatusBarStyle {
34+
return customBlurEffectStyle == .dark ? .lightContent : .default
3635
}
3736

3837
// MARK: - IBActions

Podfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

Pods/MIBlurPopup/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

Pods/MIBlurPopup/README.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)