xcode6 之后push 和modal 就被废弃了。只能用于ios8之前。在拖线的时候我们就可以看见。

这两个方法被废弃了,我们需要找到合适的方法来代替,这时候我们发现 show 和Present Modally 方法,这个一般可以满足我们的使用要求。

下面我列出以下官方是怎么解释的。

官方文档 位置 https://developer.apple.com/library/ios/recipes/xcode_help-IB_storyboard/chapters/StoryboardSegue.html

Show

根据当前屏幕中的内容,在master area或者detail area中展示内容。

例如:如果app当前同时显示master和detail视图,内容将会压入detail区域。

如果app当前仅显示master或者detail视图,内容则压入当前视图控制器堆栈中的顶层视图。

Show Detail

在detail area中展现内容。

例如:即使app同时显示master和detail视图,那么内容将被压入detail区域

如果app当前仅显示Master或者detail视图,那么内容将替换当前视图控制器堆栈中的顶层视图。

Present Modally

使用模态展示内容。属性面板中提供presentation style (UIModalPresentationStyle)与 transition style (UIModalTransitionStyle)两种选项

Present as Popover

在某个现有视图中的锚点处使用弹出框展示内容。这个选项可指定显示在弹出框视图一边上的箭头可用方向,同时也是指定锚点视图的一个选项。

《以下是官网推荐》

Adding a Segue Between Scenes in a Storyboard

Specify a transition from one scene to another by Control-dragging between them.

 
  1. Open a storyboard in the interface builder.

  2. Control-drag from an object (such as a button, a table view cell, or a tab view item) in one scene to another scene.

    Interface Builder highlights a valid destination in blue.

  3. In the menu that appears, choose the style for the segue.

  4. Select the segue on the Interface Builder canvas or in its outline view. A selected segue will be shown in blue.

  5. Open the utility area for the workspace window by clicking  in the workspace selector in the toolbar.

  6. Click the Attributes button  to open the Attributes inspector.

  7. Type an identifying string in the segue Identifier field.

    Use an identifier that you can verify at runtime in the prepareForSegue:sender: method of the source view controller. You can also use the identifier to trigger a segue programmatically with the performSegueWithIdentifier:sender: method.

    To choose from several types of transitions for a popover segue, make choices from the pop-up menus in the Attributes inspector.

    For a custom segue, fill in the name of your custom segue class in the Attributes inspector. (See Creating Custom Segues for more information.)

Segue Types

There are several types of constraints, some of which are unique to either OS X or iOS. On iOS, the segues are further divided into segues that adapt to size classes and the older, and now deprecated types. You should avoid using the deprecated segues on iOS. The only possible reason to use them is supporting iOS versions less than iOS 8.

The following two tables list the types of segue for each platform including the name, interface builder symbol, and a brief description.

Table 1  iOS Segues

Name

Interface Builder Symbol

Description

Show

Present the content in the detail or master area depending on the content of the screen. If the app is displaying a master and detail view, the content is pushed onto the detail area. If the app is only displaying the master or the detail, the content is pushed on top of the current view controller stack.

Show Detail

Present the content in the detail area. If the app is displaying a master and detail view, the new content replaces the current detail. If the app is only displaying the master or the detail, the content replaces the top of the current view controller stack.

Present Modally

Present the content modally. There are options to choose a presentation style (UIModalPresentationStyle) and a transition style (UIModalTransitionStyle).

Present as Popover

Present the content as a popover anchored to an existing view. There is an option to specify the possible directions of the arrow shown on one edge of the popover view (UIPopoverArrowDirection). There is also an option to specify the anchor view.

Custom

A custom segue enabling you to write your own behaviors.

Push (Deprecated)

Present the content by pushing it onto the current stack of view controllers.

Modal (Deprecated)

Present the content modally on top of the existing screen. The options are the same as Present Modally.

Popover (Deprecated)

Present the content as a popover. The options are the same as Present as Popover.

Replace (Deprecated)

Replace the top view controller on the screen with the new content.

Table 2  OS X Segues

Name

Interface Builder Symbol

Description

Show

Present the content in a new window.

Modal

Present the content as a modal dialog.

Popover

Present the content as a popover anchored to an existing view. There are options to specify the behavior (NSPopoverBehavior), preferred edge, and the anchor view.

Sheet

Present the content as a sheet attached to the originating window.

Custom

A custom segue enabling you to write your own behaviors.

Xcode6中segue取消原push与modal(deprecated)的更多相关文章

  1. Storyboard里面的几种Segue区别及视图的切换:push,modal,popover,replace和custom

    一.视图切换类型介绍 在storyboard中,segue有几种不同的类型,在iphone和ipad的开发中,segue的类型是不同的. 在iphone中,segue有:push,modal,和cus ...

  2. iOS开发中视图相关的小笔记:push、modal、popover、replace、custom

    在storyboard中,segue有几种不同的类型,在iphone和ipad的开发中,segue的类型是不同的. 在iphone中,segue有:push,modal,和custom三种不同的类型, ...

  3. Storyboard中segue(转场)使用

    源引:http://www.2cto.com/kf/201210/161737.html 一.视图切换类型介绍在storyboard中,segue有几种不同的类型,在iphone和ipad的开发中,s ...

  4. 苹果在Xcode6中弃用segue的push和model

    苹果在Xcode6中弃用了segue的push和model.被show和present取代. 下面是新版本中每种类型的使用总结和例子.建议自己使用前先在测试项目中自己试一试 Show 根据当前屏幕中的 ...

  5. Xcode6中如何使用自定义的类模板

    说到IOS类的模板,有些人感觉很陌生,但是只要有开发过IOS程序的人,其实都用过类的模板,只不过是用的系统自带的类的模板. 例如创建一个ClassTemplateVC继承于UIViewControll ...

  6. Xcode6中autolayout和sizeclass的使用

    一.关于自动布局(Autolayout) 在Xcode中,自动布局看似是一个很复杂的系统,在真正使用它之前,我也是这么认为的,不过事实并非如此. 我们知道,一款iOS应用,其主要UI组件是由一个个相对 ...

  7. Xcode6中自动布局autolayout和sizeclass的使用

    Xcode6中自动布局autolayout和sizeclass的使用   一.关于自动布局(Autolayout) 在Xcode中,自动布局看似是一个很复杂的系统,在真正使用它之前,我也是这么认为的, ...

  8. 在xcode6中使用矢量图(iPhone6置配UI)

    转载出处:http://blog.xoneday.com ios应用程序是一个图像主导的产品.在开发一个应用程序时,你需要各种尺寸的图标,你需要为每个图像文件制作一个@1x尺寸和一个@2x尺寸.这样你 ...

  9. (转)Xcode6中自动布局autolayout和sizeclass的使用

    Xcode6中自动布局autolayout和sizeclass的使用   一.关于自动布局(Autolayout) 在Xcode中,自动布局看似是一个很复杂的系统,在真正使用它之前,我也是这么认为的, ...

随机推荐

  1. Bootstrap文本对齐风格

    在排版中离不开文本的对齐方式.在CSS中常常使用text-align来实现文本的对齐风格的设置.其中主要有四种风格: ☑  左对齐,取值left ☑  居中对齐,取值center ☑  右对齐,取值r ...

  2. OpenGL的gluLookAt和glOrtho的关系

    OpenGL的gluLookAt和glOrtho的关系 一直不明白gluLookAt()和glOrtho()两者之间的关系:gluLookAt()是观察变换,glOrtho()是正交投影.glLook ...

  3. Python 学习笔记 - 10.类(Class) 1

    定义 Python 的 Class 比较特别,和我们习惯的静态语言类型定义有很大区别. 1. 使用一个名为 __init__ 的方法来完成初始化.2. 使用一个名为 __del__ 的方法来完成类似析 ...

  4. PHP与Ajax的交互更新页面

    PHP与Ajax的交互更新页面 本次主要学习ajax的概念以及怎么与PHP之间进行交互操作 1.什么是Ajax?    国内翻译常为“阿贾克斯”和阿贾克斯足球队同音,AJAX 是一种用于创建快速动态网 ...

  5. Hbase之进行批处理操作

    import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; impo ...

  6. 用RestTemplate碰到的问题

    给请求加上头信息 Request request = new Request(); HttpHeaders requestHeaders = new HttpHeaders(); requestHea ...

  7. centos7 使用 omnibus包安装方式,安装 gitlab7.4

    centos7 使用 omnibus包安装方式,安装 gitlab7.4 1: gitlab是一个开源的软件,类似于github.com那样的git代码管理仓库: 官网 https://about.g ...

  8. 用NAN简化Google V8 JS引擎的扩展

    通过C++扩展Google V8 JS引擎的文章很多,Google V8 JS带的例子也容易明白.但是大部分文章都是Hello World型的,真正使用时发现处处是坑.扩展V8最经典的例子就是node ...

  9. IDE显示无法打开源文件时解决方案

      解决方法:加上具体地址信息将 #include <qwidgetresizehandler_p.h> 改为 #include <C:\Users\INnoVation\Deskt ...

  10. Java线程(二):线程同步synchronized和volatile

    上篇通过一个简单的例子说明了线程安全与不安全,在例子中不安全的情况下输出的结果恰好是逐个递增的(其实是巧合,多运行几次,会产生不同的输出结果),为什么会产生这样的结果呢,因为建立的Count对象是线程 ...