Skip to content

Commit f68fd6c

Browse files
authored
Merge pull request #80 from rayhannabi/release/0.6.6
Release/0.6.6
2 parents 6e8d870 + 3bf4217 commit f68fd6c

File tree

13 files changed

+131
-17
lines changed

13 files changed

+131
-17
lines changed

RNAlertController.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Pod::Spec.new do |spec|
66

77
spec.name = "RNAlertController"
8-
spec.version = "0.6.6.beta.2"
8+
spec.version = "0.6.6"
99
spec.summary = "Custom Alert Framework for iOS"
1010

1111
spec.description = <<-DESC

RNAlertController.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@
533533
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
534534
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
535535
CODE_SIGN_STYLE = Automatic;
536-
CURRENT_PROJECT_VERSION = 676;
536+
CURRENT_PROJECT_VERSION = 680;
537537
DEVELOPMENT_TEAM = PCH85ZHVFN;
538538
INFOPLIST_FILE = "$(SRCROOT)/RNAlertControllerExample/Info.plist";
539539
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
@@ -555,7 +555,7 @@
555555
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
556556
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
557557
CODE_SIGN_STYLE = Automatic;
558-
CURRENT_PROJECT_VERSION = 676;
558+
CURRENT_PROJECT_VERSION = 680;
559559
DEVELOPMENT_TEAM = PCH85ZHVFN;
560560
INFOPLIST_FILE = "$(SRCROOT)/RNAlertControllerExample/Info.plist";
561561
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
@@ -702,7 +702,7 @@
702702
CLANG_ENABLE_MODULES = YES;
703703
CODE_SIGN_IDENTITY = "";
704704
CODE_SIGN_STYLE = Automatic;
705-
CURRENT_PROJECT_VERSION = 1002;
705+
CURRENT_PROJECT_VERSION = 1004;
706706
DEFINES_MODULE = YES;
707707
DEVELOPMENT_TEAM = PCH85ZHVFN;
708708
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -734,7 +734,7 @@
734734
CLANG_ENABLE_MODULES = YES;
735735
CODE_SIGN_IDENTITY = "";
736736
CODE_SIGN_STYLE = Automatic;
737-
CURRENT_PROJECT_VERSION = 1002;
737+
CURRENT_PROJECT_VERSION = 1004;
738738
DEFINES_MODULE = YES;
739739
DEVELOPMENT_TEAM = PCH85ZHVFN;
740740
DYLIB_COMPATIBILITY_VERSION = 1;

RNAlertControllerExample/Controllers/OtherViewController.swift

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,29 @@ import RNAlertController
1111

1212
class OtherViewController: UIViewController {
1313

14+
private var selectedDate: Date?
15+
1416
@IBAction private func didTapAlert(_ sender: Any) {
1517
let message = """
1618
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
1719
"""
1820
RNAlertController(title: "Kashmir Valley", message: message)
19-
.setDatePicker(mode: .date, date: nil, selectionAction: { date in
20-
print(date)
21-
})
21+
.setBannerImage(UIImage(named: "crop")!)
2222
.addOkButton()
2323
.present()
2424
}
25-
25+
26+
@IBAction func didTapChooseDate(_ sender: UIButton) {
27+
RNAlertController(title: "Pick a date",
28+
message: "This date will be selected when you tap Done")
29+
.setDatePicker(mode: .date, date: selectedDate) { date in
30+
self.selectedDate = date
31+
let formatter = DateFormatter()
32+
formatter.dateFormat = "dd MMMM yyyy"
33+
sender.setTitle(formatter.string(from: date), for: .normal)
34+
}
35+
.addButton(title: "Done", type: .cancel, action: nil)
36+
.present()
37+
}
38+
2639
}

RNAlertControllerExample/Storyboards/Base.lproj/Main.storyboard

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,40 @@
9090
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="crop" translatesAutoresizingMaskIntoConstraints="NO" id="lV0-xA-B1d">
9191
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
9292
</imageView>
93+
<visualEffectView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NVv-IZ-AWF">
94+
<rect key="frame" x="42" y="626" width="330" height="74"/>
95+
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="OJL-VE-ccI">
96+
<rect key="frame" x="0.0" y="0.0" width="330" height="74"/>
97+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
98+
<subviews>
99+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0U9-fZ-lsl">
100+
<rect key="frame" x="0.0" y="0.0" width="330" height="74"/>
101+
<fontDescription key="fontDescription" type="boldSystem" pointSize="26"/>
102+
<state key="normal" title="Choose Date">
103+
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
104+
</state>
105+
<connections>
106+
<action selector="didTapChooseDate:" destination="05k-IV-M98" eventType="touchUpInside" id="Eod-6X-W8L"/>
107+
</connections>
108+
</button>
109+
</subviews>
110+
<constraints>
111+
<constraint firstAttribute="bottom" secondItem="0U9-fZ-lsl" secondAttribute="bottom" id="UGu-Ya-1dQ"/>
112+
<constraint firstAttribute="trailing" secondItem="0U9-fZ-lsl" secondAttribute="trailing" id="kgF-0g-fJZ"/>
113+
<constraint firstItem="0U9-fZ-lsl" firstAttribute="top" secondItem="OJL-VE-ccI" secondAttribute="top" id="vU9-6C-lhh"/>
114+
<constraint firstItem="0U9-fZ-lsl" firstAttribute="leading" secondItem="OJL-VE-ccI" secondAttribute="leading" id="wvp-7L-C7D"/>
115+
</constraints>
116+
</view>
117+
<constraints>
118+
<constraint firstAttribute="height" constant="74" id="YLU-eq-3a3"/>
119+
</constraints>
120+
<blurEffect style="dark"/>
121+
<userDefinedRuntimeAttributes>
122+
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
123+
<real key="value" value="16"/>
124+
</userDefinedRuntimeAttribute>
125+
</userDefinedRuntimeAttributes>
126+
</visualEffectView>
93127
<visualEffectView opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ehh-OM-mcU">
94128
<rect key="frame" x="41.5" y="724" width="331" height="74"/>
95129
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="vpr-fY-yd2">
@@ -128,13 +162,16 @@
128162
</subviews>
129163
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
130164
<constraints>
165+
<constraint firstItem="3sU-Nl-Vz5" firstAttribute="trailing" secondItem="NVv-IZ-AWF" secondAttribute="trailing" constant="42" id="3tn-rl-CnT"/>
131166
<constraint firstAttribute="bottom" secondItem="lV0-xA-B1d" secondAttribute="bottom" id="6hV-Qi-n2C"/>
132167
<constraint firstItem="3sU-Nl-Vz5" firstAttribute="bottom" secondItem="Ehh-OM-mcU" secondAttribute="bottom" constant="64" id="DIe-o0-xXa"/>
133168
<constraint firstItem="Ehh-OM-mcU" firstAttribute="centerX" secondItem="Dr4-A4-ob6" secondAttribute="centerX" id="M9r-g2-6tW"/>
134169
<constraint firstItem="lV0-xA-B1d" firstAttribute="leading" secondItem="Dr4-A4-ob6" secondAttribute="leading" id="SRA-EK-BSI"/>
135170
<constraint firstItem="Ehh-OM-mcU" firstAttribute="width" secondItem="Dr4-A4-ob6" secondAttribute="width" multiplier="0.8" id="a7Q-p4-tEG"/>
171+
<constraint firstItem="Ehh-OM-mcU" firstAttribute="top" secondItem="NVv-IZ-AWF" secondAttribute="bottom" constant="24" id="bQj-OT-Jb7"/>
136172
<constraint firstItem="lV0-xA-B1d" firstAttribute="top" secondItem="Dr4-A4-ob6" secondAttribute="top" id="cKD-E6-fvB"/>
137173
<constraint firstAttribute="trailing" secondItem="lV0-xA-B1d" secondAttribute="trailing" id="eqX-dg-E6j"/>
174+
<constraint firstItem="NVv-IZ-AWF" firstAttribute="leading" secondItem="3sU-Nl-Vz5" secondAttribute="leading" constant="42" id="meE-DV-qQc"/>
138175
</constraints>
139176
<viewLayoutGuide key="safeArea" id="3sU-Nl-Vz5"/>
140177
</view>

Source/Extensions/UIFont+Extra.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import UIKit
1111
extension UIFont {
1212

1313
class var alertTitleFont: UIFont {
14-
return self.systemFont(ofSize: 18, weight: .bold)
14+
return self.systemFont(ofSize: 18, weight: .semibold)
1515
}
1616

1717
class var alertMessageFont: UIFont {

Source/RNAlertController.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,18 @@ import UIKit
6161
animateAlert()
6262
}
6363

64+
public override func viewWillDisappear(_ animated: Bool) {
65+
super.viewWillDisappear(animated)
66+
DispatchQueue.main.async {
67+
if (self.alertDatePicker != nil) {
68+
self.alertDatePicker!.action?(self.alertDatePicker!.date)
69+
}
70+
}
71+
}
72+
6473
public override func viewDidDisappear(_ animated: Bool) {
6574
super.viewDidDisappear(animated)
66-
if (alertDatePicker != nil) {
67-
alertDatePicker!.action?(alertDatePicker!.date)
68-
}
6975
originalWindow?.makeKeyAndVisible()
70-
alertWindow?.isHidden = true
7176
alertWindow = nil
7277
}
7378

docs/Classes/RNAlertController.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,32 @@ <h4>Declaration</h4>
190190
</section>
191191
</div>
192192
</li>
193+
<li class="item">
194+
<div>
195+
<code>
196+
<a name="/c:@M@RNAlertController@objc(cs)RNAlertController(im)viewWillDisappear:"></a>
197+
<a name="//apple_ref/swift/Method/viewWillDisappear(_:)" class="dashAnchor"></a>
198+
<a class="token" href="#/c:@M@RNAlertController@objc(cs)RNAlertController(im)viewWillDisappear:">viewWillDisappear(_:)</a>
199+
</code>
200+
</div>
201+
<div class="height-container">
202+
<div class="pointer-container"></div>
203+
<section class="section">
204+
<div class="pointer"></div>
205+
<div class="abstract">
206+
207+
</div>
208+
<div class="declaration">
209+
<h4>Declaration</h4>
210+
<div class="language">
211+
<p class="aside-title">Swift</p>
212+
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">viewWillDisappear</span><span class="p">(</span><span class="n">_</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span></code></pre>
213+
214+
</div>
215+
</div>
216+
</section>
217+
</div>
218+
</li>
193219
<li class="item">
194220
<div>
195221
<code>

docs/docsets/RNAlertController.docset/Contents/Resources/Documents/Classes/RNAlertController.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,32 @@ <h4>Declaration</h4>
190190
</section>
191191
</div>
192192
</li>
193+
<li class="item">
194+
<div>
195+
<code>
196+
<a name="/c:@M@RNAlertController@objc(cs)RNAlertController(im)viewWillDisappear:"></a>
197+
<a name="//apple_ref/swift/Method/viewWillDisappear(_:)" class="dashAnchor"></a>
198+
<a class="token" href="#/c:@M@RNAlertController@objc(cs)RNAlertController(im)viewWillDisappear:">viewWillDisappear(_:)</a>
199+
</code>
200+
</div>
201+
<div class="height-container">
202+
<div class="pointer-container"></div>
203+
<section class="section">
204+
<div class="pointer"></div>
205+
<div class="abstract">
206+
207+
</div>
208+
<div class="declaration">
209+
<h4>Declaration</h4>
210+
<div class="language">
211+
<p class="aside-title">Swift</p>
212+
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">viewWillDisappear</span><span class="p">(</span><span class="n">_</span> <span class="nv">animated</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span></code></pre>
213+
214+
</div>
215+
</div>
216+
</section>
217+
</div>
218+
</li>
193219
<li class="item">
194220
<div>
195221
<code>

0 commit comments

Comments
 (0)