草庐IT

MX_Controller

全部标签

ios - 在容器 View Controller 中添加/删除时如何为 subview Controller 设置动画?

我有以下2个函数可以添加和删除从容器ViewController触发的subviewController:@discardableResultfuncaddChildViewController(withChildViewControllerchildViewController:UIViewController)->UIViewController{//AddChildViewControlleraddChildViewController(childViewController)childViewController.beginAppearanceTransition(true,a

ios - 如何使用自定义转换在当前上下文中呈现 View Controller ?

我遇到了ViewController包含的问题,我想通过自定义演示/动画“在当前上下文中”呈现ViewController。我有一个RootViewController,它有两个subviewController,它们可以作为根的subviewController添加和删除。当这些subviewController呈现一个ViewController时,我希望呈现在当前上下文之上,以便当呈现的subview从View层次结构中移除并释放时,呈现的模态也将被移除。此外,如果childA呈现一个ViewController,我希望childB的“presentedViewControlle

ios - 如何使用自定义转换在当前上下文中呈现 View Controller ?

我遇到了ViewController包含的问题,我想通过自定义演示/动画“在当前上下文中”呈现ViewController。我有一个RootViewController,它有两个subviewController,它们可以作为根的subviewController添加和删除。当这些subviewController呈现一个ViewController时,我希望呈现在当前上下文之上,以便当呈现的subview从View层次结构中移除并释放时,呈现的模态也将被移除。此外,如果childA呈现一个ViewController,我希望childB的“presentedViewControlle

ios - 什么时候在关闭 View Controller 时 self 释放

我有一个关于内存释放和block/闭包的问题。以下是Swift方法self!.dismissViewControllerAnimated(false,completion:{println(self);})或者objective-c方法[selfdismissViewControllerAnimated:NOcompletion:^{NSLog("%@",self);}];如果有人能解释在上述方法中self何时被释放,我将不胜感激。是在完成block运行之后还是之前?我知道它由ARC负责,但我想知道自己是否在完成block中或之后收到释放消息。因此,如果我在完成block(访问自身)中

ios - 什么时候在关闭 View Controller 时 self 释放

我有一个关于内存释放和block/闭包的问题。以下是Swift方法self!.dismissViewControllerAnimated(false,completion:{println(self);})或者objective-c方法[selfdismissViewControllerAnimated:NOcompletion:^{NSLog("%@",self);}];如果有人能解释在上述方法中self何时被释放,我将不胜感激。是在完成block运行之后还是之前?我知道它由ARC负责,但我想知道自己是否在完成block中或之后收到释放消息。因此,如果我在完成block(访问自身)中

ios - 如何在关闭 ViewController 时将数据传递给另一个 Controller ?

我想在VC关闭时将我的数据从一个ViewController传递到另一个VC。可能吗?我已经尝试了下一个方法但没有成功:点击按钮:self.dismiss(animated:true){letstoryboard=UIStoryboard(name:"Main",bundle:nil)letcontroller=storyboard.instantiateViewController(withIdentifier:"EditViewController")as!EditViewControllercontroller.segueArray=[values]}当EditViewContr

ios - 如何在关闭 ViewController 时将数据传递给另一个 Controller ?

我想在VC关闭时将我的数据从一个ViewController传递到另一个VC。可能吗?我已经尝试了下一个方法但没有成功:点击按钮:self.dismiss(animated:true){letstoryboard=UIStoryboard(name:"Main",bundle:nil)letcontroller=storyboard.instantiateViewController(withIdentifier:"EditViewController")as!EditViewControllercontroller.segueArray=[values]}当EditViewContr

ios - 如何从第一个选项卡转到选项卡栏 Controller 的第二个选项卡?

我在实际执行segue时没有问题,但是当我这样做时,我的选项卡栏从View底部消失了。我制作了一个从TabBarController1到TabBarController2的Storyboard转场。我找到了很多关于Objective-C的答案,但没有找到关于Swift的答案。这是执行转场的代码:ifrequestsArray.count==0{self.performSegueWithIdentifier("offerSegue",sender:self)}else{self.performSegueWithIdentifier("confirm1",sender:self)}

ios - 如何从第一个选项卡转到选项卡栏 Controller 的第二个选项卡?

我在实际执行segue时没有问题,但是当我这样做时,我的选项卡栏从View底部消失了。我制作了一个从TabBarController1到TabBarController2的Storyboard转场。我找到了很多关于Objective-C的答案,但没有找到关于Swift的答案。这是执行转场的代码:ifrequestsArray.count==0{self.performSegueWithIdentifier("offerSegue",sender:self)}else{self.performSegueWithIdentifier("confirm1",sender:self)}

ios - Swift - 显示另一个带有导航栏的 View Controller

我有两个ViewControllers--一个有Storyboard,一个没有。这两个ViewController在顶部都有自己的导航栏。现在,当我使用self.presentViewController(editorViewController,animated:true,completion:nil)时,我的editorViewController出现了,但没有导航栏。有什么办法解决这个问题吗? 最佳答案 我使用以下代码解决了这个问题:leteditorViewController=IMGLYMainEditorViewCont