Skip to content

Commit

Permalink
Merge pull request #113 from xmartlabs/version/4.1.1
Browse files Browse the repository at this point in the history
version 4.1.1
  • Loading branch information
Martin Barreto committed Dec 20, 2018
2 parents e4599a5 + bc0d957 commit 4de9c93
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: objective-c
osx_image: xcode10
osx_image: xcode10.1
env:
- DESTINATION="OS=12.0,name=iPhone 8" SCHEME="XLActionController" SDK=iphonesimulator
- DESTINATION="OS=12.1,name=iPhone 8" SCHEME="XLActionController" SDK=iphonesimulator
before_install:
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
script:
Expand Down
8 changes: 5 additions & 3 deletions Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
28B3B8551BFA7EEC007337A2 = {
CreatedOnToolsVersion = 7.1;
LastSwiftMigration = 1000;
ProvisioningStyle = Manual;
ProvisioningStyle = Automatic;
};
28B3B8691BFA7EEC007337A2 = {
CreatedOnToolsVersion = 7.1;
Expand Down Expand Up @@ -529,7 +529,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -546,7 +547,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
2 changes: 1 addition & 1 deletion Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.2.0</string>
<string>4.1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ After the dismissal animation completes, `dismissView` calls `onDidDismissView`

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

If you use **XLActionController** in your app we would love to hear about it!
Drop us a line on [twitter](https://twitter.com/xmartlabs).
Expand Down
34 changes: 14 additions & 20 deletions Source/ActionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,7 @@ open class ActionController<ActionViewType: UICollectionViewCell, ActionDataType
return indexPath
}

open func dismiss() {
dismiss(nil)
}

open func dismiss(_ completion: (() -> ())?) {
open func dismiss(_ completion: (() -> ())? = nil) {
disableActions = true
presentingViewController?.dismiss(animated: true) { [weak self] in
self?.disableActions = false
Expand Down Expand Up @@ -252,19 +248,19 @@ open class ActionController<ActionViewType: UICollectionViewCell, ActionDataType
if let headerSpec = headerSpec, let _ = headerData {
switch headerSpec {
case .cellClass:
collectionView.register(HeaderViewType.self, forSupplementaryViewOfKind:UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.Header.rawValue)
collectionView.register(HeaderViewType.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.Header.rawValue)
case .nibFile(let nibName, let bundle, _):
collectionView.register(UINib(nibName: nibName, bundle: bundle), forSupplementaryViewOfKind:UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.Header.rawValue)
collectionView.register(UINib(nibName: nibName, bundle: bundle), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.Header.rawValue)
}
}

// register section header
if let headerSpec = sectionHeaderSpec {
switch headerSpec {
case .cellClass:
collectionView.register(SectionHeaderViewType.self, forSupplementaryViewOfKind:UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.SectionHeader.rawValue)
collectionView.register(SectionHeaderViewType.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.SectionHeader.rawValue)
case .nibFile(let nibName, let bundle, _):
collectionView.register(UINib(nibName: nibName, bundle: bundle), forSupplementaryViewOfKind:UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.SectionHeader.rawValue)
collectionView.register(UINib(nibName: nibName, bundle: bundle), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: ReusableViewIds.SectionHeader.rawValue)
}
}

Expand All @@ -282,8 +278,6 @@ open class ActionController<ActionViewType: UICollectionViewCell, ActionDataType
}
}

setUpContentInsetForHeight(view.frame.height)

// set up collection view initial position taking into account top content inset
collectionView.frame = view.bounds
collectionView.frame.origin.y += contentHeight + (settings.cancelView.showCancel ? settings.cancelView.height : 0)
Expand All @@ -295,6 +289,11 @@ open class ActionController<ActionViewType: UICollectionViewCell, ActionDataType
view.addSubview(cancelView!)
}
}

open override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
setUpContentInsetForHeight(view.frame.height)
}

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

fileprivate func setUpContentInsetForHeight(_ height: CGFloat) {
if initialContentInset == nil {
initialContentInset = collectionView.contentInset
}

initialContentInset = initialContentInset ?? collectionView.contentInset
var leftInset = initialContentInset.left
var rightInset = initialContentInset.right
var bottomInset = settings.cancelView.showCancel ? settings.cancelView.height : initialContentInset.bottom
var bottomInset = settings.cancelView.showCancel ? initialContentInset.bottom + settings.cancelView.height : initialContentInset.bottom
var topInset = height - contentHeight - safeAreaInsets.bottom

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

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

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

// MARK: - Overrides

open override func dismiss() {
dismiss(nil)
}

open override func dismiss(_ completion: (() -> ())?) {
animator.addBehavior(gravityBehavior)

Expand Down
2 changes: 1 addition & 1 deletion Source/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.2.0</string>
<string>4.1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
3 changes: 2 additions & 1 deletion XLActionController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'XLActionController'
spec.version = '4.1.0'
spec.version = '4.1.1'
spec.license = 'MIT'
spec.summary = 'Fully customizable and extensible action sheet controller written in Swift'
spec.homepage = 'https://github.com/xmartlabs/XLActionController'
Expand All @@ -10,6 +10,7 @@ Pod::Spec.new do |spec|
spec.ios.deployment_target = '9.0'
spec.ios.frameworks = 'UIKit', 'Foundation', 'CoreGraphics'
spec.requires_arc = true
spec.swift_version = '4.2'

# Core subspec
spec.subspec 'Core' do |core|
Expand Down
6 changes: 3 additions & 3 deletions XLActionController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
};
28E191701BFA618F00066B1C = {
CreatedOnToolsVersion = 7.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 1010;
};
};
};
Expand Down Expand Up @@ -412,7 +412,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLActionControllerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -424,7 +424,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLActionControllerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down

0 comments on commit 4de9c93

Please sign in to comment.