我正在尝试将MessageKit(JSQMessagesViewController替换)集成到我的项目中。
从我didSelectRowAt的消息表中,我选择了我的ConversationVC哪些子类MessagesViewController(MessageKit要求)
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard let conversationVC = storyboard?.instantiateViewController(withIdentifier: "ConversationVC") as? ConversationVC else { return }
self.presentDetail(conversationVC)
}//end func
使用以下自定义函数来呈现 VC,这非常好:
func presentDetail(_ viewControllerToPresent: UIViewController){
//constant to hold animation
let transition = CATransition()
transition.duration = 0.20 //seconds
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
self.view.window?.layer.add(transition, forKey: kCATransition)
present(viewControllerToPresent, animated: false, completion: nil)
}//end func
问题是,一旦ConversationVC从右侧出现,底部的输入消息字段就会消失如果我使用标准 segue(模态)然后它会显示。
