SEBeamMeUpScotty 0.0.3

SEBeamMeUpScotty 0.0.3

TestsTested
LangLanguage Obj-CObjective C
License WTFPL
ReleasedLast Release Dec 2014

Maintained by Unclaimed.


Downloads

Total36
Week0
Month0

Installs

Apps16
Test Targets1
powered by Segment

GitHub

Stars24
Watchers5
Forks3
Issues1
Contributors1
Pull Requests0

Code

Files0
LOCLines of Code 0


 
Depends on:
ReactiveCocoa>= 1.4.0
libextobjc/EXTScope>= 0.2.5
BrynKit/Main>= 1.2.1
BrynKit/RACHelpers>= 1.2.1
BrynKit/CocoaLumberjack>= 1.2.1
StateMachine-GCDThreadsafe>= 2.0.1
CocoaLumberjack>= 0
Facebook-iOS-SDK>= 3.1.1
iOS-GTLYouTube>= 0.0.2
 

  • By
  • bryn austin bellomy

// beam me up, scotty

starfleet-grade iOS video uploads.

installing

Use CocoaPods.

In your Podfile:

pod 'SEBeamMeUpScotty'

Then back in the shell:

$ pod install

how to use (here's a longer example)

Initialize the session controller.

SEFacebookSessionController *facebookSessionController
    = [[SEFacebookSessionController alloc] initAppID:kAppID];

SEYouTubeSessionController *youtubeSessionController
    = [[SEYouTubeSessionController alloc]
            initWithKeychainItemName:kKeychainItemName
                            clientID:kYouTubeClientID
                        clientSecret:kYouTubeClientSecret];

Prepare the upload controller.

NSURL *videoFileURL = ... ;

SEFacebookUploadController *facebookUploadController
    = [facebookSessionController uploadControllerForVideoFileURL: videoFileURL];

SEYouTubeUploadController *youtubeUploadController
    = [youtubeSessionController uploadControllerForVideoFileURL: videoFileURL];

Some session controllers can auto-login from the keychain if the user has logged in before. Others can't.

assert(facebookSessionController.isSignedIn == YES or NO);
assert(youtubeSessionController.isSignedIn == NO);

Use ReactiveCocoa to observe the properties that you need to respond to.

// disable the upload button when the user is signed out
RAC(self.uploadButton.enabled) =
   RACAbleWithStart(facebookSessionController, isSignedIn);

// dim the upload button when the user is signed out
RAC(self.uploadButton.alpha) =
    [RACAbleWithStart(facebookSessionController, isSignedIn)
        map:^id (NSNumber *isSignedIn) {
            if (isSignedIn.boolValue == YES)
                return @1.0f;
            else
                return @0.4f
        }];

contributors

license (WTFPL)

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE  
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified 
copies of this license document, and changing it is allowed as long 
as the name is changed. 

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.