//
// HanJie.swift
// RXFunction
//
// Created by 王木木 on 16/11/2.
// Copyright © 2016年 王木木. All rights reserved.
//
import UIKit
protocol Delegate : NSObjectProtocol {
func touchDidSelectRowAtIndexPath(indexRom: Int)
}
class HanJie: UIViewController {
var delegate: Delegate!
override func viewDidLoad() {
super.viewDidLoad()
}
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
super.touchesBegan(touches, withEvent: event)
self.delegate?.touchDidSelectRowAtIndexPath(1)
}
}
class Jie: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let vc = HanJie()
vc.delegate = self
self.navigationController?.pushViewController(vc, animated: true)
}
}
extension Jie: Delegate {
func touchDidSelectRowAtIndexPath(indexRom: Int) {
print(indexRom)
}
}