Skip to content

Commit 4de9c93

Browse files
author
Martin Barreto
authored
Merge pull request #113 from xmartlabs/version/4.1.1
version 4.1.1
2 parents e4599a5 + bc0d957 commit 4de9c93

File tree

8 files changed

+29
-33
lines changed

8 files changed

+29
-33
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: objective-c
2-
osx_image: xcode10
2+
osx_image: xcode10.1
33
env:
4-
- DESTINATION="OS=12.0,name=iPhone 8" SCHEME="XLActionController" SDK=iphonesimulator
4+
- DESTINATION="OS=12.1,name=iPhone 8" SCHEME="XLActionController" SDK=iphonesimulator
55
before_install:
66
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
77
script:

Example.xcodeproj/project.pbxproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
28B3B8551BFA7EEC007337A2 = {
265265
CreatedOnToolsVersion = 7.1;
266266
LastSwiftMigration = 1000;
267-
ProvisioningStyle = Manual;
267+
ProvisioningStyle = Automatic;
268268
};
269269
28B3B8691BFA7EEC007337A2 = {
270270
CreatedOnToolsVersion = 7.1;
@@ -529,7 +529,8 @@
529529
isa = XCBuildConfiguration;
530530
buildSettings = {
531531
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
532-
CODE_SIGN_STYLE = Manual;
532+
CODE_SIGN_IDENTITY = "iPhone Developer";
533+
CODE_SIGN_STYLE = Automatic;
533534
DEVELOPMENT_TEAM = "";
534535
INFOPLIST_FILE = Example/Info.plist;
535536
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -546,7 +547,8 @@
546547
isa = XCBuildConfiguration;
547548
buildSettings = {
548549
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
549-
CODE_SIGN_STYLE = Manual;
550+
CODE_SIGN_IDENTITY = "iPhone Developer";
551+
CODE_SIGN_STYLE = Automatic;
550552
DEVELOPMENT_TEAM = "";
551553
INFOPLIST_FILE = Example/Info.plist;
552554
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

Example/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>4.2.0</string>
18+
<string>4.1.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,7 @@ After the dismissal animation completes, `dismissView` calls `onDidDismissView`
397397

398398
* If you **want to contribute** please feel free to **submit pull requests**.
399399
* If you **have a feature request** please **open an issue**.
400-
* If you **found a bug** or **need help** please **check older issues or threads on
401-
[StackOverflow](http://stackoverflow.com/questions/tagged/xlactioncontroller) before submitting an issue**.
400+
* If you **found a bug** or **need help** please **check older issues before submitting an issue**.
402401

403402
If you use **XLActionController** in your app we would love to hear about it!
404403
Drop us a line on [twitter](https://twitter.com/xmartlabs).

Source/ActionController.swift

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,7 @@ open class ActionController<ActionViewType: UICollectionViewCell, ActionDataType
214214
return indexPath
215215
}
216216

217-
open func dismiss() {
218-
dismiss(nil)
219-
}
220-
221-
open func dismiss(_ completion: (() -> ())?) {
217+
open func dismiss(_ completion: (() -> ())? = nil) {
222218
disableActions = true
223219
presentingViewController?.dismiss(animated: true) { [weak self] in
224220
self?.disableActions = false
@@ -252,19 +248,19 @@ open class ActionController<ActionViewType: UICollectionViewCell, ActionDataType
252248
if let headerSpec = headerSpec, let _ = headerData {
253249
switch headerSpec {
254250
case .cellClass:
255-
collectionView.register(HeaderViewType.self, forSupplementaryViewOfKind:UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.Header.rawValue)
251+
collectionView.register(HeaderViewType.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.Header.rawValue)
256252
case .nibFile(let nibName, let bundle, _):
257-
collectionView.register(UINib(nibName: nibName, bundle: bundle), forSupplementaryViewOfKind:UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.Header.rawValue)
253+
collectionView.register(UINib(nibName: nibName, bundle: bundle), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.Header.rawValue)
258254
}
259255
}
260256

261257
// register section header
262258
if let headerSpec = sectionHeaderSpec {
263259
switch headerSpec {
264260
case .cellClass:
265-
collectionView.register(SectionHeaderViewType.self, forSupplementaryViewOfKind:UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.SectionHeader.rawValue)
261+
collectionView.register(SectionHeaderViewType.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.SectionHeader.rawValue)
266262
case .nibFile(let nibName, let bundle, _):
267-
collectionView.register(UINib(nibName: nibName, bundle: bundle), forSupplementaryViewOfKind:UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.SectionHeader.rawValue)
263+
collectionView.register(UINib(nibName: nibName, bundle: bundle), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.SectionHeader.rawValue)
268264
}
269265
}
270266

@@ -282,8 +278,6 @@ open class ActionController<ActionViewType: UICollectionViewCell, ActionDataType
282278
}
283279
}
284280

285-
setUpContentInsetForHeight(view.frame.height)
286-
287281
// set up collection view initial position taking into account top content inset
288282
collectionView.frame = view.bounds
289283
collectionView.frame.origin.y += contentHeight + (settings.cancelView.showCancel ? settings.cancelView.height : 0)
@@ -295,6 +289,11 @@ open class ActionController<ActionViewType: UICollectionViewCell, ActionDataType
295289
view.addSubview(cancelView!)
296290
}
297291
}
292+
293+
open override func viewWillLayoutSubviews() {
294+
super.viewWillLayoutSubviews()
295+
setUpContentInsetForHeight(view.frame.height)
296+
}
298297

299298
open override func viewWillAppear(_ animated: Bool) {
300299
super.viewWillAppear(animated)
@@ -661,12 +660,11 @@ open class ActionController<ActionViewType: UICollectionViewCell, ActionDataType
661660
}
662661

663662
fileprivate func setUpContentInsetForHeight(_ height: CGFloat) {
664-
if initialContentInset == nil {
665-
initialContentInset = collectionView.contentInset
666-
}
663+
664+
initialContentInset = initialContentInset ?? collectionView.contentInset
667665
var leftInset = initialContentInset.left
668666
var rightInset = initialContentInset.right
669-
var bottomInset = settings.cancelView.showCancel ? settings.cancelView.height : initialContentInset.bottom
667+
var bottomInset = settings.cancelView.showCancel ? initialContentInset.bottom + settings.cancelView.height : initialContentInset.bottom
670668
var topInset = height - contentHeight - safeAreaInsets.bottom
671669

672670
if settings.cancelView.showCancel {
@@ -682,7 +680,7 @@ open class ActionController<ActionViewType: UICollectionViewCell, ActionDataType
682680

683681
collectionView.contentInset = UIEdgeInsets(top: topInset, left: leftInset, bottom: bottomInset, right: rightInset)
684682
if !settings.behavior.useDynamics {
685-
collectionView.contentOffset.y = -height + contentHeight + safeAreaInsets.bottom
683+
collectionView.contentOffset.y = -height + contentHeight + bottomInset
686684
}
687685
}
688686

@@ -778,10 +776,6 @@ open class DynamicsActionController<ActionViewType: UICollectionViewCell, Action
778776

779777
// MARK: - Overrides
780778

781-
open override func dismiss() {
782-
dismiss(nil)
783-
}
784-
785779
open override func dismiss(_ completion: (() -> ())?) {
786780
animator.addBehavior(gravityBehavior)
787781

Source/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>4.2.0</string>
18+
<string>4.1.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

XLActionController.podspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'XLActionController'
3-
spec.version = '4.1.0'
3+
spec.version = '4.1.1'
44
spec.license = 'MIT'
55
spec.summary = 'Fully customizable and extensible action sheet controller written in Swift'
66
spec.homepage = 'https://github.com/xmartlabs/XLActionController'
@@ -10,6 +10,7 @@ Pod::Spec.new do |spec|
1010
spec.ios.deployment_target = '9.0'
1111
spec.ios.frameworks = 'UIKit', 'Foundation', 'CoreGraphics'
1212
spec.requires_arc = true
13+
spec.swift_version = '4.2'
1314

1415
# Core subspec
1516
spec.subspec 'Core' do |core|

XLActionController.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
};
179179
28E191701BFA618F00066B1C = {
180180
CreatedOnToolsVersion = 7.1;
181-
LastSwiftMigration = 0800;
181+
LastSwiftMigration = 1010;
182182
};
183183
};
184184
};
@@ -412,7 +412,7 @@
412412
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLActionControllerTests;
413413
PRODUCT_NAME = "$(TARGET_NAME)";
414414
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
415-
SWIFT_VERSION = 4.0;
415+
SWIFT_VERSION = 4.2;
416416
};
417417
name = Debug;
418418
};
@@ -424,7 +424,7 @@
424424
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
425425
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLActionControllerTests;
426426
PRODUCT_NAME = "$(TARGET_NAME)";
427-
SWIFT_VERSION = 4.0;
427+
SWIFT_VERSION = 4.2;
428428
};
429429
name = Release;
430430
};

0 commit comments

Comments
 (0)