Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brynbellomy/sebeammeupscotty
Reactive, super-simple iOS video upload classes for YouTube, Facebook, etc.
https://github.com/brynbellomy/sebeammeupscotty
Last synced: 25 days ago
JSON representation
Reactive, super-simple iOS video upload classes for YouTube, Facebook, etc.
- Host: GitHub
- URL: https://github.com/brynbellomy/sebeammeupscotty
- Owner: brynbellomy
- License: wtfpl
- Created: 2013-03-21T10:29:46.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-03-27T01:17:28.000Z (over 11 years ago)
- Last Synced: 2024-10-04T13:15:05.367Z (about 1 month ago)
- Language: Objective-C
- Homepage:
- Size: 176 KB
- Stars: 22
- Watchers: 5
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# // beam me up, scotty
starfleet-grade iOS video uploads.
# installing
Use [CocoaPods](http://cocoapods.org).
In your Podfile:
```ruby
pod 'SEBeamMeUpScotty'
```Then back in the shell:
```shell
$ pod install
```# how to use ([here's a longer example](https://github.com/brynbellomy/SEBeamMeUpScotty/blob/master/ReallyTerseExample.m))
Initialize the session controller.
```objective-c
SEFacebookSessionController *facebookSessionController
= [[SEFacebookSessionController alloc] initAppID:kAppID];SEYouTubeSessionController *youtubeSessionController
= [[SEYouTubeSessionController alloc]
initWithKeychainItemName:kKeychainItemName
clientID:kYouTubeClientID
clientSecret:kYouTubeClientSecret];
```Prepare the upload controller.
```objective-c
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.
```objective-c
assert(facebookSessionController.isSignedIn == YES or NO);
assert(youtubeSessionController.isSignedIn == NO);
```Use [ReactiveCocoa](http://github.com/ReactiveCocoa/ReactiveCocoa) to observe the properties that you need to respond to.
```objective-c
// 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
- bryn austin bellomy < >
# license (WTFPL)
```text
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004Copyright (C) 2004 Sam Hocevar
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.
```