Permalink
Browse files

Initial public release of the Pinterest iOS SDK.

  • Loading branch information...
0 parents commit 557fc5785944f4c34c07111fd1308fdce7dac62d @jparise jparise committed Jul 21, 2015
Showing with 4,614 additions and 0 deletions.
  1. +32 −0 .gitignore
  2. +15 −0 .travis.yml
  3. +2 −0 CHANGELOG
  4. +601 −0 Example/PinterestSDK.xcodeproj/project.pbxproj
  5. +7 −0 Example/PinterestSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  6. +96 −0 Example/PinterestSDK.xcodeproj/xcshareddata/xcschemes/PinterestSDK-Example.xcscheme
  7. +10 −0 Example/PinterestSDK.xcworkspace/contents.xcworkspacedata
  8. +53 −0 Example/PinterestSDK/Images.xcassets/AppIcon.appiconset/Contents.json
  9. +51 −0 Example/PinterestSDK/Images.xcassets/LaunchImage.launchimage/Contents.json
  10. BIN Example/PinterestSDK/Images.xcassets/XcodeScreenshot.png
  11. +15 −0 Example/PinterestSDK/PDKAppDelegate.h
  12. +58 −0 Example/PinterestSDK/PDKAppDelegate.m
  13. +30 −0 Example/PinterestSDK/PDKBoardCell.h
  14. +77 −0 Example/PinterestSDK/PDKBoardCell.m
  15. +114 −0 Example/PinterestSDK/PDKBoardCell.xib
  16. +13 −0 Example/PinterestSDK/PDKBoardsViewController.h
  17. +253 −0 Example/PinterestSDK/PDKBoardsViewController.m
  18. +14 −0 Example/PinterestSDK/PDKPinCell.h
  19. +45 −0 Example/PinterestSDK/PDKPinCell.m
  20. +19 −0 Example/PinterestSDK/PDKPinsViewController.h
  21. +118 −0 Example/PinterestSDK/PDKPinsViewController.m
  22. +13 −0 Example/PinterestSDK/PDKViewController.h
  23. +187 −0 Example/PinterestSDK/PDKViewController.m
  24. +56 −0 Example/PinterestSDK/PinterestSDK-Info.plist
  25. +16 −0 Example/PinterestSDK/PinterestSDK-Prefix.pch
  26. +18 −0 Example/PinterestSDK/main.m
  27. +12 −0 Example/Podfile
  28. +54 −0 Example/Podfile.lock
  29. +22 −0 Example/Tests/Tests-Info.plist
  30. +13 −0 Example/Tests/Tests-Prefix.pch
  31. +43 −0 Example/Tests/Tests.m
  32. +19 −0 LICENSE
  33. +31 −0 PinterestSDK.podspec
  34. 0 Pod/Assets/.gitkeep
  35. 0 Pod/Classes/.gitkeep
  36. +56 −0 Pod/Classes/PDKBoard.h
  37. +44 −0 Pod/Classes/PDKBoard.m
  38. +19 −0 Pod/Classes/PDKCategories.h
  39. +86 −0 Pod/Classes/PDKCategories.m
  40. +388 −0 Pod/Classes/PDKClient.h
  41. +647 −0 Pod/Classes/PDKClient.m
  42. +36 −0 Pod/Classes/PDKImageInfo.h
  43. +26 −0 Pod/Classes/PDKImageInfo.m
  44. +34 −0 Pod/Classes/PDKInterest.h
  45. +28 −0 Pod/Classes/PDKInterest.m
  46. +67 −0 Pod/Classes/PDKModelObject.h
  47. +72 −0 Pod/Classes/PDKModelObject.m
  48. +108 −0 Pod/Classes/PDKPin.h
  49. +139 −0 Pod/Classes/PDKPin.m
  50. +196 −0 Pod/Classes/PDKResponseObject.h
  51. +186 −0 Pod/Classes/PDKResponseObject.m
  52. +67 −0 Pod/Classes/PDKUser.h
  53. +47 −0 Pod/Classes/PDKUser.m
  54. +15 −0 Pod/Classes/PinterestSDK.h
  55. +246 −0 README.md
@@ -0,0 +1,32 @@
+# OS X
+.DS_Store
+
+# Xcode
+build/
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+xcuserdata
+*.xccheckout
+profile
+*.moved-aside
+DerivedData
+*.hmap
+*.ipa
+
+# Bundler
+.bundle
+
+# We recommend against adding the Pods directory to your .gitignore. However
+# you should judge for yourself, the pros and cons are mentioned at:
+# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
+#
+# Note: if you ignore the Pods directory, make sure to uncomment
+# `pod install` in .travis.yml
+#
+Pods/
@@ -0,0 +1,15 @@
+# references:
+# * http://www.objc.io/issue-6/travis-ci.html
+# * https://github.com/supermarin/xcpretty#usage
+
+language: objective-c
+# cache: cocoapods
+# podfile: Example/Podfile
+# before_install:
+# - gem install cocoapods # Since Travis is not always on latest version
+- pod install --project-directory=Example
+install:
+- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
+script:
+- set -o pipefail && xcodebuild test -workspace Example/PinterestSDK.xcworkspace -scheme PinterestSDK-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c
+- pod lib lint --quick
@@ -0,0 +1,2 @@
+1.0
+- Initial release
Oops, something went wrong.
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:PinterestSDK.xcodeproj">
+ </FileRef>
+</Workspace>
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0600"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "6003F589195388D20070C39A"
+ BuildableName = "PinterestSDK.app"
+ BlueprintName = "PinterestSDK"
+ ReferencedContainer = "container:PinterestSDK.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ buildConfiguration = "Debug">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "6003F5AD195388D20070C39A"
+ BuildableName = "Tests.xctest"
+ BlueprintName = "Tests"
+ ReferencedContainer = "container:PinterestSDK.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "6003F589195388D20070C39A"
+ BuildableName = "PinterestSDK.app"
+ BlueprintName = "PinterestSDK"
+ ReferencedContainer = "container:PinterestSDK.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </TestAction>
+ <LaunchAction
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Debug"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ allowLocationSimulation = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "6003F589195388D20070C39A"
+ BuildableName = "PinterestSDK.app"
+ BlueprintName = "PinterestSDK"
+ ReferencedContainer = "container:PinterestSDK.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ buildConfiguration = "Release"
+ debugDocumentVersioning = "YES">
+ <BuildableProductRunnable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "6003F589195388D20070C39A"
+ BuildableName = "PinterestSDK.app"
+ BlueprintName = "PinterestSDK"
+ ReferencedContainer = "container:PinterestSDK.xcodeproj">
+ </BuildableReference>
+ </BuildableProductRunnable>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "group:PinterestSDK.xcodeproj">
+ </FileRef>
+ <FileRef
+ location = "group:Pods/Pods.xcodeproj">
+ </FileRef>
+</Workspace>
@@ -0,0 +1,53 @@
+{
+ "images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
@@ -0,0 +1,51 @@
+{
+ "images" : [
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "iphone",
+ "subtype" : "retina4",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "1x"
+ },
+ {
+ "orientation" : "portrait",
+ "idiom" : "ipad",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ },
+ {
+ "orientation" : "landscape",
+ "idiom" : "ipad",
+ "extent" : "full-screen",
+ "minimum-system-version" : "7.0",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,15 @@
+//
+// PDKAppDelegate.h
+// PinterestSDK
+//
+// Created by CocoaPods on 01/28/2015.
+// Copyright (c) 2014 ricky cancro. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface PDKAppDelegate : UIResponder <UIApplicationDelegate>
+
+@property (strong, nonatomic) UIWindow *window;
+
+@end
@@ -0,0 +1,58 @@
+//
+// PDKAppDelegate.m
+// PinterestSDK
+//
+// Created by CocoaPods on 01/28/2015.
+// Copyright (c) 2014 ricky cancro. All rights reserved.
+//
+
+#import "PDKAppDelegate.h"
+#import "PDKViewController.h"
+#import "PDKClient.h"
+
+static NSString * const kPDKExampleFakeAppId = @"4759388231231868449";
+
+@implementation PDKAppDelegate
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ [PDKClient configureSharedInstanceWithAppId:kPDKExampleFakeAppId];
+ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+ self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[PDKViewController alloc] init]];
+ [self.window makeKeyAndVisible];
+ return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+ // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+ // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+ // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+ // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+ // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
+{
+ return [[PDKClient sharedInstance] handleCallbackURL:url];
+}
+
+@end
@@ -0,0 +1,30 @@
+//
+// PDKBoardCell.h
+// PinterestSDK
+//
+// Created by Ricky Cancro on 3/14/15.
+// Copyright (c) 2015 ricky cancro. All rights reserved.
+//
+
+@import UIKit;
+@class PDKBoard;
+
+typedef void (^PDKBoardCellActionBlock)();
+
+@interface PDKBoardCell : UITableViewCell
+@property (nonatomic, strong) IBOutlet UIImageView *boardImageView;
+@property (nonatomic, strong) IBOutlet UILabel *percentageLabel;
+@property (nonatomic, strong) IBOutlet UILabel *boardNameLabel;
+@property (nonatomic, strong) IBOutlet UILabel *boardDescriptionLabel;
+
+@property (nonatomic, copy) PDKBoardCellActionBlock addPinFromURLBlock;
+@property (nonatomic, copy) PDKBoardCellActionBlock addPinFromImageBlock;
+
+- (IBAction)addPinFromURL:(id)sender;
+- (IBAction)addPinFromImage:(id)sender;
+
+- (void)updateWithBoard:(PDKBoard *)board;
+
+- (void)showSpinner:(BOOL)show withPercentage:(CGFloat)percentage;
+- (void)enableButtons:(BOOL)doEnable;
+@end
Oops, something went wrong.

0 comments on commit 557fc57

Please sign in to comment.