I am new to iPhone. I want to open an url in my application. How can I do this task? Please suggest me and provide some useful link.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
Apparently the link given above is outdated. Here is the update link for the UIApplication class.
The quick and simple code snippet is:
Update (2016): The best way to do this nowadays is to instantiate and present an SFSafariViewController. This gives the user the security and speed of Safari, and access to any cookies or Safari features they may already have set without having to leave your app.
If you want to open the URL in Safari (and exit your application) you can use the openURL method of UIApplication
If you'd rather have it handled inside of your app, use WKWebView.
If you would like to open and just get the data from the URL, you could use NSString:
If what you are trying to get is an XML from a URL, you can directly use NSXMLParser:
On the other hand, if by opening you mean, open a URl in an embedded browser, you could use UIWebView class.