Skip to content

Commit

Permalink
Merge branch 'release/3.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Adonis Peralta committed Oct 11, 2018
2 parents f383b7a + 004fc4a commit 6276029
Show file tree
Hide file tree
Showing 23 changed files with 986 additions and 46 deletions.
3 changes: 2 additions & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
--patternlet inline
--ranges spaced
--self remove
--semicolons inline
--closingparen balanced
--stripunusedargs always
--semicolons inline
--trimwhitespace always
--wraparguments beforefirst
--wrapcollections beforefirst
4 changes: 2 additions & 2 deletions Carthage/Build/.HexColors.version

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

197 changes: 197 additions & 0 deletions Carthage/Build/iOS/1AAE84B3-1E7B-34FC-8BCD-301796E4A1A8.bcsymbolmap

Large diffs are not rendered by default.

273 changes: 273 additions & 0 deletions Carthage/Build/iOS/2F4EB4D0-E575-3C10-9BAB-987BB96096D9.bcsymbolmap

Large diffs are not rendered by default.

197 changes: 197 additions & 0 deletions Carthage/Build/iOS/5DDBFC24-2AFC-3A58-AB88-1CE932E41DF2.bcsymbolmap

Large diffs are not rendered by default.

273 changes: 273 additions & 0 deletions Carthage/Build/iOS/FEB40E7A-A122-351A-A6C2-13B1C96E0AA3.bcsymbolmap

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Carthage/Build/iOS/HexColors.framework/Headers/HexColors-Swift.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Carthage/Build/iOS/HexColors.framework/HexColors
Binary file not shown.
Binary file modified Carthage/Build/iOS/HexColors.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion RMessage.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |s|
s.name = "RMessage"
s.version = "3.0.0"
s.version = "3.0.1"
s.license = 'MIT'
s.summary = "Easy to use and customizable messages/notifications for iOS"
s.homepage = "https://github.com/donileo/RMessage"
Expand Down
5 changes: 4 additions & 1 deletion Sources/RMPresenter/RMPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ import UIKit
init(
message: RMessage, targetPosition: RMessagePosition, animator: RMAnimator,
animationOptions animationOpts: RMAnimationOptions,
tapCompletion _: (() -> Void)? = nil, presentCompletion _: (() -> Void)? = nil, dismissCompletion _: (() -> Void)? = nil
tapCompletion: (() -> Void)? = nil, presentCompletion: (() -> Void)? = nil, dismissCompletion: (() -> Void)? = nil
) {
self.message = message
self.targetPosition = targetPosition
self.animator = animator
self.animationOpts = animationOpts
self.tapCompletion = tapCompletion
self.presentCompletion = presentCompletion
self.dismissCompletion = dismissCompletion
super.init()
setupAnimator()
setupGestureRecognizers()
Expand Down
32 changes: 17 additions & 15 deletions Sources/RMessage/Animators/SlideAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,23 @@ class SlideAnimator: NSObject, RMAnimator {
// For now lets be safe and not call this code inside the animation block. Though there may be some slight timing
// issue in notifying exactly when the animator is animating it should be fine.
self.delegate?.animatorIsAnimatingDismissal?(self)
UIView.animate(withDuration: self.dismissalDuration, animations: {
self.viewTopConstraint.isActive = false
self.viewTopConstraint = self.viewTopStartConstraint
self.viewTopConstraint.isActive = true
self.delegate?.animationBlockForDismissal?(self)
self.view.alpha = self.animationStartAlpha
self.view.superview!.layoutIfNeeded()
}, completion: { finished in
self.isDismissing = false
self.hasPresented = false
self.hasDismissed = true
self.view.removeFromSuperview()
self.delegate?.animatorDidDismiss?(self)
if finished { completion?() }
})
UIView.animate(
withDuration: self.dismissalDuration, animations: {
self.viewTopConstraint.isActive = false
self.viewTopConstraint = self.viewTopStartConstraint
self.viewTopConstraint.isActive = true
self.delegate?.animationBlockForDismissal?(self)
self.view.alpha = self.animationStartAlpha
self.view.superview!.layoutIfNeeded()
}, completion: { finished in
self.isDismissing = false
self.hasPresented = false
self.hasDismissed = true
self.view.removeFromSuperview()
self.delegate?.animatorDidDismiss?(self)
if finished { completion?() }
}
)
}
}

Expand Down
10 changes: 0 additions & 10 deletions Sources/RMessage/Extensions/RMessage+Components.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ extension RMessage {
return iconImageView
}

func iconImageView(withImage image: UIImage, imageTintColor: UIColor?, superview: UIView, contentView _: UIView) -> UIView {
let iconImageView = UIImageView(image: image)

iconImageView.clipsToBounds = true
iconImageView.tintColor = imageTintColor
iconImageView.contentMode = .scaleAspectFit
setup(leftView: iconImageView, inSuperview: superview)
return iconImageView
}

func setup(leftView view: UIView, inSuperview superview: UIView) {
view.translatesAutoresizingMaskIntoConstraints = false

Expand Down
20 changes: 12 additions & 8 deletions Sources/RMessage/RMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,23 @@ public class RMessage: UIView, RMessageAnimatorDelegate {
trailingConstraint.isActive = false
}

NSLayoutConstraint.deactivate([
titleLabelLeadingConstraint, titleLabelTrailingConstraint,
bodyLabelLeadingConstraint, bodyLabelTrailingConstraint,
])
NSLayoutConstraint.deactivate(
[
titleLabelLeadingConstraint, titleLabelTrailingConstraint,
bodyLabelLeadingConstraint, bodyLabelTrailingConstraint,
]
)

titleLabelLeadingConstraint = titleLabel.leadingAnchor.constraint(greaterThanOrEqualTo: contentView.leadingAnchor)
titleLabelTrailingConstraint = titleLabel.trailingAnchor.constraint(lessThanOrEqualTo: contentView.trailingAnchor)
bodyLabelLeadingConstraint = bodyLabel.leadingAnchor.constraint(greaterThanOrEqualTo: contentView.leadingAnchor)
bodyLabelTrailingConstraint = bodyLabel.trailingAnchor.constraint(lessThanOrEqualTo: contentView.trailingAnchor)
NSLayoutConstraint.activate([
titleLabelLeadingConstraint, titleLabelTrailingConstraint,
bodyLabelLeadingConstraint, bodyLabelTrailingConstraint,
])
NSLayoutConstraint.activate(
[
titleLabelLeadingConstraint, titleLabelTrailingConstraint,
bodyLabelLeadingConstraint, bodyLabelTrailingConstraint,
]
)
}

// MARK: - Respond to Layout Changes
Expand Down

0 comments on commit 6276029

Please sign in to comment.