Advertisement
iamalizade

Untitled

Dec 10th, 2015
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.65 KB | None | 0 0
  1. import Foundation
  2.  
  3. protocol BuddyRequestProtocol {
  4.     func showBuddyRequest()
  5. }
  6.  
  7. extension BuddyRequestProtocol where Self: UIViewController {
  8.     func showBuddyRequest(fromUser: String) {
  9.         let alert = UIAlertController(title: "AAA", message: "\(fromUser) wants to add you as a friend.", preferredStyle: UIAlertControllerStyle.Alert)
  10.         alert.addAction(UIAlertAction(title: "Friend Request", style: UIAlertActionStyle.Default, handler: nil))
  11.         self.presentViewController(alert, animated: true, completion: nil)
  12.     }
  13. }
  14.  
  15. // Usage
  16. class OpenChatsTableViewController: UITableViewController, OneRosterDelegate, BuddyRequestProtocol {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement