-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update shout view to increase larger touch area #132
Conversation
@onmyway133, thanks for your PR! By analyzing the history of the files in this pull request, we identified @RamonGilabert, @tkohout and @LucidityDesign to be potential reviewers. |
[indicatorView, imageView, titleLabel, subtitleLabel, gestureContainer].forEach { | ||
backgroundView.addSubview($0) } | ||
[imageView, titleLabel, subtitleLabel, indicatorView].forEach { | ||
$0.autoresizingMask = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need autoresizing, so explicitly disable it
frame = CGRect(x: 0, y: 0, width: width, height: 0) | ||
backgroundView.frame = CGRect(x: 0, y: 0, width: width, height: 0) | ||
|
||
frame.size.height = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reset to 0 to make the animation happen
@@ -86,15 +79,18 @@ open class ShoutView: UIView { | |||
open fileprivate(set) var completion: (() -> ())? | |||
|
|||
private var subtitleLabelOriginalHeight: CGFloat = 0 | |||
private var internalHeight: CGFloat = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the height of the visible view
UIView.animate(withDuration: 0.2, animations: { | ||
self.frame.size.height = height + Dimensions.touchOffset | ||
}, completion: { _ in | ||
if translation.y < -5 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each statement in each line
frame didSet
, make it easy to reason about the code