Created
May 18, 2015 14:41
-
-
Save anonymous/7af74fdcf90982d6068d to your computer and use it in GitHub Desktop.
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
class CustomTextView: UITextView { | |
override func drawRect(rect: CGRect) { | |
self.setNeedsLayout() | |
} | |
override func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) { | |
becomeFirstResponder() | |
var menu = UIMenuController.sharedMenuController() | |
var shareItem = UIMenuItem(title: "Paylaş", action: Selector("paylasFonksiyonu")) | |
menu.menuItems = [shareItem] | |
menu.setMenuVisible(true, animated: true) | |
} | |
func paylasFonksiyonu(){ | |
println("paylaşma fonksiyonu çalıştı...") | |
} | |
override func canBecomeFirstResponder() -> Bool { | |
return true | |
} | |
override func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool { | |
return super.canPerformAction(action, withSender: sender) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment