GithubHelp home page GithubHelp logo

jgvandehey / cfsharecircle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from camdenfullmer/cfsharecircle

0.0 2.0 0.0 4.26 MB

CFShareCircle is a user interface component for iOS that can be integrated into an app as a sharing mechanism for any kind of content.

License: MIT License

cfsharecircle's Introduction

#CFShareCircle

CFShareCircle is a better way for app developers to let users share the content to many different services. It is a simple UIView that adds drag and share capabilities to a developers application. View was only tested on iOS 6.0, but should be 5.1+ capable.

Demo Image 1

Demo Image 2

##How To Use

Follow the instructions to add CFShareCircle to your project.

###Basic Setup

  1. Add the following frameworks to your project under "Link Binary With Libraries" in "Build Phases".

     - UIKit
     - QuartzCore
     - Foundation
     - CoreGraphics
    
  2. Under the "CFShareCircle" directory copy the "Images" directory under "Resources" to your project. Then also copy over the CFShareCirleView and CFSharer files located under "Classes". Make sure that the CFShareCircle.m, CFShareCircle.h, CHSharer.m, and CFSharer.h are listed under "Copy Bundle Resources" under "Build Phases".

  3. Edit your view controller header file to import the CFShareCircle header file, add the delegate, and create an object.

    #import "CFShareCircleView.h"
    
    @interface ViewController : UIViewController <CFShareCircleViewDelegate>{    
        CFShareCircleView *shareCircleView;        
    }
    
  4. In your viewDidLoad method instantiate the CFShareCircle, set up the delegate, and add it to your navigation controller.

- (void)viewDidLoad
{
        // Do any additional setup after loading the view, typically from a nib.
        shareCircleView = [[CFShareCircleView alloc] initWithFrame:self.view.frame];
        shareCircleView.delegate = self;
        [self.navigationController.view addSubview:shareCircleView];
        [super viewDidLoad];
}
  1. Implement the delegate method for the view. Note: Index returned from the view is in order of the array (i.e. Starts from pi = 0 on the unit circle).
    - (void)shareCircleView:(CFShareCircleView *)shareCircleView didSelectIndex:(int)index{
        NSLog(@"Selected index: %d", index);
    }
  1. Finally just animate in the view whenever you want it pop up for the user.
    [shareCircleView animateIn];

###Customize CFShareCirlce

If you would like to determine what the CFShareCircle view shows, all you have to do is intialize your own array of sharers.

shareCircleView = [[CFShareCircleView alloc] initWithFrame:self.view.frame sharers:[[NSMutableArray alloc] initWithObjects: [[CFSharer alloc] initWithType:CFSharerTypeTwitter ], [[CFSharer alloc] initWithType:CFSharerTypeFacebook], nil]];

Then to extend this you can create your own CFSharer objects, just provide your own name for the sharer and image. Note that icons should be 100px by 100px for @2x and 50px by 50px for standard.

CFSharer *newSharer = [[CFSharer alloc] initWithName:@"Facebook" imageName:@"facebook.png"];

Types of CFSharers included:

- Evernote
- Twitter
- Google Drive
- Facebook
- Pinterest
- Dropbox
- Photos
- Mail

##Requirments

- ARC
- iOS 5.1+

##Contact Twitter

Website

##License The MIT License (MIT) Copyright (c) 2013 Camden Fullmer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cfsharecircle's People

Contributors

camdenfullmer avatar

Watchers

James Cloos avatar Jeremy Vandehey 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.