花了挺久时间,终于通过google在stake overflow上找到了解决方式。

总结一下:重写一个custom的segue,在storyboard的右边设置segue为custom,并设置其对应的class。

创建一个segue的类,继承UIStoryboardSegue,代码如下:

import UIKit

class SegueFromTop: UIStoryboardSegue {

override
func perform()

{

let src =
self.source

let dst =
self.destination

src.view.superview?.insertSubview(dst.view,
aboveSubview: src.view)

dst.view.transform =
CGAffineTransform(translationX:
, y: -src.view.frame.size.height)

UIView.animate(withDuration:
0.25,

delay: 0.0,

options: UIViewAnimationOptions.curveEaseInOut,

animations: {

dst.view.transform =
CGAffineTransform(translationX:
, y: )

},

completion: { finished in

src.present(dst, animated:
false, completion:
nil)

}

)

}

}

亲测可用!!!!!

自定义segue的方向的更多相关文章

  1. iOS——自定义Segue实现总结

    在阅读了iOS 8自定义动画转场上手指南后,刚开始不理解,后来慢慢消化了,现在总结如下: 1. 自定义Segue关键在于继承UIStoryboardSegue并重写perform方法 2. 动画可以在 ...

  2. segue生命周期

    segue生命周期:概述: 理解segue工作原理,需要理解一个segue对象的生命周期.segue对象是UIStoryboardSegue的实例或者是它的一个子类.所有iOS app都不能直接创建s ...

  3. 【IOS笔记】Using View Controllers in Your App

    参考:http://www.cnblogs.com/patientAndPersist/p/3279645.html Using View Controllers in Your App Whethe ...

  4. View Controller Programming Guide for iOS---(三)---Using View Controllers in Your App

    Using View Controllers in Your App Whether you are working with view controllers provided by iOS, or ...

  5. View Controller Programming Guid for iOS 笔记

    1.View Controller 基础 1.1 View Controller 分类 ViewController分为container view controller 和content view ...

  6. delphi dev 汉化

    //把以下文件复制到记事本中,并保存为DevChs.ini放在exe的目录下 //有这个cxLocalizer控件 //主窗体创建的时候 if (fileexists(ExtractFilePath( ...

  7. 2015年---移动端webapp知识总结

    没想到这样又过了5个月了,近期辞职了,所以我有时间来做总结. 这段时间里我学习了很多东西,而且都是我们移动端webapp的同学值得去学习的. 我先告诉大家我这次写的总结,有以下内容: 1.body的背 ...

  8. iOS学习33之可视化编程-StoryBoard

    1. storyBoard与xib 1> 概述 iOS下可视化编程分为两种方式: xib 和 storyboard 在使用 xib 和 storyboard 创建 GUI 过程中,以 XML 文 ...

  9. Android相机开发那些坑

    版权声明:本文由王梓原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/168 来源:腾云阁 https://www.qclou ...

随机推荐

  1. druid 连接池的配置参数

    介绍 DRUID是阿里巴巴开源平台上一个数据库连接池实现,它结合了C3P0.DBCP.PROXOOL等DB池的优点,同时加入了日志监控,可以很好的监控DB池连接和SQL的执行情况,可以说是针对监控而生 ...

  2. JPA 已作废的SQLQuery.class、setResultTransformer方法替换

    1.hibernate 5.2 之后,SQLQuery.class.setResultTransformer方法已作废,其用法如下: Query query = entityManager.creat ...

  3. dedecms织梦二次开发报名表单模块插件安装及配置详细教程

    网上找了很多,都不是太满意,功能不全不全不说,还没有详细的安装配置教程,经过自己的折腾,成功了修改程序并配置成功,亲测,试用没有问题!所以,决定给大家出一个针对新手的详细教程. 废话不多,直接上干货. ...

  4. 【CSS】width和height计算

    width:calc(100% - 20px); width:-webkit-calc(100% - 20px);//chrome width:-moz-calc(100% - 20px);//fir ...

  5. javascript随机点名--案例

    主要知识点涉及if选择结构判断语句.数组的定义.定时器.清除定时器.日期对象的使用. 1.HTML结构 <!DOCTYPE html> <html> <head> ...

  6. Service Cloud 零基础(一)Case 浅谈

    本片参考:https://resources.docs.salesforce.com/222/latest/en-us/sfdc/pdf/salesforce_case_implementation_ ...

  7. msf后门之persistence

    在获取得了meterpreter shell后 使用Persistence建立持续性后门 run persistence -h meterpreter > run persistence -h ...

  8. Android 使用appcompat_v7包以及源码注意事项

    最近学习和实践Android,无数次被AS和gradle惨痛的折磨,于是决定坚守Eclipse阵地..真是无奈之举,AS和gradle对我而言就像win10一样不讨喜. 当然Eclipse中开发and ...

  9. python学习-模块与包(九)

    9.4查看模块内容 dir(): 返回模块或类所包含的全部程序单元(包括变量.函数.类和方法等) __all__:模块本身提供的变量,不会展示以下划线开头的程序单元.另使用from xx import ...

  10. 从零开始把项目发布到Nuget仓库中心

    从零开始把项目发布到Nuget仓库中心 我的项目地址 https://github.com/Ants-double/dasuan ### 前期准备 下载并注册nuget帐号 下载地址 https:// ...