我想在我的应用程序(使用Swift)中添加Layer SDK。
这里所有的视图控制器都是通过编程方式创建的。因此,我无法进行转场。我的应用程序有4个选项卡(
但是这并没有起作用。并且产生了这样的效果:在
这里所有的视图控制器都是通过编程方式创建的。因此,我无法进行转场。我的应用程序有4个选项卡(
UITabBarController
),其中一个是聊天。在聊天选项卡中,我创建了一个转场到UINavigationController
。现在我想在这个UINavigationController
中加载conversationListViewController
。为此,我创建了一个类来代表这个UINavigationController
,即ConversationListViewController
,并添加了以下代码:class ChatNavigationViewController: UINavigationController {
var conversationListViewController: ConversationListViewController!
var layerClient: LYRClient!
override func viewDidLoad() {
let appDelegate = UIApplication.sharedApplication().delegate as!AppDelegate
self.layerClient = appDelegate.layerClient
self.conversationListViewController = ConversationListViewController(layerClient: appDelegate.layerClient)
self.conversationListViewController.displaysAvatarItem = true
self.navigationController!.pushViewController(self.conversationListViewController, animated: true)
}
}
但是这并没有起作用。并且产生了这样的效果:在
UINavigationController
中未加载ConversationViewController
。我不确定自己是否做得正确。我正在寻找正确的方法,但是找不到。