How to add hyperlink in iPhone app?

后端 未结 5 2206
无人共我
无人共我 2020-12-09 22:13

In my iPhone app, I require to show the hyperlink to a website

How can I add hyperlink for a website in iPhone programming?.

Actually i want to pass the lin

5条回答
  •  忘掉有多难
    2020-12-09 22:49

    My favorite library for sharing would be ShareKit. It's really easy to setup in your app, and will allow people to share via Facebook, and other services too. It's customizable too, so you can skin it, change colors, and control which services you want users to share with.

    Check out, http://www.getsharekit.com/

    Once you add it to your app you can integrate it very easily by creating a button

    [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction
     target:self
     action:@selector(share)];
    
    //add the button to a navigation bar or tool bar.
    

    and then creating the share method in your controller.

    - (void)share
    {
        // Create the item to share (in this example, a url)
        NSURL *url = [NSURL URLWithString:@"http://getsharekit.com"];
        SHKItem *item = [SHKItem URL:url title:@"ShareKit is Awesome!"];
    
        // Get the ShareKit action sheet
        SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
    
        // Display the action sheet
        [actionSheet showFromToolbar:navigationController.toolbar];
    }
    

提交回复
热议问题