Skip to content

Commit

Permalink
add "unavailable" flag to UIViewController property in app extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
jlandon committed Apr 19, 2018
1 parent 5b0e9d7 commit 1be0fdb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Sources/UIViewController+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ extension UIViewController {
/// Retrieve the view controller currently on-screen
///
/// Based off code here: http://stackoverflow.com/questions/24825123/get-the-current-view-controller-from-the-app-delegate
@available(iOSApplicationExtension, unavailable)
public static var current: UIViewController? {
if let controller = UIApplication.shared.keyWindow?.rootViewController {
return findCurrent(controller)
Expand Down

0 comments on commit 1be0fdb

Please sign in to comment.