-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimeLineViewController.swift
85 lines (75 loc) · 2.99 KB
/
TimeLineViewController.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//
// TimeLineViewController.swift
// Carousel
//
// Created by Marc Haumann on 2/13/16.
// Copyright © 2016 Marc Haumann. All rights reserved.
//
import UIKit
class TimeLineViewController: UIViewController {
@IBOutlet weak var image3: UIImageView!
@IBOutlet weak var image2: UIImageView!
@IBOutlet weak var scrubber: UIImageView!
@IBOutlet weak var navImage: UIImageView!
@IBOutlet weak var feedImage: UIImageView!
@IBOutlet weak var bannerView: UIView!
@IBOutlet weak var imageButton: UIButton!
@IBOutlet weak var timeLineScrollView: UIScrollView!
var defaults = NSUserDefaults.standardUserDefaults()
override func viewDidLoad() {
super.viewDidLoad()
timeLineScrollView.contentSize = CGSize(width: 320, height: 1564+36+65)
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewDidAppear(animated: Bool) {
UIView.animateWithDuration(0.3) { () -> Void in
self.bannerView.alpha=1
self.scrubber.alpha=1
self.navImage.alpha=1
self.feedImage.alpha=1
self.image2.alpha=1
self.image3.alpha=1
self.imageButton.transform = CGAffineTransformIdentity
if self.defaults.integerForKey("photoDidTap") == 1 && self.defaults.integerForKey("photoDidScroll") == 1 && self.defaults.integerForKey("shareDidTap") == 1 {
self.bannerView.transform = CGAffineTransformIdentity
}
else {
self.bannerView.transform = CGAffineTransformMakeTranslation(0, 44)
}
}
}
@IBAction func closeDidTap(sender: AnyObject) {
UIView.animateWithDuration(0.3) { () -> Void in
self.bannerView.transform = CGAffineTransformIdentity
}
}
@IBAction func imageDidTap(sender: AnyObject) {
defaults.setInteger(1, forKey: "photoTap")
defaults.synchronize()
UIView.animateWithDuration(0.4) { () -> Void in
self.bannerView.alpha=0
self.scrubber.alpha=0
self.navImage.alpha=0
self.feedImage.alpha=0
self.image2.alpha=0
self.image3.alpha=0
self.imageButton.transform = CGAffineTransformMakeTranslation(107, 10)
self.imageButton.transform = CGAffineTransformScale(self.imageButton.transform, 3, 3)
}
delay(0.4){
self.performSegueWithIdentifier("slideShowSegue", sender: self)
}
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}