-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSegueToLeft.swift
32 lines (28 loc) · 914 Bytes
/
SegueToLeft.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// SegueToLeft.swift
// Gamezeum
//
// Created by Richel Cuyler on 11/3/17.
// Copyright © 2017 Richel Cuyler. All rights reserved.
//
import Foundation
import UIKit
class SegueToLeft: 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: src.view.frame.size.width, y: -0)
UIView.animate(withDuration: 0.25,
delay: 0.0,
options: UIViewAnimationOptions.curveEaseInOut,
animations: {
dst.view.transform = CGAffineTransform(translationX: -0, y: 0)
},
completion: { finished in
src.present(dst, animated: false, completion: nil)
})
}
}