forked from NikantVohra/HackerNewsClient-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuViewController.swift
More file actions
51 lines (39 loc) · 1.48 KB
/
MenuViewController.swift
File metadata and controls
51 lines (39 loc) · 1.48 KB
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
//
// MenuViewController.swift
// HackerNews
//
// Created by Vohra, Nikant on 27/03/15.
// Copyright (c) 2015 Vohra, Nikant. All rights reserved.
//
import UIKit
protocol MenuViewControllerDelegate: class {
func menuViewControllerDidTouchTop(controller: MenuViewController)
func menuViewControllerDidTouchRecent(controller: MenuViewController)
func menuViewControllerDidTouchAsk(controller: MenuViewController)
func menuViewControllerDidTouchShow(controller: MenuViewController)
}
class MenuViewController: UIViewController {
@IBOutlet weak var menuDialogView: DesignableView!
weak var delegate: MenuViewControllerDelegate?
@IBAction func closeButtonDidTouch(sender: UIButton) {
dismissViewControllerAnimated(true, completion: nil)
menuDialogView.animation = "fall"
menuDialogView.animate()
}
@IBAction func topButtonDidTouch(sender: UIButton) {
delegate?.menuViewControllerDidTouchTop(self)
closeButtonDidTouch(sender)
}
@IBAction func recentButtonDidTouch(sender: UIButton) {
delegate?.menuViewControllerDidTouchRecent(self)
closeButtonDidTouch(sender)
}
@IBAction func askButtonDidTouch(sender: UIButton) {
delegate?.menuViewControllerDidTouchAsk(self)
closeButtonDidTouch(sender)
}
@IBAction func showButtonDidTouch(sender: UIButton) {
delegate?.menuViewControllerDidTouchShow(self)
closeButtonDidTouch(sender)
}
}