当用户点击我的 iMessage 应用程序中的箭头以转换到扩展 View 时,我有下面的代码来处理调整大小,但是当用户转到我的新 View Controller 时,我如何以编程方式打开扩展 View iMessage 应用程序?
override func didTransition(to presentationStyle: MSMessagesAppPresentationStyle) {
// Called after the extension transitions to a new presentation style.
if presentationStyle == MSMessagesAppPresentationStyle.compact {
//Resize Views
}
}
最佳答案
假设您在 MessagesViewController
中调用它,您可以通过以下方式以编程方式打开展开的 View :
Swift 版本:
if self.presentationStyle == MSMessagesAppPresentationStyle.compact {
self.requestPresentationStyle(MSMessagesAppPresentationStyle.expanded)
}
Obj-C 版本:
if (self.presentationStyle == MSMessagesAppPresentationStyleCompact) {
[self requestPresentationStyle:MSMessagesAppPresentationStyleExpanded];
}
关于ios - iMessage 应用程序以编程方式扩展 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42324527/