Last active
August 29, 2015 14:10
-
-
Save freesia/7bbc0449948bd14cb16c to your computer and use it in GitHub Desktop.
alertview_ios7_ios8
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
if let alertController: AnyClass = NSClassFromString( "UIAlertController" ) | |
{ | |
// iOS 8: use UIAlertController | |
let alert = UIAlertController( title: "", message: "", preferredStyle: .Alert ) | |
alert.addAction( UIAlertAction( title: "OK", style: .Default, handler: nil )) | |
presentViewController( alert, animated: true, completion: nil ) | |
} | |
else | |
{ | |
// iOS 7: use UIAlertView | |
let alertView = UIAlertView( title: "", message: "", delegate: nil, cancelButtonTitle: nil, otherButtonTitles: "OK" ) | |
alertView.show() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment