Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- protocol BuddyRequestProtocol {
- func showBuddyRequest()
- }
- extension BuddyRequestProtocol where Self: UIViewController {
- func showBuddyRequest(fromUser: String) {
- let alert = UIAlertController(title: "AAA", message: "\(fromUser) wants to add you as a friend.", preferredStyle: UIAlertControllerStyle.Alert)
- alert.addAction(UIAlertAction(title: "Friend Request", style: UIAlertActionStyle.Default, handler: nil))
- self.presentViewController(alert, animated: true, completion: nil)
- }
- }
- // Usage
- class OpenChatsTableViewController: UITableViewController, OneRosterDelegate, BuddyRequestProtocol {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement