mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-15 01:59:07 +08:00
27 lines
574 B
Swift
27 lines
574 B
Swift
//
|
|
// UIViewController+MenuDone.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 7/18/18.
|
|
// Copyright © 2018 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
extension UIViewController {
|
|
|
|
func addMenuDoneButton() {
|
|
navigationItem.rightBarButtonItem = UIBarButtonItem(
|
|
barButtonSystemItem: .done,
|
|
target: self,
|
|
action: #selector(onMenuDone)
|
|
)
|
|
navigationItem.rightBarButtonItem?.tintColor = Styles.Colors.Gray.light.color
|
|
}
|
|
|
|
@objc func onMenuDone() {
|
|
dismiss(animated: true)
|
|
}
|
|
|
|
}
|