forked from videolan/vlc-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Network Tab: Add tap to copy on Sharing via Wi-Fi cell
Partially answers to #1189
- Loading branch information
Showing
7 changed files
with
57 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/***************************************************************************** | ||
* UIAlertController+autoDismissable.swift | ||
* VLC for iOS | ||
***************************************************************************** | ||
* Copyright (c) 2021 VideoLAN. All rights reserved. | ||
* $Id$ | ||
* | ||
* Authors: Edgar Fouillet <vlc # edgar.fouillet.eu> | ||
* | ||
* Refer to the COPYING file of the official project for license. | ||
*****************************************************************************/ | ||
|
||
import UIKit | ||
|
||
extension UIAlertController { | ||
static func autoDismissable(title: String, message: String, dismissDelay: Double = 3.0) { | ||
if let rootViewController = UIApplication.shared.keyWindow?.rootViewController { | ||
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) | ||
alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment:""), | ||
style: .default, | ||
handler: nil)) | ||
|
||
rootViewController.present(alert, animated: true) | ||
DispatchQueue.main.asyncAfter(deadline: .now() + dismissDelay) { | ||
alert.dismiss(animated: true, completion: nil) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters