mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-11 13:56:10 +10:00
show ConversationMoreView in window; hide ConversationMoreView when showProfileAction
This commit is contained in:
@@ -986,7 +986,9 @@ class ConversationViewController: BaseViewController {
|
||||
self.report()
|
||||
}
|
||||
|
||||
moreView.showInView(view)
|
||||
if let window = view.window {
|
||||
moreView.showInView(window)
|
||||
}
|
||||
}
|
||||
|
||||
func updateNotificationEnabled(enabled: Bool, forUserWithUserID userID: String) {
|
||||
|
||||
@@ -185,6 +185,8 @@ class ConversationMoreView: UIView {
|
||||
|
||||
layoutIfNeeded()
|
||||
|
||||
containerView.alpha = 1
|
||||
|
||||
UIView.animateWithDuration(0.05, delay: 0.0, options: .CurveEaseInOut, animations: { _ in
|
||||
self.containerView.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.3)
|
||||
|
||||
@@ -200,7 +202,6 @@ class ConversationMoreView: UIView {
|
||||
}
|
||||
|
||||
func hide() {
|
||||
|
||||
UIView.animateWithDuration(0.2, delay: 0.0, options: .CurveEaseInOut, animations: { _ in
|
||||
self.tableViewBottomConstraint?.constant = 300
|
||||
|
||||
@@ -217,6 +218,24 @@ class ConversationMoreView: UIView {
|
||||
})
|
||||
}
|
||||
|
||||
func hideAndDo(afterHideAction: (() -> Void)?) {
|
||||
|
||||
UIView.animateWithDuration(0.2, delay: 0.0, options: .CurveLinear, animations: { _ in
|
||||
self.containerView.alpha = 0
|
||||
|
||||
self.tableViewBottomConstraint?.constant = 300
|
||||
|
||||
self.layoutIfNeeded()
|
||||
|
||||
}, completion: { finished in
|
||||
self.removeFromSuperview()
|
||||
})
|
||||
|
||||
delay(0.1) {
|
||||
afterHideAction?()
|
||||
}
|
||||
}
|
||||
|
||||
var isFirstTimeBeenAddAsSubview = true
|
||||
|
||||
override func didMoveToSuperview() {
|
||||
@@ -382,10 +401,13 @@ extension ConversationMoreView: UITableViewDataSource, UITableViewDelegate {
|
||||
tableView.deselectRowAtIndexPath(indexPath, animated: true)
|
||||
|
||||
if let row = Row(rawValue: indexPath.row) {
|
||||
|
||||
switch row {
|
||||
|
||||
case .ShowProfile:
|
||||
showProfileAction?()
|
||||
hideAndDo { [unowned self] in
|
||||
self.showProfileAction?()
|
||||
}
|
||||
|
||||
case .DoNotDisturb:
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user