Coder Social home page Coder Social logo

sharekit's Introduction

Build Status

ShareKit allows you to share content easily:

- (void)myButtonHandlerAction {

    // 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!" contentType:SHKURLContentTypeWebpage];
    
    // Get the ShareKit action sheet
    SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];

    // ShareKit detects top view controller (the one intended to present ShareKit UI) automatically,
    // but sometimes it may not find one. To be safe, set it explicitly
    [SHK setRootViewController:self];
    
    // Display the action sheet
    if (NSClassFromString(@"UIAlertController")) {
        
        //iOS 8+
        SHKAlertController *alertController = [SHKAlertController actionSheetForItem:item];
        [alertController setModalPresentationStyle:UIModalPresentationPopover];
        UIPopoverPresentationController *popPresenter = [alertController popoverPresentationController];
        popPresenter.barButtonItem = self.toolbarItems[1];
        [self presentViewController:alertController animated:YES completion:nil];
        
    } else {
        
        //deprecated
        SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
        [actionSheet showFromToolbar:self.navigationController.toolbar];
    }

}

Everything else (user authentication, API calls, shareUI etc) is handled by ShareKit. Moreover, you can use and customise SHKAccountsViewController (where users can login/logoff, displays username if someone is logged to a particular service) and SHKUploadsViewController (similar to safari downloads, works with sharers able to report progress). For a brief introduction, check the demo app. To know more about configuration options see DefaultSHKConfigurator.m. To know more about what type of content can be shared, see SHKItem.h. To find out what services and actions are supported, check Sharer implementations. To get a picture of what they are capable of check their .m (implementation) files, methods named:

+ (BOOL)canShareURL;
+ (BOOL)canShareImage;
+ (BOOL)canShareText;
+ (BOOL)canShareFile:(SHKFile *)file;

should tell you everything you need.

Documentation

The latest documentation and installation instructions can be found on the ShareKit Wiki. To get a preview of new features see What's new wiki page.

!!! Updated new service creation guidelines for contributors + updated service templates are here !!!

ShareKit 2

In order to make it easier for new users to choose a canonical fork of ShareKit, the ShareKit community has decided to band together and take responsibility for collecting useful commits into what we're calling "ShareKit 2". It is now ready for you. It is the first officially stable version of ShareKit since February 2010, with more frequent updates expected.

Highlights:

  • many new sharers
  • new UI (currently used by Facebook, Plurk and LinkedIn, more to follow)
  • iOS native social.framework based sharers
  • optimised for easy updating (subproject library + 3rd party code as git submodules)
  • uses ARC and block callbacks

You can follow the initial planning at ideashower/ShareKit#283.

As ShareKit is now community driven, you are welcome to help, to judge new features, review pull requests etc.. There are many ways you can help, see FAQ

Credits

ShareKit was created by Nate Weiner, is updated by contributors and is maintained by Vilém Kurz.

sharekit's People

Contributors

ay8s avatar cocoabob avatar coneybeare avatar coryalder avatar dagerydoo avatar dlackty avatar ideashower avatar ikorich avatar jameslau-msft avatar jamiebriant avatar jstart avatar jverdi avatar kishikawakatsumi avatar leonardors avatar matej avatar mikk22 avatar mrchristopher124 avatar ngs avatar onomated avatar pkamppur avatar rehos avatar saturngod avatar scompt avatar sdarlington avatar slavabushtruk avatar steipete avatar tomquist avatar vguerci avatar vilemkurz avatar vocaro avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.