├── .swift-version ├── iPicUploader ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── iPicImageHost.swift │ ├── iPicImage.swift │ ├── iPicUploadResult.swift │ ├── iPicUploadHelper.swift │ ├── iPicPasteboardHelper.swift │ └── iPicUploader.swift ├── iPicUploader.xcworkspace ├── Example ├── Pods │ ├── Target Support Files │ │ ├── iPicUploader │ │ │ ├── iPicUploader-prefix.pch │ │ │ ├── iPicUploader.modulemap │ │ │ ├── iPicUploader-dummy.m │ │ │ ├── iPicUploader-umbrella.h │ │ │ ├── iPicUploader.xcconfig │ │ │ └── Info.plist │ │ └── Pods-iPicUploaderExample │ │ │ ├── Pods-iPicUploaderExample.modulemap │ │ │ ├── Pods-iPicUploaderExample-dummy.m │ │ │ ├── Pods-iPicUploaderExample-umbrella.h │ │ │ ├── Pods-iPicUploaderExample.debug.xcconfig │ │ │ ├── Pods-iPicUploaderExample.release.xcconfig │ │ │ ├── Info.plist │ │ │ ├── Pods-iPicUploaderExample-acknowledgements.markdown │ │ │ ├── Pods-iPicUploaderExample-acknowledgements.plist │ │ │ ├── Pods-iPicUploaderExample-frameworks.sh │ │ │ └── Pods-iPicUploaderExample-resources.sh │ ├── iPicUploaderTests │ │ ├── Resources │ │ │ └── iPic.png │ │ ├── UnitTestsConstants.swift │ │ ├── Info.plist │ │ ├── iPicUploadHelperTests.swift │ │ ├── iPicImageTests.swift │ │ ├── iPicUploadResultTests.swift │ │ └── iPicUploaderTests.swift │ ├── Pods.xcodeproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── project.pbxproj │ ├── Manifest.lock │ ├── iPicUploader │ │ ├── iPicUploader.h │ │ └── Info.plist │ └── Local Podspecs │ │ └── iPicUploader.podspec.json ├── iPicUploaderExample │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── AppIcon_16.png │ │ │ ├── AppIcon_32.png │ │ │ ├── AppIcon_64.png │ │ │ ├── AppIcon_1024.png │ │ │ ├── AppIcon_128.png │ │ │ ├── AppIcon_256-1.png │ │ │ ├── AppIcon_256.png │ │ │ ├── AppIcon_32-1.png │ │ │ ├── AppIcon_512-1.png │ │ │ ├── AppIcon_512.png │ │ │ └── Contents.json │ │ ├── NormalStateIcon.imageset │ │ │ ├── NormalStateIcon1.png │ │ │ ├── NormalStateIcon2.png │ │ │ ├── NormalStateIcon3.png │ │ │ └── Contents.json │ │ ├── DraggingStateIcon.imageset │ │ │ ├── DraggingStateIcon1.png │ │ │ ├── DraggingStateIcon2.png │ │ │ ├── DraggingStateIcon3.png │ │ │ └── Contents.json │ │ └── UploadingStateIcon.imageset │ │ │ ├── UploadingStateIcon1.png │ │ │ ├── UploadingStateIcon2.png │ │ │ ├── UploadingStateIcon3.png │ │ │ └── Contents.json │ ├── iPicUploaderExample.entitlements │ ├── AppDelegate.swift │ ├── Info.plist │ ├── iPicImageView.swift │ ├── MainWindowController.swift │ ├── MainWindowController.xib │ └── Base.lproj │ │ └── MainMenu.xib ├── iPicUploader.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj ├── iPicUploader.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Podfile └── Podfile.lock ├── .travis.yml ├── .gitignore ├── LICENSE ├── iPicUploader.podspec └── README.md /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0.1 2 | -------------------------------------------------------------------------------- /iPicUploader/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /iPicUploader/Classes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /iPicUploader.xcworkspace: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/iPicUploader.xcworkspace -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/iPicUploader/iPicUploader-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/Pods/iPicUploaderTests/Resources/iPic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/Pods/iPicUploaderTests/Resources/iPic.png -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/iPicUploader/iPicUploader.modulemap: -------------------------------------------------------------------------------- 1 | framework module iPicUploader { 2 | umbrella header "iPicUploader-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_16.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_32.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_64.png -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/iPicUploader/iPicUploader-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_iPicUploader : NSObject 3 | @end 4 | @implementation PodsDummy_iPicUploader 5 | @end 6 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_1024.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_128.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_256-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_256-1.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_256.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_32-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_32-1.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_512-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_512-1.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/AppIcon_512.png -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/NormalStateIcon.imageset/NormalStateIcon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/NormalStateIcon.imageset/NormalStateIcon1.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/NormalStateIcon.imageset/NormalStateIcon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/NormalStateIcon.imageset/NormalStateIcon2.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/NormalStateIcon.imageset/NormalStateIcon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/NormalStateIcon.imageset/NormalStateIcon3.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/DraggingStateIcon.imageset/DraggingStateIcon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/DraggingStateIcon.imageset/DraggingStateIcon1.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/DraggingStateIcon.imageset/DraggingStateIcon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/DraggingStateIcon.imageset/DraggingStateIcon2.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/DraggingStateIcon.imageset/DraggingStateIcon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/DraggingStateIcon.imageset/DraggingStateIcon3.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/UploadingStateIcon.imageset/UploadingStateIcon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/UploadingStateIcon.imageset/UploadingStateIcon1.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/UploadingStateIcon.imageset/UploadingStateIcon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/UploadingStateIcon.imageset/UploadingStateIcon2.png -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/UploadingStateIcon.imageset/UploadingStateIcon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toolinbox/iPicUploader/HEAD/Example/iPicUploaderExample/Assets.xcassets/UploadingStateIcon.imageset/UploadingStateIcon3.png -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_iPicUploaderExample { 2 | umbrella header "Pods-iPicUploaderExample-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_iPicUploaderExample : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_iPicUploaderExample 5 | @end 6 | -------------------------------------------------------------------------------- /Example/iPicUploader.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/iPicUploader/iPicUploader-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double iPicUploaderVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char iPicUploaderVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | 6 | FOUNDATION_EXPORT double Pods_iPicUploaderExampleVersionNumber; 7 | FOUNDATION_EXPORT const unsigned char Pods_iPicUploaderExampleVersionString[]; 8 | 9 | -------------------------------------------------------------------------------- /Example/iPicUploader.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/iPicUploader.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | 2 | use_frameworks! 3 | 4 | target 'iPicUploaderExample' do 5 | pod 'iPicUploader', :path => '../' 6 | end 7 | 8 | post_install do |installer| 9 | installer.pods_project.targets.each do |target| 10 | target.build_configurations.each do |config| 11 | config.build_settings['SWIFT_VERSION'] = '3.0' 12 | end 13 | end 14 | end 15 | 16 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - iPicUploader (1.2.2) 3 | 4 | DEPENDENCIES: 5 | - iPicUploader (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | iPicUploader: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | iPicUploader: 48b09f22b9f79abcdff7c2945179e632ff23420a 13 | 14 | PODFILE CHECKSUM: 6ce13e731cd3aee60b1597ec555eea90e40d8dca 15 | 16 | COCOAPODS: 1.1.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - iPicUploader (1.2.2) 3 | 4 | DEPENDENCIES: 5 | - iPicUploader (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | iPicUploader: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | iPicUploader: 48b09f22b9f79abcdff7c2945179e632ff23420a 13 | 14 | PODFILE CHECKSUM: 6ce13e731cd3aee60b1597ec555eea90e40d8dca 15 | 16 | COCOAPODS: 1.1.1 17 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/iPicUploaderExample.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-write 8 | 9 | com.apple.security.network.client 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/NormalStateIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "NormalStateIcon1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "NormalStateIcon2.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "NormalStateIcon3.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -workspace Example/iPicUploader.xcworkspace -scheme iPicUploader-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/Pods/iPicUploader/iPicUploader.h: -------------------------------------------------------------------------------- 1 | // 2 | // iPicUploader.h 3 | // iPicUploader 4 | // 5 | // Created by Jason Zheng on 9/1/16. 6 | // 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for iPicUploader. 12 | FOUNDATION_EXPORT double iPicUploaderVersionNumber; 13 | 14 | //! Project version string for iPicUploader. 15 | FOUNDATION_EXPORT const unsigned char iPicUploaderVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/DraggingStateIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "DraggingStateIcon1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "DraggingStateIcon2.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "DraggingStateIcon3.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/UploadingStateIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "UploadingStateIcon1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "UploadingStateIcon2.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "UploadingStateIcon3.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Pods/iPicUploaderTests/UnitTestsConstants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ConstantsTests.swift 3 | // Pods 4 | // 5 | // Created by Jason Zheng on 9/3/16. 6 | // 7 | // 8 | 9 | import XCTest 10 | 11 | let UTConstants = UnitTestsConstants.sharedInstance 12 | 13 | class UnitTestsConstants { 14 | // Singleton 15 | static let sharedInstance = UnitTestsConstants() 16 | private init() {} 17 | 18 | let waitTime: TimeInterval = 15 19 | 20 | var imageFilePath: String { 21 | let bundle = Bundle(for: type(of: self)) 22 | return bundle.path(forResource: "iPic", ofType: "png")! 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/iPicUploader/iPicUploader.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/iPicUploader 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // iPicUploaderExample 4 | // 5 | // Created by Jason Zheng on 9/1/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | var mainWindowController: MainWindowController? 14 | 15 | func applicationDidFinishLaunching(_ aNotification: Notification) { 16 | 17 | let mainWindowController = MainWindowController() 18 | mainWindowController.showWindow(self) 19 | 20 | self.mainWindowController = mainWindowController 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CODE_SIGN_IDENTITY = 3 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 4 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/iPicUploader" 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 7 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/iPicUploader/iPicUploader.framework/Headers" 8 | OTHER_LDFLAGS = $(inherited) -framework "iPicUploader" 9 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 10 | PODS_BUILD_DIR = $BUILD_DIR 11 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CODE_SIGN_IDENTITY = 3 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 4 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/iPicUploader" 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 7 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/iPicUploader/iPicUploader.framework/Headers" 8 | OTHER_LDFLAGS = $(inherited) -framework "iPicUploader" 9 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 10 | PODS_BUILD_DIR = $BUILD_DIR 11 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_ROOT = ${SRCROOT}/Pods 13 | -------------------------------------------------------------------------------- /Example/Pods/iPicUploaderTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Pods/iPicUploader/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/iPicUploader/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.2.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-iPicUploaderExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Jason 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /iPicUploader/Classes/iPicImageHost.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicImageHost.swift 3 | // iPicUploadImageDemo 4 | // 5 | // Created by Jason Zheng on 12/16/16. 6 | // Copyright © 2016 Jason Zheng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class iPicImageHost: NSObject, NSCoding { 12 | public static let sharedClassName: String = "net.toolinbox.iPic.iPicImageHost" 13 | 14 | private static let idKey = "id" 15 | private static let titleKey = "title" 16 | private static let iconKey = "icon" 17 | 18 | public var id = "" 19 | public var title = "" 20 | public var icon: NSImage? 21 | 22 | // MARK: - NSCoding 23 | 24 | public required init?(coder aDecoder: NSCoder) { 25 | super.init() 26 | 27 | id = (aDecoder.decodeObject(forKey: iPicImageHost.idKey) as? String) ?? "" 28 | title = (aDecoder.decodeObject(forKey: iPicImageHost.titleKey) as? String) ?? "" 29 | icon = aDecoder.decodeObject(forKey: iPicImageHost.iconKey) as? NSImage 30 | } 31 | 32 | public func encode(with aCoder: NSCoder) { 33 | aCoder.encode(id, forKey: iPicImageHost.idKey) 34 | aCoder.encode(title, forKey: iPicImageHost.titleKey) 35 | aCoder.encode(icon, forKey: iPicImageHost.iconKey) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Example/Pods/iPicUploaderTests/iPicUploadHelperTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicUploaderTests.swift 3 | // iPicUploaderTests 4 | // 5 | // Created by Jason Zheng on 9/1/16. 6 | // 7 | // 8 | 9 | import XCTest 10 | @testable import iPicUploader 11 | 12 | class iPicUploadHelperTests: XCTestCase { 13 | 14 | func testiPic() { 15 | XCTAssertNil(iPicUploadHelper.launchiPic()) 16 | XCTAssertTrue(iPicUploadHelper.isiPicRunning()) 17 | } 18 | 19 | func test_generateiPicImage() { 20 | var image: iPicImage? 21 | var error: NSError? 22 | 23 | (image, error) = iPicUploadHelper.generateiPicImage(UTConstants.imageFilePath) 24 | XCTAssertNotNil(image) 25 | XCTAssertNil(error) 26 | 27 | let theImage = NSImage(contentsOfFile: UTConstants.imageFilePath)! 28 | (image, error) = iPicUploadHelper.generateiPicImage(theImage) 29 | XCTAssertNotNil(image) 30 | XCTAssertNil(error) 31 | 32 | let pasteboard = NSPasteboard.general() 33 | pasteboard.clearContents() 34 | let url = URL(fileURLWithPath: UTConstants.imageFilePath) 35 | pasteboard.writeObjects([url as NSPasteboardWriting]) 36 | let imageDataList = iPicUploadHelper.generateImageDataListFrom(pasteboard) 37 | XCTAssertTrue(!imageDataList.isEmpty) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Example/Pods/iPicUploaderTests/iPicImageTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicUploaderTests.swift 3 | // iPicUploaderTests 4 | // 5 | // Created by Jason Zheng on 9/1/16. 6 | // 7 | // 8 | 9 | import XCTest 10 | @testable import iPicUploader 11 | 12 | class iPicImageTests: XCTestCase { 13 | 14 | func testiPicImage() { 15 | let image1 = iPicImage(imageFilePath: UTConstants.imageFilePath) 16 | XCTAssertTrue(!image1.id.isEmpty) 17 | XCTAssertEqual(image1.version, 1) 18 | 19 | let jsonString = "{\"imageHostId\": \"ABC-123\"}" 20 | let jsonData = jsonString.data(using: String.Encoding.utf8)! 21 | let json = try? JSONSerialization.jsonObject(with: jsonData, options: .allowFragments) 22 | image1.json = json 23 | 24 | XCTAssertEqual(image1.parseImageHostId(), "ABC-123") 25 | 26 | let data = NSKeyedArchiver.archivedData(withRootObject: image1) 27 | let image2 = NSKeyedUnarchiver.unarchiveObject(with: data) as! iPicImage 28 | XCTAssertEqual(image1.id, image2.id) 29 | XCTAssertEqual(image1.imageFilePath, image2.imageFilePath) 30 | XCTAssertEqual(image1.imageData?.count, image2.imageData?.count) 31 | XCTAssertEqual(image1.version, image2.version) 32 | XCTAssertEqual(image1.json as? String, image2.json as? String) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 100 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | 32 | NSHumanReadableCopyright 33 | Copyright © 2016 CocoaPods. All rights reserved. 34 | NSMainNibFile 35 | MainMenu 36 | NSPrincipalClass 37 | NSApplication 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## iPicUploader 5 | 6 | Copyright (c) 2016 Jason 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/iPicUploader.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "iPicUploader", 3 | "version": "1.2.2", 4 | "summary": "iPicUploader could help you to upload images by iPic on macOS.", 5 | "description": "iPic could automatically upload images and save Markdown links on macOS.\n\n- Upload images by drag & drop.\n- Upload images by services with shortcut [Command + U].\n- Upload copied images with shortcut [Shift + Command + U].\n- Support Imgur, Flickr, Amazon S3 and other image hosts.\n- Support image link of Markdown format.\n\nVideo introduction: http://toolinbox.net/en/iPic/\n\nIn the same time, iPic open the ability to upload images. It means if your App also needs to upload images, you don't need to build from scratch. Just use iPicUploader, your App could also upload images to Imgur, Flickr, Amazon S3 and other image hosts.\n\niPicUploader also includes a full example. It shows how to use iPicUploader to upload images by drag and drop, by selecting image files, and by paste to upload images. You will feel easy to start.", 6 | "homepage": "https://github.com/toolinbox/iPicUploader.git", 7 | "screenshots": "https://farm9.staticflickr.com/8109/28818056193_11bb44d5e0_o.png", 8 | "license": { 9 | "type": "MIT", 10 | "file": "LICENSE" 11 | }, 12 | "authors": { 13 | "Jason": "iToolinbox@gmail.com" 14 | }, 15 | "source": { 16 | "git": "https://github.com/toolinbox/iPicUploader.git", 17 | "tag": "1.2.2" 18 | }, 19 | "social_media_url": "https://twitter.com/hereisjason", 20 | "platforms": { 21 | "osx": "10.9" 22 | }, 23 | "source_files": "iPicUploader/Classes/**/*" 24 | } 25 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "AppIcon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "AppIcon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "AppIcon_32-1.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "AppIcon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "AppIcon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "AppIcon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "AppIcon_256-1.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "AppIcon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "AppIcon_512-1.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "AppIcon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Example/Pods/iPicUploaderTests/iPicUploadResultTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicUploaderTests.swift 3 | // iPicUploaderTests 4 | // 5 | // Created by Jason Zheng on 9/1/16. 6 | // 7 | // 8 | 9 | import XCTest 10 | @testable import iPicUploader 11 | 12 | class iPicUploadResultTests: XCTestCase { 13 | 14 | func testiPicUploadResult() { 15 | let imageLink = "http://test.com/pic.jpg" 16 | let error = iPicUploadError.FailedToUpload 17 | let result1 = iPicUploadResult(imageLink: imageLink, error: error) 18 | result1.json = UUID().uuidString as AnyObject 19 | 20 | XCTAssertTrue(!result1.id.isEmpty) 21 | XCTAssertEqual(result1.version, 1) 22 | 23 | let data = NSKeyedArchiver.archivedData(withRootObject: result1) 24 | let result2 = NSKeyedUnarchiver.unarchiveObject(with: data) as! iPicUploadResult 25 | XCTAssertEqual(result1.id, result2.id) 26 | XCTAssertEqual(result1.imageLink, result2.imageLink) 27 | XCTAssertEqual(result1.error, result2.error) 28 | XCTAssertEqual(result1.version, result2.version) 29 | XCTAssertEqual(result1.json as? String, result2.json as? String) 30 | } 31 | 32 | func testiPicUploadError() { 33 | XCTAssertEqual(iPicUploadError.Unknown.code, -1) 34 | XCTAssertEqual(iPicUploadError.iPicNotInstalled.code, -11) 35 | XCTAssertEqual(iPicUploadError.iPicIncompatible.code, -12) 36 | XCTAssertEqual(iPicUploadError.FileInaccessable.code, -21) 37 | XCTAssertEqual(iPicUploadError.InvalidImageFile.code, -22) 38 | XCTAssertEqual(iPicUploadError.InvalidImageHost.code, -31) 39 | XCTAssertEqual(iPicUploadError.FailedToUpload.code, -32) 40 | XCTAssertEqual(iPicUploadError.TimeOut.code, -41) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/iPicImageView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicImageView.swift 3 | // iPicUploader 4 | // 5 | // Created by Jason Zheng on 9/2/16. 6 | // Copyright © 2016 CocoaPods. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import iPicUploader 11 | 12 | enum iPicImageViewState: String { 13 | case Normal = "NormalStateIcon" 14 | case Dragging = "DraggingStateIcon" 15 | case Uploading = "UploadingStateIcon" 16 | case Uploaded = "UploadedStateIcon" 17 | } 18 | 19 | class iPicImageView: NSImageView { 20 | 21 | var state: iPicImageViewState = .Normal { 22 | didSet { 23 | switch state { 24 | case .Normal, 25 | .Dragging, 26 | .Uploading: 27 | self.image = NSImage(named: state.rawValue) 28 | 29 | case .Uploaded: 30 | break 31 | } 32 | } 33 | } 34 | 35 | var uploadHandler: iPicUploadHandler? 36 | 37 | // MARK: - NSDraggingDestination 38 | 39 | override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation { 40 | if NSImage.canInit(with: sender.draggingPasteboard) { 41 | state = .Dragging 42 | return .copy 43 | } 44 | 45 | return NSDragOperation() 46 | } 47 | 48 | override func draggingExited(_ sender: NSDraggingInfo?) { 49 | state = .Normal 50 | } 51 | 52 | override func performDragOperation(_ sender: NSDraggingInfo) -> Bool { 53 | for imageData in iPicUploadHelper.generateImageDataListFrom(sender.draggingPasteboard) { 54 | OperationQueue.main.addOperation { 55 | self.state = .Uploading 56 | } 57 | 58 | iPic.uploadImage(imageData: imageData, handler: { (imageLink, error) in 59 | self.uploadHandler?(imageLink, error) 60 | }) 61 | } 62 | 63 | return true 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Example/Pods/iPicUploaderTests/iPicUploaderTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicUploaderTests.swift 3 | // iPicUploaderTests 4 | // 5 | // Created by Jason Zheng on 9/1/16. 6 | // 7 | // 8 | 9 | import XCTest 10 | @testable import iPicUploader 11 | 12 | class iPicUploaderTests: XCTestCase { 13 | var exception: XCTestExpectation? 14 | 15 | func testUploadImageByFilePath() { 16 | exception = expectation(description: "testUploadImageByFilePath") 17 | 18 | iPic.uploadImage(imageFilePath: UTConstants.imageFilePath) { (imageLink, error) in 19 | XCTAssertNotNil(imageLink) 20 | XCTAssertNil(error) 21 | 22 | self.exception?.fulfill() 23 | } 24 | 25 | self.waitForExpectations(timeout: UTConstants.waitTime) { (error) in 26 | XCTAssertNil(error) 27 | } 28 | } 29 | 30 | func testUploadImageByNSImage() { 31 | exception = expectation(description: "testUploadImageByNSImage") 32 | 33 | let image = NSImage(contentsOfFile: UTConstants.imageFilePath) 34 | iPic.uploadImage(image: image!) { (imageLink, error) in 35 | XCTAssertNotNil(imageLink) 36 | XCTAssertNil(error) 37 | 38 | self.exception?.fulfill() 39 | } 40 | 41 | self.waitForExpectations(timeout: UTConstants.waitTime) { (error) in 42 | XCTAssertNil(error) 43 | } 44 | } 45 | 46 | func testUploadImageByImageData() { 47 | exception = expectation(description: "testUploadImageByImageData") 48 | 49 | let imageData = try? Data(contentsOf: URL(fileURLWithPath: UTConstants.imageFilePath)) 50 | iPic.uploadImage(imageData: imageData!) { (imageLink, error) in 51 | XCTAssertNotNil(imageLink) 52 | XCTAssertNil(error) 53 | 54 | self.exception?.fulfill() 55 | } 56 | 57 | self.waitForExpectations(timeout: UTConstants.waitTime) { (error) in 58 | XCTAssertNil(error) 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /iPicUploader.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint iPicUploader.podspec' to validate before submitting. 3 | # 4 | # Podspec Syntax Reference http://guides.cocoapods.org/syntax/podspec.html 5 | # 6 | 7 | Pod::Spec.new do |s| 8 | s.name = 'iPicUploader' 9 | s.version = '1.2.2' 10 | s.summary = 'iPicUploader could help you to upload images by iPic on macOS.' 11 | s.description = <<-DESC 12 | iPic could automatically upload images and save Markdown links on macOS. 13 | 14 | - Upload images by drag & drop. 15 | - Upload images by services with shortcut [Command + U]. 16 | - Upload copied images with shortcut [Shift + Command + U]. 17 | - Support Imgur, Flickr, Amazon S3 and other image hosts. 18 | - Support image link of Markdown format. 19 | 20 | Video introduction: http://toolinbox.net/en/iPic/ 21 | 22 | In the same time, iPic open the ability to upload images. It means if your App also needs to upload images, you don't need to build from scratch. Just use iPicUploader, your App could also upload images to Imgur, Flickr, Amazon S3 and other image hosts. 23 | 24 | iPicUploader also includes a full example. It shows how to use iPicUploader to upload images by drag and drop, by selecting image files, and by paste to upload images. You will feel easy to start. 25 | DESC 26 | 27 | s.homepage = 'https://github.com/toolinbox/iPicUploader.git' 28 | s.screenshots = 'https://farm9.staticflickr.com/8109/28818056193_11bb44d5e0_o.png' 29 | s.license = { :type => 'MIT', :file => 'LICENSE' } 30 | s.author = { 'Jason' => 'iToolinbox@gmail.com' } 31 | s.source = { :git => 'https://github.com/toolinbox/iPicUploader.git', :tag => s.version.to_s } 32 | s.social_media_url = 'https://twitter.com/hereisjason' 33 | 34 | s.osx.deployment_target = "10.9" 35 | 36 | s.source_files = 'iPicUploader/Classes/**/*' 37 | end 38 | -------------------------------------------------------------------------------- /iPicUploader/Classes/iPicImage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicImage.swift 3 | // iPicUploadImageDemo 4 | // 5 | // Created by Jason Zheng on 8/31/16. 6 | // Copyright © 2016 Jason Zheng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class iPicImage: NSObject, NSCoding { 12 | public static let sharedClassName: String = "net.toolinbox.iPic.iPicImage" 13 | 14 | private static let idKey = "id" 15 | private static let imageFilePathKey = "imageFilePath" 16 | private static let imageDataKey = "imageData" 17 | 18 | private static let versionKey = "version" 19 | private static let jsonKey = "json" 20 | 21 | private static let imageHostIdKey = "imageHostId" 22 | 23 | public var id = UUID().uuidString 24 | public var imageFilePath: String? 25 | public var imageData: Data? 26 | 27 | public var version = 1 28 | public var json: Any? 29 | 30 | public var handler: iPicUploadHandler? 31 | 32 | public init(imageFilePath: String) { 33 | super.init() 34 | 35 | self.imageFilePath = imageFilePath 36 | } 37 | 38 | public init(imageData: Data) { 39 | super.init() 40 | 41 | self.imageData = imageData 42 | } 43 | 44 | // MARK: - NSCoding 45 | 46 | public required init?(coder aDecoder: NSCoder) { 47 | super.init() 48 | 49 | id = (aDecoder.decodeObject(forKey: iPicImage.idKey) as? String) ?? "" 50 | imageFilePath = aDecoder.decodeObject(forKey: iPicImage.imageFilePathKey) as? String 51 | imageData = aDecoder.decodeObject(forKey: iPicImage.imageDataKey) as? Data 52 | 53 | version = aDecoder.decodeInteger(forKey: iPicImage.versionKey) 54 | json = aDecoder.decodeObject(forKey: iPicImage.jsonKey) 55 | } 56 | 57 | public func encode(with aCoder: NSCoder) { 58 | aCoder.encode(id, forKey: iPicImage.idKey) 59 | aCoder.encode(imageFilePath, forKey: iPicImage.imageFilePathKey) 60 | aCoder.encode(imageData, forKey: iPicImage.imageDataKey) 61 | 62 | aCoder.encode(version, forKey: iPicImage.versionKey) 63 | aCoder.encode(json, forKey: iPicImage.jsonKey) 64 | } 65 | 66 | // MARK: - Public Method 67 | 68 | public func parseImageHostId() -> String? { 69 | 70 | if let json = json as? [String: Any] { 71 | return json[iPicImage.imageHostIdKey] as? String 72 | } 73 | 74 | return nil 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2016 Jason <quietjason@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | iPicUploader 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /iPicUploader/Classes/iPicUploadResult.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicUploadResult.swift 3 | // iPicUploadImageDemo 4 | // 5 | // Created by Jason Zheng on 8/31/16. 6 | // Copyright © 2016 Jason Zheng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class iPicUploadResult: NSObject, NSCoding { 12 | public static let sharedClassName: String = "net.toolinbox.iPic.iPicUploadResult" 13 | 14 | private static let idKey = "id" 15 | private static let imageLinkKey = "imageLink" 16 | private static let errorKey = "error" 17 | 18 | private static let versionKey = "version" 19 | private static let jsonKey = "json" 20 | 21 | public var id = UUID().uuidString 22 | public var imageLink: String? 23 | public var error: NSError? 24 | 25 | public var version = 1 26 | public var json: Any? 27 | 28 | public init(imageLink: String?, error: NSError?) { 29 | super.init() 30 | 31 | self.imageLink = imageLink 32 | self.error = error 33 | } 34 | 35 | // MARK: - NSCoding 36 | 37 | public required init?(coder aDecoder: NSCoder) { 38 | super.init() 39 | 40 | id = (aDecoder.decodeObject(forKey: iPicUploadResult.idKey) as? String) ?? "" 41 | imageLink = aDecoder.decodeObject(forKey: iPicUploadResult.imageLinkKey) as? String 42 | error = aDecoder.decodeObject(forKey: iPicUploadResult.errorKey) as? NSError 43 | 44 | version = aDecoder.decodeInteger(forKey: iPicUploadResult.versionKey) 45 | json = aDecoder.decodeObject(forKey: iPicUploadResult.jsonKey) 46 | } 47 | 48 | public func encode(with aCoder: NSCoder) { 49 | aCoder.encode(id, forKey: iPicUploadResult.idKey) 50 | aCoder.encode(imageLink, forKey: iPicUploadResult.imageLinkKey) 51 | aCoder.encode(error, forKey: iPicUploadResult.errorKey) 52 | 53 | aCoder.encode(version, forKey: iPicUploadResult.versionKey) 54 | aCoder.encode(json, forKey: iPicUploadResult.jsonKey) 55 | } 56 | } 57 | 58 | @objc public class iPicUploadError: NSObject { 59 | 60 | public static let Unknown = iPicUploadError.create(-1, "Unknown error.") 61 | public static let iPicNotInstalled = iPicUploadError.create(-11, "iPic wasn't installed.") 62 | public static let iPicIncompatible = iPicUploadError.create(-12, "iPic isn't compatible.") 63 | public static let macOSIncompatible = iPicUploadError.create(-13, "macOS isn't compatible.") 64 | public static let FileInaccessable = iPicUploadError.create(-21, "The file isn't accessable.") 65 | public static let InvalidImageFile = iPicUploadError.create(-22, "Invalid image file.") 66 | public static let InvalidImageHost = iPicUploadError.create(-31, "Invalid image host.") 67 | public static let FailedToUpload = iPicUploadError.create(-32, "Failed to upload.") 68 | public static let ImageHostNotFound = iPicUploadError.create(-33, "Image host not found.") 69 | public static let TimeOut = iPicUploadError.create(-41, "Time out.") 70 | 71 | private static let iPicUploaderDomain = "net.toolinbox.ipic.uploader" 72 | 73 | private static func create(_ code: Int, _ description: String) -> NSError { 74 | return NSError(domain: iPicUploaderDomain, code: code, userInfo: [NSLocalizedDescriptionKey: description]) 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "$BUILT_PRODUCTS_DIR/iPicUploader/iPicUploader.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "$BUILT_PRODUCTS_DIR/iPicUploader/iPicUploader.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iPic 2 | 3 | ![](https://farm8.staticflickr.com/7322/28018346695_f1461c7a09_o.jpg) 4 | 5 | iPic could automatically upload images and save Markdown links on macOS. 6 | 7 | - Upload images by drag & drop. 8 | - Upload images by services with shortcut `Command + U`. 9 | - Upload copied images with shortcut `Shift + Command + U`. 10 | - Support Imgur, Flickr, Amazon S3 and other image hosts. 11 | - Support image link of Markdown format. 12 | - [Video introduction](http://toolinbox.net/en/iPic/) 13 | 14 | [Download iPic](https://itunes.apple.com/app/id1101244278?ls=1&mt=12) and have a try. 15 | 16 | # iPicUploader 17 | 18 | iPic opens the ability to upload images. It means if your App also needs to upload images, no need to build from scratch. Just use iPicUploader, your App could also upload images to Imgur, Flickr, Amazon S3 and other image hosts. 19 | 20 | ## iPicUploader Usage 21 | 22 | Upload image file: 23 | 24 | ```swift 25 | let imageFilePath = "/Path/to/the/pic.jpg" 26 | 27 | iPic.uploadImage(imageFilePath, handler: { (imageLink, error) in 28 | if let imageLink = imageLink { 29 | // Image uploaded 30 | 31 | } else if let error = error { 32 | // Some error happened 33 | } 34 | }) 35 | ``` 36 | 37 | Upload image data: 38 | 39 | ```swift 40 | let imageFilePath = "/Path/to/the/pic.jpg" 41 | let imageURL = URL(fileURLWithPath: imageFilePath) 42 | let imageData = try! Data(contentsOf: imageURL) 43 | 44 | iPic.uploadImage(imageData, handler: { (imageLink, error) in 45 | if let imageLink = imageLink { 46 | // Image uploaded 47 | 48 | } else if let error = error { 49 | // Some error happened 50 | } 51 | }) 52 | 53 | ``` 54 | 55 | Upload NSImage: 56 | 57 | ```swift 58 | let imageFilePath = "/Path/to/the/pic.jpg" 59 | let image = NSImage(contentsOfFile: imageFilePath) 60 | 61 | iPic.uploadImage(image, handler: { (imageLink, error) in 62 | if let imageLink = imageLink { 63 | // Image uploaded 64 | 65 | } else if let error = error { 66 | // Some error happened 67 | } 68 | }) 69 | 70 | ``` 71 | 72 | 73 | ## iPicUploader Example 74 | 75 | iPicUploader also includes a full example. You will feel easy to start. To run the example project, just clone current repository and open *iPicUploader.xcworkspace*. 76 | 77 | Note: 78 | 79 | - As the demo needs to upload images by iPic, you need to [download iPic](https://itunes.apple.com/app/id1101244278?ls=1&mt=12) at first. 80 | - No worry, you will also be guided to download iPic in the example. 81 | - The example already dealt with these cases: 82 | - If iPic wasn't installed, guide user to download. 83 | - If iPic wasn't running, launch iPic automatically. 84 | - If iPic is running but not compatible, guide user to download latest version. 85 | 86 | Now, let's have a look how the example upload images. 87 | 88 | ### 1. Upload Images by Drag & Drop 89 | 90 | ![](https://farm9.staticflickr.com/8085/29362952261_29d4282e7d_o.gif) 91 | 92 | As you can see, iPicUploader supports upload of multiple images at a time. 93 | 94 | ### 2. Upload Images by Select Images Files 95 | 96 | ![](https://farm9.staticflickr.com/8437/29408369616_bd961fc777_o.gif) 97 | 98 | ### 3. Upload Images by Copy Image and Paste 99 | 100 | ![](https://farm9.staticflickr.com/8533/29408372976_7b39f9898f_o.gif) 101 | 102 | Beside copy image files, you can also copy the image in other Apps to upload. 103 | 104 | 105 | # Apps Using iPicUploader 106 | 107 | It would be great to show your apps using iPicUploader here. Pull requests welcome :) 108 | 109 | - [Typora](http://www.typora.io/) 110 | 111 | ## Requirements 112 | 113 | As iPic runs on macOS 10.11 and newer version, iPicUploader also needs macOS 10.11+ 114 | 115 | ## Installation 116 | 117 | iPicUploader is available through [CocoaPods](http://cocoapods.org). To install 118 | it, simply add the following line to your Podfile: 119 | 120 | ```ruby 121 | pod "iPicUploader" 122 | ``` 123 | 124 | ## License 125 | 126 | iPicUploader is available under the MIT license. 127 | 128 | 129 | -------------------------------------------------------------------------------- /iPicUploader/Classes/iPicUploadHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicUploadHelper.swift 3 | // iPicUploadImageDemo 4 | // 5 | // Created by Jason Zheng on 8/31/16. 6 | // Copyright © 2016 Jason Zheng. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | public class iPicUploadHelper { 12 | private static let iPicBundleIdentifier = "net.toolinbox.ipic" 13 | private static let iPicURLScheme = "ipic://" 14 | 15 | // MARK: Static Method 16 | 17 | internal static func ismacOSCompatible() -> Bool { 18 | if #available(OSX 10.11, *) { 19 | return true 20 | } else { 21 | return false 22 | } 23 | } 24 | 25 | internal static func isiPicRunning() -> Bool { 26 | return !NSRunningApplication.runningApplications(withBundleIdentifier: iPicBundleIdentifier).isEmpty 27 | } 28 | 29 | internal static func launchiPic() -> NSError? { 30 | guard #available(OSX 10.11, *) else { 31 | return iPicUploadError.macOSIncompatible 32 | } 33 | 34 | guard !isiPicRunning() else { 35 | return nil 36 | } 37 | 38 | do { 39 | let schemeURL = URL(string: iPicURLScheme)! 40 | try NSWorkspace.shared.open(schemeURL, options: .withoutActivation, configuration: [:]) 41 | return nil 42 | } catch { 43 | return iPicUploadError.iPicNotInstalled 44 | } 45 | } 46 | 47 | public static func generateiPicImage(_ imageFilePath: String) -> (iPicImage?, NSError?) { 48 | guard let data = try? Data(contentsOf: URL(fileURLWithPath: imageFilePath)) else { 49 | return (nil, iPicUploadError.FileInaccessable) 50 | } 51 | 52 | guard let _ = NSImage(data: data) else { 53 | return (nil, iPicUploadError.InvalidImageFile) 54 | } 55 | 56 | let image = iPicImage(imageFilePath: imageFilePath) 57 | image.imageData = data 58 | 59 | return (image, nil) 60 | } 61 | 62 | public static func generateiPicImage(_ image: NSImage) -> (iPicImage?, NSError?) { 63 | guard let imageData = imageDataOf(image, type: .jpeg) else { 64 | return (nil, iPicUploadError.Unknown) // Should not happen 65 | } 66 | 67 | let image = iPicImage(imageData: imageData) 68 | 69 | return (image, nil) 70 | } 71 | 72 | public static func generateImageDataListFrom(_ pasteboard: NSPasteboard) -> [Data] { 73 | var imageDataList = [Data]() 74 | 75 | if let pasteboardItems = pasteboard.pasteboardItems { 76 | for pasteboardItem in pasteboardItems { 77 | if let imageData = generateImageDataFrom(pasteboardItem) { 78 | imageDataList.append(imageData) 79 | } 80 | } 81 | } 82 | 83 | return imageDataList 84 | } 85 | 86 | private static func generateImageDataFrom(_ pasteboardItem: NSPasteboardItem) -> Data? { 87 | guard #available(OSX 10.11, *) else { 88 | return nil 89 | } 90 | 91 | for type in pasteboardItem.types { 92 | if let data = pasteboardItem.data(forType: type) { 93 | if type.rawValue == String(kUTTypeFileURL) { 94 | if let url = URL(dataRepresentation: data, relativeTo: nil), 95 | let imageData = try? Data(contentsOf: url), 96 | let _ = NSImage(data: imageData) { 97 | return imageData 98 | } 99 | 100 | } else if let _ = NSImage(data: data) { 101 | return data 102 | } 103 | } 104 | } 105 | 106 | return nil 107 | } 108 | 109 | internal static func imageDataOf(_ image: NSImage, type: NSBitmapImageRep.FileType) -> Data? { 110 | guard let imageData = image.tiffRepresentation else { 111 | return nil 112 | } 113 | 114 | if type == NSBitmapImageRep.FileType.tiff { 115 | return imageData 116 | } 117 | 118 | guard let imageRep = NSBitmapImageRep(data: imageData) else { 119 | return nil 120 | } 121 | 122 | return imageRep.representation(using: type, properties: [:]) 123 | } 124 | 125 | internal static func delay(_ delay:Double, closure:@escaping ()->()) { 126 | DispatchQueue.main.asyncAfter( 127 | deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: closure) 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/MainWindowController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowController.swift 3 | // iPicUploadImageDemo 4 | // 5 | // Created by Jason Zheng on 8/31/16. 6 | // Copyright © 2016 Jason Zheng. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import iPicUploader 11 | 12 | class MainWindowController: NSWindowController { 13 | 14 | @IBOutlet weak var imageView: iPicImageView! 15 | @IBOutlet var resultTextView: NSTextView! 16 | 17 | var uploadedIndex = 0 18 | 19 | override var windowNibName: String? { 20 | return "MainWindowController" 21 | } 22 | 23 | override func windowDidLoad() { 24 | super.windowDidLoad() 25 | 26 | imageView.state = .Normal 27 | imageView.uploadHandler = uploadHandler 28 | 29 | let attrString = NSAttributedString(string: NSLocalizedString("Image Links:", comment: "Title")) 30 | resultTextView.textStorage?.append(attrString) 31 | } 32 | 33 | // MARK: Action 34 | 35 | @IBAction func selectImageFiles(_ sender: NSButton!) { 36 | let openPanel = NSOpenPanel() 37 | openPanel.canChooseDirectories = false 38 | openPanel.canChooseFiles = true 39 | openPanel.allowsMultipleSelection = true 40 | openPanel.prompt = NSLocalizedString("Select", comment: "Open Panel") 41 | 42 | openPanel.beginSheetModal(for: self.window!) { (response) in 43 | if response.rawValue == NSFileHandlingPanelOKButton { 44 | for url in openPanel.urls { 45 | OperationQueue.main.addOperation { 46 | self.imageView.state = .Uploading 47 | } 48 | iPic.uploadImage(imageFilePath: url.path, handler: self.uploadHandler) 49 | } 50 | } 51 | } 52 | } 53 | 54 | @IBAction func pasteImages(_ sender: NSButton!) { 55 | let imageList = iPicUploadHelper.generateImageDataListFrom(NSPasteboard.general) 56 | guard !imageList.isEmpty else { 57 | let message = NSLocalizedString("Failed to Upload", comment: "Title") 58 | let information = "No image in pasteboard." 59 | self.showAlert(message, information: information) 60 | 61 | return 62 | } 63 | 64 | for imageData in imageList { 65 | self.imageView.state = .Uploading 66 | iPic.uploadImage(imageData: imageData, handler: uploadHandler) 67 | } 68 | } 69 | 70 | // MARK: Helper 71 | 72 | fileprivate func uploadHandler(_ imageLink: String?, error: NSError?) { 73 | OperationQueue.main.addOperation { 74 | if let imageLink = imageLink { 75 | self.imageView.state = .Uploaded 76 | if let imageURL = URL(string: imageLink) { 77 | self.imageView.image = NSImage(contentsOf: imageURL) 78 | } 79 | 80 | self.appendLink(imageLink) 81 | 82 | } else if let error = error { 83 | self.imageView.state = .Normal 84 | 85 | let message = NSLocalizedString("Failed to Upload", comment: "Title") 86 | let information = error.localizedDescription 87 | 88 | if error == iPicUploadError.iPicNotInstalled || error == iPicUploadError.iPicIncompatible { 89 | let alert = NSAlert() 90 | alert.messageText = message 91 | alert.informativeText = information 92 | 93 | alert.addButton(withTitle: NSLocalizedString("Download iPic", comment: "Title")) 94 | alert.addButton(withTitle: NSLocalizedString("Cancel", comment: "Title")) 95 | 96 | alert.beginSheetModal(for: self.window!, completionHandler: { (response) in 97 | if response == NSApplication.ModalResponse.alertFirstButtonReturn { 98 | if let url = URL(string: iPic.iPicDownloadLink) { 99 | NSWorkspace.shared.open(url) 100 | } 101 | } 102 | }) 103 | } else { 104 | self.showAlert(message, information: information) 105 | } 106 | } 107 | } 108 | } 109 | 110 | fileprivate func appendLink(_ link: String) { 111 | let fontAttr = [NSAttributedString.Key.font: NSFont.systemFont(ofSize: NSFont.systemFontSize - 2)] 112 | let resultStr = NSMutableAttributedString(string: link, attributes: fontAttr) 113 | let attrs = [NSAttributedString.Key.link: NSString(string: link)] 114 | resultStr.addAttributes(attrs, range: NSRange(0.. "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | install_resource() 27 | { 28 | if [[ "$1" = /* ]] ; then 29 | RESOURCE_PATH="$1" 30 | else 31 | RESOURCE_PATH="${PODS_ROOT}/$1" 32 | fi 33 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 34 | cat << EOM 35 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 36 | EOM 37 | exit 1 38 | fi 39 | case $RESOURCE_PATH in 40 | *.storyboard) 41 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 42 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 43 | ;; 44 | *.xib) 45 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 46 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 47 | ;; 48 | *.framework) 49 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 50 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 51 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 52 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 53 | ;; 54 | *.xcdatamodel) 55 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 56 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 57 | ;; 58 | *.xcdatamodeld) 59 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 60 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 61 | ;; 62 | *.xcmappingmodel) 63 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 64 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 65 | ;; 66 | *.xcassets) 67 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 68 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 69 | ;; 70 | *) 71 | echo "$RESOURCE_PATH" 72 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 73 | ;; 74 | esac 75 | } 76 | 77 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 78 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 79 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 80 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 81 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 82 | fi 83 | rm -f "$RESOURCES_TO_COPY" 84 | 85 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 86 | then 87 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 88 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 89 | while read line; do 90 | if [[ $line != "${PODS_ROOT}*" ]]; then 91 | XCASSET_FILES+=("$line") 92 | fi 93 | done <<<"$OTHER_XCASSETS" 94 | 95 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | fi 97 | -------------------------------------------------------------------------------- /iPicUploader/Classes/iPicPasteboardHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicPasteboardHelper.swift 3 | // iPic 4 | // 5 | // Created by Jason Zheng on 8/19/16. 6 | // Copyright © 2016 Jason Zheng. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | internal typealias iPicPasteboardHandler = ((NSPasteboard) -> Void) 12 | 13 | public let iPicPasteboardName = "net.toolinbox.ipic.pasteboard" 14 | public let PasteboardTypeiPicImage = "net.toolinbox.ipic.pasteboard.iPicImage" 15 | public let PasteboardTypeiPicUploadResult = "net.toolinbox.ipic.pasteboard.iPicUploadResult" 16 | public let PasteboardTypeiPicUploaderVersion = "net.toolinbox.ipic.pasteboard.iPicUploaderVersion" 17 | public let PasteboardTypeiPicUploaderVersionResult = "net.toolinbox.ipic.pasteboard.iPicUploaderVersionResult" 18 | public let PasteboardTypeImageHostList = "net.toolinbox.ipic.pasteboard.PasteboardTypeImageHostList" 19 | public let PasteboardTypeImageHostListResult = "net.toolinbox.ipic.pasteboard.PasteboardTypeImageHostListResult" 20 | 21 | internal let iPicPasteboard = iPicPasteboardHelper.sharedInstance 22 | 23 | internal class iPicPasteboardHelper { 24 | // Singleton 25 | internal static let sharedInstance = iPicPasteboardHelper() 26 | private init() {} 27 | 28 | private let pasteboard = NSPasteboard(name: NSPasteboard.Name(rawValue: iPicPasteboardName)) 29 | 30 | private weak var pasteboardObservingTimer: Timer? 31 | private var pasteboardObservingTimerInterval: TimeInterval = 0.75 32 | private var pasteboardChangedCount = 0 33 | 34 | internal var handler: iPicPasteboardHandler? 35 | 36 | // MARK: Internal Method 37 | 38 | internal func startObserving() { 39 | guard pasteboardObservingTimer == nil else { 40 | return 41 | } 42 | 43 | pasteboardObservingTimer = Timer.scheduledTimer( 44 | timeInterval: pasteboardObservingTimerInterval, 45 | target: self, 46 | selector: #selector(iPicPasteboardHelper.observePasteboard), 47 | userInfo: nil, 48 | repeats: true) 49 | pasteboardObservingTimer?.tolerance = pasteboardObservingTimerInterval * 0.3 50 | pasteboardObservingTimer?.fire() 51 | } 52 | 53 | internal func stopObserving() { 54 | pasteboardObservingTimer?.invalidate() 55 | pasteboardObservingTimer = nil 56 | } 57 | 58 | @discardableResult internal func writeiPicImage(_ image: iPicImage) -> Bool { 59 | clearPasteboardContents() 60 | 61 | let pasteboardItem = parseiPicImageToPasteboardItem(image) 62 | return pasteboard.writeObjects([pasteboardItem]) 63 | } 64 | 65 | @discardableResult internal func writeiPicUploaderVersionRequest() -> Bool { 66 | return writeString("", type: PasteboardTypeiPicUploaderVersion) 67 | } 68 | 69 | @discardableResult internal func writeImageHostListRequest() -> Bool { 70 | return writeString("", type: PasteboardTypeImageHostList) 71 | } 72 | 73 | internal func parseUploadResult(_ pasteboard: NSPasteboard) -> iPicUploadResult? { 74 | if let type = pasteboard.availableType(from: [NSPasteboard.PasteboardType(rawValue: PasteboardTypeiPicUploadResult)]) { 75 | if let data = pasteboard.data(forType: type) { 76 | NSKeyedUnarchiver.setClass(iPicUploadResult.self, forClassName: iPicUploadResult.sharedClassName) 77 | return NSKeyedUnarchiver.unarchiveObject(with: data) as? iPicUploadResult 78 | } 79 | } 80 | 81 | return nil 82 | } 83 | 84 | internal func parseiPicUploaderVersionResult(_ pasteboard: NSPasteboard) -> Int? { 85 | if let versionString = pasteboard.string(forType: NSPasteboard.PasteboardType(rawValue: PasteboardTypeiPicUploaderVersionResult)) { 86 | return Int(versionString) 87 | } 88 | 89 | return nil 90 | } 91 | 92 | internal func parseImageHostListResult(_ pasteboard: NSPasteboard) -> [iPicImageHost] { 93 | var imageHostList = [iPicImageHost]() 94 | 95 | if let type = pasteboard.availableType(from: [NSPasteboard.PasteboardType(rawValue: PasteboardTypeImageHostListResult)]) { 96 | if let data = pasteboard.data(forType: type) { 97 | NSKeyedUnarchiver.setClass(iPicImageHost.self, forClassName: iPicImageHost.sharedClassName) 98 | 99 | if let list = NSKeyedUnarchiver.unarchiveObject(with: data) as? [iPicImageHost] { 100 | imageHostList = list 101 | } 102 | } 103 | } 104 | 105 | return imageHostList 106 | } 107 | 108 | // MARK: Helper 109 | 110 | @objc private func observePasteboard() { 111 | let count = pasteboard.changeCount 112 | if pasteboardChangedCount < count { 113 | pasteboardChangedCount = count 114 | 115 | handler?(pasteboard) 116 | } 117 | } 118 | 119 | private func parseiPicImageToPasteboardItem(_ image: iPicImage) -> NSPasteboardItem { 120 | let pasteboardItem = NSPasteboardItem() 121 | 122 | NSKeyedArchiver.setClassName(iPicImage.sharedClassName, for: iPicImage.self) 123 | let data = NSKeyedArchiver.archivedData(withRootObject: image) 124 | pasteboardItem.setData(data, forType: NSPasteboard.PasteboardType(rawValue: PasteboardTypeiPicImage)) 125 | 126 | return pasteboardItem 127 | } 128 | 129 | private func writeString(_ str: String, type: String) -> Bool { 130 | clearPasteboardContents() 131 | 132 | let pasteboardItem = NSPasteboardItem() 133 | pasteboardItem.setString(str, forType: NSPasteboard.PasteboardType(rawValue: type)) 134 | 135 | return pasteboard.writeObjects([pasteboardItem]) 136 | } 137 | 138 | private func clearPasteboardContents() { 139 | pasteboard.clearContents() 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /iPicUploader/Classes/iPicUploader.swift: -------------------------------------------------------------------------------- 1 | // 2 | // iPicUploader.swift 3 | // iPicUploadImageDemo 4 | // 5 | // Created by Jason Zheng on 8/31/16. 6 | // Copyright © 2016 Jason Zheng. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | public let iPic = iPicUploader.sharedInstance 12 | 13 | public typealias iPicUploadHandler = (_ imageLink: String?, _ error: NSError?) -> () 14 | 15 | @objc public class iPicUploader: NSObject { 16 | // Singleton 17 | internal static let sharedInstance = iPicUploader() 18 | private override init() { 19 | super.init() 20 | 21 | iPicPasteboard.handler = dealWithUploadResult 22 | } 23 | 24 | public let version = 1 25 | private var versionIniPic: Int? 26 | 27 | private var pendingImages = [String: iPicImage]() 28 | private let pendingImagesLocker = NSRecursiveLock() 29 | 30 | private let uploadTimeoutSeconds: TimeInterval = 30 31 | private let requestVersionTimeoutSeconds: TimeInterval = 2 32 | 33 | public let iPicDownloadLink = "macappstore://itunes.apple.com/app/id1101244278" 34 | 35 | // MARK: Public Method 36 | 37 | /* Validate if macOS is compatible and iPic is installed. Launch iPic if both are yes. */ 38 | public func validate() -> NSError? { 39 | if !iPicUploadHelper.ismacOSCompatible() { 40 | return iPicUploadError.macOSIncompatible 41 | } 42 | 43 | return iPicUploadHelper.launchiPic() 44 | } 45 | 46 | public func uploadImage(imageFilePath: String, handler: @escaping iPicUploadHandler) { 47 | 48 | let (theImage, error) = iPicUploadHelper.generateiPicImage(imageFilePath) 49 | guard let image = theImage else { 50 | handler(nil, error) 51 | return 52 | } 53 | 54 | doUploadImage(image, handler: handler) 55 | } 56 | 57 | public func uploadImage(image: NSImage, handler: @escaping iPicUploadHandler) { 58 | 59 | let (theImage, error) = iPicUploadHelper.generateiPicImage(image) 60 | guard let image = theImage else { 61 | handler(nil, error) 62 | return 63 | } 64 | 65 | doUploadImage(image, handler: handler) 66 | } 67 | 68 | public func uploadImage(imageData: Data, handler: @escaping iPicUploadHandler) { 69 | let image = iPicImage(imageData: imageData) 70 | doUploadImage(image, handler: handler) 71 | } 72 | 73 | // MARK: Helper 74 | 75 | private func doUploadImage(_ image: iPicImage, handler: @escaping iPicUploadHandler) { 76 | 77 | // Validate and launch iPic. 78 | if let error = validate() { 79 | handler(nil, error) 80 | return 81 | } 82 | 83 | // Store iPicImage with its handler. 84 | image.handler = handler 85 | lock { 86 | self.pendingImages[image.id] = image 87 | } 88 | 89 | // Start observing pasteboard. 90 | iPicPasteboard.startObserving() 91 | 92 | // Check iPicUploader version in iPic 93 | if let versionIniPic = versionIniPic { 94 | doUploadImage(image, handler: handler, versionIniPic: versionIniPic) 95 | 96 | } else { 97 | // Request iPicUploader version in iPic 98 | requestiPicUploaderVersionIniPic() 99 | 100 | // Remove iPicImage after timeout. 101 | iPicUploadHelper.delay(requestVersionTimeoutSeconds) { 102 | if let versionIniPic = self.versionIniPic { 103 | self.doUploadImage(image, handler: handler, versionIniPic: versionIniPic) 104 | 105 | } else { 106 | self.finishUploadImage(image.id, error: iPicUploadError.iPicIncompatible) 107 | } 108 | } 109 | } 110 | } 111 | 112 | private func doUploadImage(_ image: iPicImage, handler: iPicUploadHandler, versionIniPic: Int) { 113 | if versionIniPic >= version { 114 | // Start upload. 115 | uploadPendingImages() 116 | 117 | // Remove iPicImage after timeout. 118 | iPicUploadHelper.delay(uploadTimeoutSeconds) { 119 | self.finishUploadImage(image.id, error: iPicUploadError.TimeOut) 120 | } 121 | 122 | } else { 123 | self.finishUploadImage(image.id, error: iPicUploadError.iPicIncompatible) 124 | } 125 | } 126 | 127 | private func uploadPendingImages() { 128 | var image: iPicImage? 129 | 130 | lock { 131 | if let (_, pendingImage) = self.pendingImages.first { 132 | image = pendingImage 133 | } 134 | } 135 | 136 | if let image = image { 137 | iPicPasteboard.writeiPicImage(image) 138 | } 139 | } 140 | 141 | private func finishUploadImage(_ id: String, error: NSError) { 142 | let uploadResult = iPicUploadResult(imageLink: nil, error: error) 143 | uploadResult.id = id 144 | finishUploadImage(uploadResult) 145 | } 146 | 147 | private func finishUploadImage(_ uploadResult: iPicUploadResult) { 148 | var image: iPicImage? 149 | 150 | lock { 151 | image = self.pendingImages[uploadResult.id] 152 | self.pendingImages[uploadResult.id] = nil 153 | 154 | if self.pendingImages.isEmpty { 155 | iPicPasteboard.stopObserving() 156 | } 157 | } 158 | 159 | // Callback the handler. 160 | image?.handler?(uploadResult.imageLink, uploadResult.error) 161 | 162 | // Continue to upload other pending images. 163 | uploadPendingImages() 164 | } 165 | 166 | private func dealWithUploadResult(_ pasteboard: NSPasteboard) { 167 | if let uploadResult = iPicPasteboard.parseUploadResult(pasteboard) { 168 | finishUploadImage(uploadResult) 169 | } else if let version = iPicPasteboard.parseiPicUploaderVersionResult(pasteboard) { 170 | versionIniPic = version 171 | } 172 | } 173 | 174 | private func requestiPicUploaderVersionIniPic() { 175 | iPicPasteboard.writeiPicUploaderVersionRequest() 176 | } 177 | 178 | private func lock(_ closure:()->()) { 179 | pendingImagesLocker.lock() 180 | closure() 181 | pendingImagesLocker.unlock() 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/MainWindowController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 53 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 89 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /Example/iPicUploader.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 472FEE059EC9679BEA6D0D8D /* Pods_iPicUploaderExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A774072AA871C7B3C4A7EA04 /* Pods_iPicUploaderExample.framework */; }; 11 | 96402E371D79629B008E5256 /* Pods_iPicUploaderExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96402E361D79629B008E5256 /* Pods_iPicUploaderExample.framework */; }; 12 | 967DD9871D7BCAC800844689 /* iPicImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 967DD9861D7BCAC800844689 /* iPicImageView.swift */; }; 13 | 968A23EE1D7812B30024A923 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968A23ED1D7812B30024A923 /* AppDelegate.swift */; }; 14 | 968A23F01D7812B30024A923 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 968A23EF1D7812B30024A923 /* Assets.xcassets */; }; 15 | 968A23F31D7812B30024A923 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 968A23F11D7812B30024A923 /* MainMenu.xib */; }; 16 | 968A23FA1D7813470024A923 /* MainWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968A23F81D7813470024A923 /* MainWindowController.swift */; }; 17 | 968A23FB1D7813470024A923 /* MainWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 968A23F91D7813470024A923 /* MainWindowController.xib */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 0DA43568D10A5CF646121DFC /* iPicUploader.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = iPicUploader.podspec; path = ../iPicUploader.podspec; sourceTree = ""; }; 22 | 41B69D21F86BAD4FC9B0207C /* Pods-iPicUploader_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iPicUploader_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-iPicUploader_Tests/Pods-iPicUploader_Tests.release.xcconfig"; sourceTree = ""; }; 23 | 52DEF03819EB113379CEC352 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 24 | 5DEAC66BA4EE5B8F92151772 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 25 | 602ED34BF9D06E5D4C48D645 /* Pods-iPicUploaderExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iPicUploaderExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample.debug.xcconfig"; sourceTree = ""; }; 26 | 7713B8BC4B035FAADBF02F93 /* Pods-iPicUploaderExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iPicUploaderExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample.release.xcconfig"; sourceTree = ""; }; 27 | 8DC419D392221451B9803D18 /* Pods_iPicUploader_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iPicUploader_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 96402E311D796280008E5256 /* iPicUploader.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iPicUploader.framework; path = "../../../../../../BigData/XCode/DerivedData/iPicUploader-bfkiawblvsvrpxfhpmpcrdctabuu/Build/Products/Debug/iPicUploader/iPicUploader.framework"; sourceTree = ""; }; 29 | 96402E361D79629B008E5256 /* Pods_iPicUploaderExample.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Pods_iPicUploaderExample.framework; path = "../../../../../../BigData/XCode/DerivedData/iPicUploader-bfkiawblvsvrpxfhpmpcrdctabuu/Build/Products/Debug/Pods_iPicUploaderExample.framework"; sourceTree = ""; }; 30 | 967DD9301D7ACD2E00844689 /* iPicUploaderExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = iPicUploaderExample.entitlements; sourceTree = ""; }; 31 | 967DD9861D7BCAC800844689 /* iPicImageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = iPicImageView.swift; sourceTree = ""; }; 32 | 968A23EB1D7812B30024A923 /* iPicUploaderExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iPicUploaderExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 968A23ED1D7812B30024A923 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 34 | 968A23EF1D7812B30024A923 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 35 | 968A23F21D7812B30024A923 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 36 | 968A23F41D7812B30024A923 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | 968A23F81D7813470024A923 /* MainWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainWindowController.swift; sourceTree = ""; }; 38 | 968A23F91D7813470024A923 /* MainWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindowController.xib; sourceTree = ""; }; 39 | 968A24061D7819C70024A923 /* iPicUploader.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iPicUploader.framework; path = "Pods/../build/Debug-iphoneos/iPicUploader/iPicUploader.framework"; sourceTree = ""; }; 40 | 968A243F1D7822F90024A923 /* Pods_iPicUploaderExample.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Pods_iPicUploaderExample.framework; path = Pods/../build/Debug/Pods_iPicUploaderExample.framework; sourceTree = ""; }; 41 | A774072AA871C7B3C4A7EA04 /* Pods_iPicUploaderExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iPicUploaderExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | FD98DCBCCB7F276E6F7DFBB4 /* Pods-iPicUploader_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iPicUploader_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-iPicUploader_Tests/Pods-iPicUploader_Tests.debug.xcconfig"; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 968A23E81D7812B30024A923 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | 96402E371D79629B008E5256 /* Pods_iPicUploaderExample.framework in Frameworks */, 51 | 472FEE059EC9679BEA6D0D8D /* Pods_iPicUploaderExample.framework in Frameworks */, 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 607FACC71AFB9204008FA782 = { 59 | isa = PBXGroup; 60 | children = ( 61 | 968A23EC1D7812B30024A923 /* iPicUploaderExample */, 62 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 63 | 607FACD11AFB9204008FA782 /* Products */, 64 | B3E1EF5DE2959120977B5C0D /* Pods */, 65 | A323D05D5D9A451A99A62C33 /* Frameworks */, 66 | ); 67 | sourceTree = ""; 68 | }; 69 | 607FACD11AFB9204008FA782 /* Products */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 968A23EB1D7812B30024A923 /* iPicUploaderExample.app */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 0DA43568D10A5CF646121DFC /* iPicUploader.podspec */, 81 | 5DEAC66BA4EE5B8F92151772 /* README.md */, 82 | 52DEF03819EB113379CEC352 /* LICENSE */, 83 | ); 84 | name = "Podspec Metadata"; 85 | sourceTree = ""; 86 | }; 87 | 967DD9311D7ACEB600844689 /* Resources */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 968A23EF1D7812B30024A923 /* Assets.xcassets */, 91 | 968A23F11D7812B30024A923 /* MainMenu.xib */, 92 | 968A23F41D7812B30024A923 /* Info.plist */, 93 | 967DD9301D7ACD2E00844689 /* iPicUploaderExample.entitlements */, 94 | ); 95 | name = Resources; 96 | sourceTree = ""; 97 | }; 98 | 968A23EC1D7812B30024A923 /* iPicUploaderExample */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 967DD9861D7BCAC800844689 /* iPicImageView.swift */, 102 | 968A23F81D7813470024A923 /* MainWindowController.swift */, 103 | 968A23F91D7813470024A923 /* MainWindowController.xib */, 104 | 968A23ED1D7812B30024A923 /* AppDelegate.swift */, 105 | 967DD9311D7ACEB600844689 /* Resources */, 106 | ); 107 | path = iPicUploaderExample; 108 | sourceTree = ""; 109 | }; 110 | A323D05D5D9A451A99A62C33 /* Frameworks */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 96402E361D79629B008E5256 /* Pods_iPicUploaderExample.framework */, 114 | 96402E311D796280008E5256 /* iPicUploader.framework */, 115 | 968A243F1D7822F90024A923 /* Pods_iPicUploaderExample.framework */, 116 | 968A24061D7819C70024A923 /* iPicUploader.framework */, 117 | 8DC419D392221451B9803D18 /* Pods_iPicUploader_Tests.framework */, 118 | A774072AA871C7B3C4A7EA04 /* Pods_iPicUploaderExample.framework */, 119 | ); 120 | name = Frameworks; 121 | sourceTree = ""; 122 | }; 123 | B3E1EF5DE2959120977B5C0D /* Pods */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | FD98DCBCCB7F276E6F7DFBB4 /* Pods-iPicUploader_Tests.debug.xcconfig */, 127 | 41B69D21F86BAD4FC9B0207C /* Pods-iPicUploader_Tests.release.xcconfig */, 128 | 602ED34BF9D06E5D4C48D645 /* Pods-iPicUploaderExample.debug.xcconfig */, 129 | 7713B8BC4B035FAADBF02F93 /* Pods-iPicUploaderExample.release.xcconfig */, 130 | ); 131 | name = Pods; 132 | sourceTree = ""; 133 | }; 134 | /* End PBXGroup section */ 135 | 136 | /* Begin PBXNativeTarget section */ 137 | 968A23EA1D7812B30024A923 /* iPicUploaderExample */ = { 138 | isa = PBXNativeTarget; 139 | buildConfigurationList = 968A23F71D7812B30024A923 /* Build configuration list for PBXNativeTarget "iPicUploaderExample" */; 140 | buildPhases = ( 141 | FA9A559DDDA8486C3BACFCB5 /* [CP] Check Pods Manifest.lock */, 142 | 968A23E71D7812B30024A923 /* Sources */, 143 | 968A23E81D7812B30024A923 /* Frameworks */, 144 | 968A23E91D7812B30024A923 /* Resources */, 145 | E9E570F1AA055B20683A61EB /* [CP] Embed Pods Frameworks */, 146 | B721DDFEF5256D7FBA704E2F /* [CP] Copy Pods Resources */, 147 | ); 148 | buildRules = ( 149 | ); 150 | dependencies = ( 151 | ); 152 | name = iPicUploaderExample; 153 | productName = iPicUploaderExample; 154 | productReference = 968A23EB1D7812B30024A923 /* iPicUploaderExample.app */; 155 | productType = "com.apple.product-type.application"; 156 | }; 157 | /* End PBXNativeTarget section */ 158 | 159 | /* Begin PBXProject section */ 160 | 607FACC81AFB9204008FA782 /* Project object */ = { 161 | isa = PBXProject; 162 | attributes = { 163 | LastSwiftUpdateCheck = 0730; 164 | LastUpgradeCheck = 1020; 165 | ORGANIZATIONNAME = CocoaPods; 166 | TargetAttributes = { 167 | 968A23EA1D7812B30024A923 = { 168 | CreatedOnToolsVersion = 7.3; 169 | DevelopmentTeam = 6N8QAK7VZN; 170 | LastSwiftMigration = 0800; 171 | ProvisioningStyle = Automatic; 172 | SystemCapabilities = { 173 | com.apple.Sandbox = { 174 | enabled = 1; 175 | }; 176 | }; 177 | }; 178 | }; 179 | }; 180 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "iPicUploader" */; 181 | compatibilityVersion = "Xcode 3.2"; 182 | developmentRegion = en; 183 | hasScannedForEncodings = 0; 184 | knownRegions = ( 185 | en, 186 | Base, 187 | ); 188 | mainGroup = 607FACC71AFB9204008FA782; 189 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 190 | projectDirPath = ""; 191 | projectRoot = ""; 192 | targets = ( 193 | 968A23EA1D7812B30024A923 /* iPicUploaderExample */, 194 | ); 195 | }; 196 | /* End PBXProject section */ 197 | 198 | /* Begin PBXResourcesBuildPhase section */ 199 | 968A23E91D7812B30024A923 /* Resources */ = { 200 | isa = PBXResourcesBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | 968A23F01D7812B30024A923 /* Assets.xcassets in Resources */, 204 | 968A23FB1D7813470024A923 /* MainWindowController.xib in Resources */, 205 | 968A23F31D7812B30024A923 /* MainMenu.xib in Resources */, 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | }; 209 | /* End PBXResourcesBuildPhase section */ 210 | 211 | /* Begin PBXShellScriptBuildPhase section */ 212 | B721DDFEF5256D7FBA704E2F /* [CP] Copy Pods Resources */ = { 213 | isa = PBXShellScriptBuildPhase; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | ); 217 | inputPaths = ( 218 | ); 219 | name = "[CP] Copy Pods Resources"; 220 | outputPaths = ( 221 | ); 222 | runOnlyForDeploymentPostprocessing = 0; 223 | shellPath = /bin/sh; 224 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample-resources.sh\"\n"; 225 | showEnvVarsInLog = 0; 226 | }; 227 | E9E570F1AA055B20683A61EB /* [CP] Embed Pods Frameworks */ = { 228 | isa = PBXShellScriptBuildPhase; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | ); 232 | inputPaths = ( 233 | ); 234 | name = "[CP] Embed Pods Frameworks"; 235 | outputPaths = ( 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | shellPath = /bin/sh; 239 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample-frameworks.sh\"\n"; 240 | showEnvVarsInLog = 0; 241 | }; 242 | FA9A559DDDA8486C3BACFCB5 /* [CP] Check Pods Manifest.lock */ = { 243 | isa = PBXShellScriptBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | ); 247 | inputPaths = ( 248 | ); 249 | name = "[CP] Check Pods Manifest.lock"; 250 | outputPaths = ( 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | shellPath = /bin/sh; 254 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; 255 | showEnvVarsInLog = 0; 256 | }; 257 | /* End PBXShellScriptBuildPhase section */ 258 | 259 | /* Begin PBXSourcesBuildPhase section */ 260 | 968A23E71D7812B30024A923 /* Sources */ = { 261 | isa = PBXSourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | 968A23FA1D7813470024A923 /* MainWindowController.swift in Sources */, 265 | 967DD9871D7BCAC800844689 /* iPicImageView.swift in Sources */, 266 | 968A23EE1D7812B30024A923 /* AppDelegate.swift in Sources */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | /* End PBXSourcesBuildPhase section */ 271 | 272 | /* Begin PBXVariantGroup section */ 273 | 968A23F11D7812B30024A923 /* MainMenu.xib */ = { 274 | isa = PBXVariantGroup; 275 | children = ( 276 | 968A23F21D7812B30024A923 /* Base */, 277 | ); 278 | name = MainMenu.xib; 279 | sourceTree = ""; 280 | }; 281 | /* End PBXVariantGroup section */ 282 | 283 | /* Begin XCBuildConfiguration section */ 284 | 607FACED1AFB9204008FA782 /* Debug */ = { 285 | isa = XCBuildConfiguration; 286 | buildSettings = { 287 | ALWAYS_SEARCH_USER_PATHS = NO; 288 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 289 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 290 | CLANG_CXX_LIBRARY = "libc++"; 291 | CLANG_ENABLE_MODULES = YES; 292 | CLANG_ENABLE_OBJC_ARC = YES; 293 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 294 | CLANG_WARN_BOOL_CONVERSION = YES; 295 | CLANG_WARN_COMMA = YES; 296 | CLANG_WARN_CONSTANT_CONVERSION = YES; 297 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 298 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 299 | CLANG_WARN_EMPTY_BODY = YES; 300 | CLANG_WARN_ENUM_CONVERSION = YES; 301 | CLANG_WARN_INFINITE_RECURSION = YES; 302 | CLANG_WARN_INT_CONVERSION = YES; 303 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 304 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 305 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 306 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 307 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 308 | CLANG_WARN_STRICT_PROTOTYPES = YES; 309 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 310 | CLANG_WARN_UNREACHABLE_CODE = YES; 311 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 312 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 313 | COPY_PHASE_STRIP = NO; 314 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 315 | ENABLE_STRICT_OBJC_MSGSEND = YES; 316 | ENABLE_TESTABILITY = YES; 317 | GCC_C_LANGUAGE_STANDARD = gnu99; 318 | GCC_DYNAMIC_NO_PIC = NO; 319 | GCC_NO_COMMON_BLOCKS = YES; 320 | GCC_OPTIMIZATION_LEVEL = 0; 321 | GCC_PREPROCESSOR_DEFINITIONS = ( 322 | "DEBUG=1", 323 | "$(inherited)", 324 | ); 325 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 326 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 327 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 328 | GCC_WARN_UNDECLARED_SELECTOR = YES; 329 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 330 | GCC_WARN_UNUSED_FUNCTION = YES; 331 | GCC_WARN_UNUSED_VARIABLE = YES; 332 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 333 | MTL_ENABLE_DEBUG_INFO = YES; 334 | ONLY_ACTIVE_ARCH = YES; 335 | SDKROOT = iphoneos; 336 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 337 | SWIFT_VERSION = 5.0; 338 | }; 339 | name = Debug; 340 | }; 341 | 607FACEE1AFB9204008FA782 /* Release */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | ALWAYS_SEARCH_USER_PATHS = NO; 345 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 346 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 347 | CLANG_CXX_LIBRARY = "libc++"; 348 | CLANG_ENABLE_MODULES = YES; 349 | CLANG_ENABLE_OBJC_ARC = YES; 350 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 351 | CLANG_WARN_BOOL_CONVERSION = YES; 352 | CLANG_WARN_COMMA = YES; 353 | CLANG_WARN_CONSTANT_CONVERSION = YES; 354 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 355 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 356 | CLANG_WARN_EMPTY_BODY = YES; 357 | CLANG_WARN_ENUM_CONVERSION = YES; 358 | CLANG_WARN_INFINITE_RECURSION = YES; 359 | CLANG_WARN_INT_CONVERSION = YES; 360 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 361 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 362 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 363 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 364 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 365 | CLANG_WARN_STRICT_PROTOTYPES = YES; 366 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 367 | CLANG_WARN_UNREACHABLE_CODE = YES; 368 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 369 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 370 | COPY_PHASE_STRIP = NO; 371 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 372 | ENABLE_NS_ASSERTIONS = NO; 373 | ENABLE_STRICT_OBJC_MSGSEND = YES; 374 | GCC_C_LANGUAGE_STANDARD = gnu99; 375 | GCC_NO_COMMON_BLOCKS = YES; 376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 378 | GCC_WARN_UNDECLARED_SELECTOR = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 380 | GCC_WARN_UNUSED_FUNCTION = YES; 381 | GCC_WARN_UNUSED_VARIABLE = YES; 382 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 383 | MTL_ENABLE_DEBUG_INFO = NO; 384 | SDKROOT = iphoneos; 385 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 386 | SWIFT_VERSION = 5.0; 387 | VALIDATE_PRODUCT = YES; 388 | }; 389 | name = Release; 390 | }; 391 | 968A23F51D7812B30024A923 /* Debug */ = { 392 | isa = XCBuildConfiguration; 393 | baseConfigurationReference = 602ED34BF9D06E5D4C48D645 /* Pods-iPicUploaderExample.debug.xcconfig */; 394 | buildSettings = { 395 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 396 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 397 | CLANG_ANALYZER_NONNULL = YES; 398 | CODE_SIGN_ENTITLEMENTS = iPicUploaderExample/iPicUploaderExample.entitlements; 399 | CODE_SIGN_IDENTITY = "Mac Developer"; 400 | COMBINE_HIDPI_IMAGES = YES; 401 | DEBUG_INFORMATION_FORMAT = dwarf; 402 | DEVELOPMENT_TEAM = 6N8QAK7VZN; 403 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 404 | INFOPLIST_FILE = iPicUploaderExample/Info.plist; 405 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 406 | MACOSX_DEPLOYMENT_TARGET = 10.11; 407 | PRODUCT_BUNDLE_IDENTIFIER = net.toolinbox.iPicUploaderExample; 408 | PRODUCT_NAME = "$(TARGET_NAME)"; 409 | SDKROOT = macosx; 410 | SWIFT_VERSION = 5.0; 411 | }; 412 | name = Debug; 413 | }; 414 | 968A23F61D7812B30024A923 /* Release */ = { 415 | isa = XCBuildConfiguration; 416 | baseConfigurationReference = 7713B8BC4B035FAADBF02F93 /* Pods-iPicUploaderExample.release.xcconfig */; 417 | buildSettings = { 418 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 419 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 420 | CLANG_ANALYZER_NONNULL = YES; 421 | CODE_SIGN_ENTITLEMENTS = iPicUploaderExample/iPicUploaderExample.entitlements; 422 | CODE_SIGN_IDENTITY = "Mac Developer"; 423 | COMBINE_HIDPI_IMAGES = YES; 424 | DEVELOPMENT_TEAM = 6N8QAK7VZN; 425 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 426 | INFOPLIST_FILE = iPicUploaderExample/Info.plist; 427 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 428 | MACOSX_DEPLOYMENT_TARGET = 10.11; 429 | PRODUCT_BUNDLE_IDENTIFIER = net.toolinbox.iPicUploaderExample; 430 | PRODUCT_NAME = "$(TARGET_NAME)"; 431 | SDKROOT = macosx; 432 | SWIFT_VERSION = 5.0; 433 | }; 434 | name = Release; 435 | }; 436 | /* End XCBuildConfiguration section */ 437 | 438 | /* Begin XCConfigurationList section */ 439 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "iPicUploader" */ = { 440 | isa = XCConfigurationList; 441 | buildConfigurations = ( 442 | 607FACED1AFB9204008FA782 /* Debug */, 443 | 607FACEE1AFB9204008FA782 /* Release */, 444 | ); 445 | defaultConfigurationIsVisible = 0; 446 | defaultConfigurationName = Release; 447 | }; 448 | 968A23F71D7812B30024A923 /* Build configuration list for PBXNativeTarget "iPicUploaderExample" */ = { 449 | isa = XCConfigurationList; 450 | buildConfigurations = ( 451 | 968A23F51D7812B30024A923 /* Debug */, 452 | 968A23F61D7812B30024A923 /* Release */, 453 | ); 454 | defaultConfigurationIsVisible = 0; 455 | defaultConfigurationName = Release; 456 | }; 457 | /* End XCConfigurationList section */ 458 | }; 459 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 460 | } 461 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2908466816E785DB52F8259C56BA5ACE /* iPicImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94FD689E25AEE775C3BD2A442214217D /* iPicImage.swift */; }; 11 | 2CB786AC59F5DBD5CD4EA4423B8743CD /* Pods-iPicUploaderExample-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C98ABF7E90A3F61BFF6E72E8E53A3A23 /* Pods-iPicUploaderExample-dummy.m */; }; 12 | 323F4078E84E9C1B6CD0FDF976C61581 /* iPicUploader-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EE36716029DC30F8C00801C3066CDF6 /* iPicUploader-dummy.m */; }; 13 | 3C260B3F687BB71C5309EDB04CC7162A /* iPicUploader.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE01C1125C955E0F9D9F194B94C3CA66 /* iPicUploader.swift */; }; 14 | 4B7C857DE65CE7DA118CBFAC5CE1CFCA /* iPicUploader-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 53AF51C505CF059A532A6864A0A6DA88 /* iPicUploader-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | 53170E645AEC0AB7A5C619518FD40630 /* iPicUploadResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39BEBC50216217E650746BC73A5A2387 /* iPicUploadResult.swift */; }; 16 | 5BE0B4B272A33AADBA815E876A15DEEF /* iPicPasteboardHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE4077BDCFC21E1428D8F42423C2FFF4 /* iPicPasteboardHelper.swift */; }; 17 | 88FF1F4BA5B136D0DA4764C89C9E0619 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 270DD1219F1E6CF00379D39F252D87C6 /* Cocoa.framework */; }; 18 | 9280E404CBA89D6122F0FE4D7A4CCDC5 /* Pods-iPicUploaderExample-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8FD2E8EBDB4E6A09A76E826CA045F0 /* Pods-iPicUploaderExample-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 19 | 95F59C7D4E3D4A9440266087142AB5AF /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 270DD1219F1E6CF00379D39F252D87C6 /* Cocoa.framework */; }; 20 | D835E8916DFEA822CB3B67DF859431FF /* iPicImageHost.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49187694380390DD0C352721AFC488E6 /* iPicImageHost.swift */; }; 21 | F15E8232D38F76325E93AD3D647208A4 /* iPicUploadHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9107AC662FC0095A4D52F59840525E8 /* iPicUploadHelper.swift */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | D734E4972283C54A70FBCB6C060DB6AB /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 8C7D20DA154E0705646FC51CD3B82B94; 30 | remoteInfo = iPicUploader; 31 | }; 32 | /* End PBXContainerItemProxy section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 13BBEC260DFEC059DF25801BDDDF55B3 /* Pods-iPicUploaderExample.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-iPicUploaderExample.modulemap"; sourceTree = ""; }; 36 | 205313F3332997F867D86645050C748E /* Pods-iPicUploaderExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-iPicUploaderExample.release.xcconfig"; sourceTree = ""; }; 37 | 270DD1219F1E6CF00379D39F252D87C6 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; 38 | 35CFA2FF1FA094928C9406C2F947C014 /* iPicUploader.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = iPicUploader.modulemap; sourceTree = ""; }; 39 | 39BEBC50216217E650746BC73A5A2387 /* iPicUploadResult.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = iPicUploadResult.swift; sourceTree = ""; }; 40 | 3A660CA2D1E60D83AEDA5E31AC602AAD /* Pods-iPicUploaderExample-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-iPicUploaderExample-resources.sh"; sourceTree = ""; }; 41 | 49187694380390DD0C352721AFC488E6 /* iPicImageHost.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = iPicImageHost.swift; sourceTree = ""; }; 42 | 4EE36716029DC30F8C00801C3066CDF6 /* iPicUploader-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "iPicUploader-dummy.m"; sourceTree = ""; }; 43 | 53AF51C505CF059A532A6864A0A6DA88 /* iPicUploader-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "iPicUploader-umbrella.h"; sourceTree = ""; }; 44 | 650A536FA73DBFEE64F1ECA14CD7F76E /* Pods-iPicUploaderExample-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-iPicUploaderExample-acknowledgements.plist"; sourceTree = ""; }; 45 | 6B8FD2E8EBDB4E6A09A76E826CA045F0 /* Pods-iPicUploaderExample-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-iPicUploaderExample-umbrella.h"; sourceTree = ""; }; 46 | 73686E5028A3488C8AAC224DD9F32E4F /* Pods-iPicUploaderExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-iPicUploaderExample.debug.xcconfig"; sourceTree = ""; }; 47 | 7D2CEB8D01ECB51A0F8DF56E738997DC /* Pods-iPicUploaderExample-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-iPicUploaderExample-acknowledgements.markdown"; sourceTree = ""; }; 48 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 49 | 94FD689E25AEE775C3BD2A442214217D /* iPicImage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = iPicImage.swift; sourceTree = ""; }; 50 | A6D0DCF86077F1C45CC553605670A3AF /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | C9107AC662FC0095A4D52F59840525E8 /* iPicUploadHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = iPicUploadHelper.swift; sourceTree = ""; }; 52 | C98ABF7E90A3F61BFF6E72E8E53A3A23 /* Pods-iPicUploaderExample-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-iPicUploaderExample-dummy.m"; sourceTree = ""; }; 53 | D225E0E6D8E6E9A6CC1FD8630457D35C /* Pods-iPicUploaderExample-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-iPicUploaderExample-frameworks.sh"; sourceTree = ""; }; 54 | D85A5F6E5087917F1E325E041A5E35AF /* iPicUploader.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = iPicUploader.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | D96D0BC9103D2A3A134FA10E244FB260 /* Pods_iPicUploaderExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iPicUploaderExample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | DD06A8354E754C44FD8C33083D89CE07 /* iPicUploader.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = iPicUploader.xcconfig; sourceTree = ""; }; 57 | DF57DC475DA52C0460578ED7069533E0 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | E9E52521CB7A016ACE312200866F05F2 /* iPicUploader-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "iPicUploader-prefix.pch"; sourceTree = ""; }; 59 | FE01C1125C955E0F9D9F194B94C3CA66 /* iPicUploader.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = iPicUploader.swift; sourceTree = ""; }; 60 | FE4077BDCFC21E1428D8F42423C2FFF4 /* iPicPasteboardHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = iPicPasteboardHelper.swift; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 38AA2669ECD06CCF565DD569F5739B35 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 88FF1F4BA5B136D0DA4764C89C9E0619 /* Cocoa.framework in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 8DEC08E782E34EDA4B32423898C896F6 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | 95F59C7D4E3D4A9440266087142AB5AF /* Cocoa.framework in Frameworks */, 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXFrameworksBuildPhase section */ 81 | 82 | /* Begin PBXGroup section */ 83 | 04C068A18C5413F804A2959126093416 /* OS X */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 270DD1219F1E6CF00379D39F252D87C6 /* Cocoa.framework */, 87 | ); 88 | name = "OS X"; 89 | sourceTree = ""; 90 | }; 91 | 0CA9237C481B5367C77554398DAC953C /* Support Files */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | A6D0DCF86077F1C45CC553605670A3AF /* Info.plist */, 95 | 35CFA2FF1FA094928C9406C2F947C014 /* iPicUploader.modulemap */, 96 | DD06A8354E754C44FD8C33083D89CE07 /* iPicUploader.xcconfig */, 97 | 4EE36716029DC30F8C00801C3066CDF6 /* iPicUploader-dummy.m */, 98 | E9E52521CB7A016ACE312200866F05F2 /* iPicUploader-prefix.pch */, 99 | 53AF51C505CF059A532A6864A0A6DA88 /* iPicUploader-umbrella.h */, 100 | ); 101 | name = "Support Files"; 102 | path = "Example/Pods/Target Support Files/iPicUploader"; 103 | sourceTree = ""; 104 | }; 105 | 1FC73D032E4C351F42C3C3CF1730DD3D /* Pods-iPicUploaderExample */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | DF57DC475DA52C0460578ED7069533E0 /* Info.plist */, 109 | 13BBEC260DFEC059DF25801BDDDF55B3 /* Pods-iPicUploaderExample.modulemap */, 110 | 7D2CEB8D01ECB51A0F8DF56E738997DC /* Pods-iPicUploaderExample-acknowledgements.markdown */, 111 | 650A536FA73DBFEE64F1ECA14CD7F76E /* Pods-iPicUploaderExample-acknowledgements.plist */, 112 | C98ABF7E90A3F61BFF6E72E8E53A3A23 /* Pods-iPicUploaderExample-dummy.m */, 113 | D225E0E6D8E6E9A6CC1FD8630457D35C /* Pods-iPicUploaderExample-frameworks.sh */, 114 | 3A660CA2D1E60D83AEDA5E31AC602AAD /* Pods-iPicUploaderExample-resources.sh */, 115 | 6B8FD2E8EBDB4E6A09A76E826CA045F0 /* Pods-iPicUploaderExample-umbrella.h */, 116 | 73686E5028A3488C8AAC224DD9F32E4F /* Pods-iPicUploaderExample.debug.xcconfig */, 117 | 205313F3332997F867D86645050C748E /* Pods-iPicUploaderExample.release.xcconfig */, 118 | ); 119 | name = "Pods-iPicUploaderExample"; 120 | path = "Target Support Files/Pods-iPicUploaderExample"; 121 | sourceTree = ""; 122 | }; 123 | 39E9EE8210D861DFD82346C1F5EB7218 /* Frameworks */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 04C068A18C5413F804A2959126093416 /* OS X */, 127 | ); 128 | name = Frameworks; 129 | sourceTree = ""; 130 | }; 131 | 3F2B38E5176FA2EBED857D270286BA2C /* Classes */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 94FD689E25AEE775C3BD2A442214217D /* iPicImage.swift */, 135 | 49187694380390DD0C352721AFC488E6 /* iPicImageHost.swift */, 136 | FE4077BDCFC21E1428D8F42423C2FFF4 /* iPicPasteboardHelper.swift */, 137 | FE01C1125C955E0F9D9F194B94C3CA66 /* iPicUploader.swift */, 138 | C9107AC662FC0095A4D52F59840525E8 /* iPicUploadHelper.swift */, 139 | 39BEBC50216217E650746BC73A5A2387 /* iPicUploadResult.swift */, 140 | ); 141 | path = Classes; 142 | sourceTree = ""; 143 | }; 144 | 512DC1CCD79E854E14D520CFECAA4A0F /* iPicUploader */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | 9A882F69ECF1064599124CEE811EDEFD /* iPicUploader */, 148 | 0CA9237C481B5367C77554398DAC953C /* Support Files */, 149 | ); 150 | name = iPicUploader; 151 | path = ../..; 152 | sourceTree = ""; 153 | }; 154 | 7DB346D0F39D3F0E887471402A8071AB = { 155 | isa = PBXGroup; 156 | children = ( 157 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, 158 | 8BD6619CD43C1AE999C2BDCABB64CE43 /* Development Pods */, 159 | 39E9EE8210D861DFD82346C1F5EB7218 /* Frameworks */, 160 | D23C68AEA436E8ACF971982FAD40F1B4 /* Products */, 161 | CDEB7E9023119033449272C721B492B2 /* Targets Support Files */, 162 | ); 163 | sourceTree = ""; 164 | }; 165 | 8BD6619CD43C1AE999C2BDCABB64CE43 /* Development Pods */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | 512DC1CCD79E854E14D520CFECAA4A0F /* iPicUploader */, 169 | ); 170 | name = "Development Pods"; 171 | sourceTree = ""; 172 | }; 173 | 9A882F69ECF1064599124CEE811EDEFD /* iPicUploader */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 3F2B38E5176FA2EBED857D270286BA2C /* Classes */, 177 | ); 178 | path = iPicUploader; 179 | sourceTree = ""; 180 | }; 181 | CDEB7E9023119033449272C721B492B2 /* Targets Support Files */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 1FC73D032E4C351F42C3C3CF1730DD3D /* Pods-iPicUploaderExample */, 185 | ); 186 | name = "Targets Support Files"; 187 | sourceTree = ""; 188 | }; 189 | D23C68AEA436E8ACF971982FAD40F1B4 /* Products */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | D85A5F6E5087917F1E325E041A5E35AF /* iPicUploader.framework */, 193 | D96D0BC9103D2A3A134FA10E244FB260 /* Pods_iPicUploaderExample.framework */, 194 | ); 195 | name = Products; 196 | sourceTree = ""; 197 | }; 198 | /* End PBXGroup section */ 199 | 200 | /* Begin PBXHeadersBuildPhase section */ 201 | ACEED6CF7365CB0C8F28FF7E25CF40B8 /* Headers */ = { 202 | isa = PBXHeadersBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | 4B7C857DE65CE7DA118CBFAC5CE1CFCA /* iPicUploader-umbrella.h in Headers */, 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | }; 209 | D4EC4E9BBEE9D1F6FF681C3ECAF7EF0B /* Headers */ = { 210 | isa = PBXHeadersBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | 9280E404CBA89D6122F0FE4D7A4CCDC5 /* Pods-iPicUploaderExample-umbrella.h in Headers */, 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | }; 217 | /* End PBXHeadersBuildPhase section */ 218 | 219 | /* Begin PBXNativeTarget section */ 220 | 8C7D20DA154E0705646FC51CD3B82B94 /* iPicUploader */ = { 221 | isa = PBXNativeTarget; 222 | buildConfigurationList = 1101D4E62526D3BEE09CEA4DA8B37D91 /* Build configuration list for PBXNativeTarget "iPicUploader" */; 223 | buildPhases = ( 224 | E664511132E9756251EACE3F1C1521B4 /* Sources */, 225 | 8DEC08E782E34EDA4B32423898C896F6 /* Frameworks */, 226 | ACEED6CF7365CB0C8F28FF7E25CF40B8 /* Headers */, 227 | ); 228 | buildRules = ( 229 | ); 230 | dependencies = ( 231 | ); 232 | name = iPicUploader; 233 | productName = iPicUploader; 234 | productReference = D85A5F6E5087917F1E325E041A5E35AF /* iPicUploader.framework */; 235 | productType = "com.apple.product-type.framework"; 236 | }; 237 | E88DC51C927956F260FFD3BD4CDF9D49 /* Pods-iPicUploaderExample */ = { 238 | isa = PBXNativeTarget; 239 | buildConfigurationList = 74FBD6423B3867F74687DB2DA2B44F92 /* Build configuration list for PBXNativeTarget "Pods-iPicUploaderExample" */; 240 | buildPhases = ( 241 | 83E023B1E9D79A62305DA18B100F112E /* Sources */, 242 | 38AA2669ECD06CCF565DD569F5739B35 /* Frameworks */, 243 | D4EC4E9BBEE9D1F6FF681C3ECAF7EF0B /* Headers */, 244 | ); 245 | buildRules = ( 246 | ); 247 | dependencies = ( 248 | BC963EEC05AE1A3208CE9D30660BE1F3 /* PBXTargetDependency */, 249 | ); 250 | name = "Pods-iPicUploaderExample"; 251 | productName = "Pods-iPicUploaderExample"; 252 | productReference = D96D0BC9103D2A3A134FA10E244FB260 /* Pods_iPicUploaderExample.framework */; 253 | productType = "com.apple.product-type.framework"; 254 | }; 255 | /* End PBXNativeTarget section */ 256 | 257 | /* Begin PBXProject section */ 258 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 259 | isa = PBXProject; 260 | attributes = { 261 | LastSwiftUpdateCheck = 0730; 262 | LastUpgradeCheck = 1020; 263 | }; 264 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 265 | compatibilityVersion = "Xcode 3.2"; 266 | developmentRegion = en; 267 | hasScannedForEncodings = 0; 268 | knownRegions = ( 269 | en, 270 | Base, 271 | ); 272 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 273 | productRefGroup = D23C68AEA436E8ACF971982FAD40F1B4 /* Products */; 274 | projectDirPath = ""; 275 | projectRoot = ""; 276 | targets = ( 277 | 8C7D20DA154E0705646FC51CD3B82B94 /* iPicUploader */, 278 | E88DC51C927956F260FFD3BD4CDF9D49 /* Pods-iPicUploaderExample */, 279 | ); 280 | }; 281 | /* End PBXProject section */ 282 | 283 | /* Begin PBXSourcesBuildPhase section */ 284 | 83E023B1E9D79A62305DA18B100F112E /* Sources */ = { 285 | isa = PBXSourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | 2CB786AC59F5DBD5CD4EA4423B8743CD /* Pods-iPicUploaderExample-dummy.m in Sources */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | E664511132E9756251EACE3F1C1521B4 /* Sources */ = { 293 | isa = PBXSourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | 2908466816E785DB52F8259C56BA5ACE /* iPicImage.swift in Sources */, 297 | D835E8916DFEA822CB3B67DF859431FF /* iPicImageHost.swift in Sources */, 298 | 5BE0B4B272A33AADBA815E876A15DEEF /* iPicPasteboardHelper.swift in Sources */, 299 | 323F4078E84E9C1B6CD0FDF976C61581 /* iPicUploader-dummy.m in Sources */, 300 | 3C260B3F687BB71C5309EDB04CC7162A /* iPicUploader.swift in Sources */, 301 | F15E8232D38F76325E93AD3D647208A4 /* iPicUploadHelper.swift in Sources */, 302 | 53170E645AEC0AB7A5C619518FD40630 /* iPicUploadResult.swift in Sources */, 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | }; 306 | /* End PBXSourcesBuildPhase section */ 307 | 308 | /* Begin PBXTargetDependency section */ 309 | BC963EEC05AE1A3208CE9D30660BE1F3 /* PBXTargetDependency */ = { 310 | isa = PBXTargetDependency; 311 | name = iPicUploader; 312 | target = 8C7D20DA154E0705646FC51CD3B82B94 /* iPicUploader */; 313 | targetProxy = D734E4972283C54A70FBCB6C060DB6AB /* PBXContainerItemProxy */; 314 | }; 315 | /* End PBXTargetDependency section */ 316 | 317 | /* Begin XCBuildConfiguration section */ 318 | 32D9F8554D3E5E3A05372EC885BD2115 /* Release */ = { 319 | isa = XCBuildConfiguration; 320 | baseConfigurationReference = DD06A8354E754C44FD8C33083D89CE07 /* iPicUploader.xcconfig */; 321 | buildSettings = { 322 | CODE_SIGN_IDENTITY = "-"; 323 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 324 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 325 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 326 | COMBINE_HIDPI_IMAGES = YES; 327 | CURRENT_PROJECT_VERSION = 1; 328 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 329 | DEFINES_MODULE = YES; 330 | DYLIB_COMPATIBILITY_VERSION = 1; 331 | DYLIB_CURRENT_VERSION = 1; 332 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | FRAMEWORK_VERSION = A; 335 | GCC_NO_COMMON_BLOCKS = YES; 336 | GCC_PREFIX_HEADER = "Target Support Files/iPicUploader/iPicUploader-prefix.pch"; 337 | INFOPLIST_FILE = "Target Support Files/iPicUploader/Info.plist"; 338 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 339 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 340 | MACOSX_DEPLOYMENT_TARGET = 10.11; 341 | MODULEMAP_FILE = "Target Support Files/iPicUploader/iPicUploader.modulemap"; 342 | MTL_ENABLE_DEBUG_INFO = NO; 343 | PRODUCT_NAME = iPicUploader; 344 | SDKROOT = macosx; 345 | SKIP_INSTALL = YES; 346 | SWIFT_VERSION = 5.0; 347 | VERSIONING_SYSTEM = "apple-generic"; 348 | VERSION_INFO_PREFIX = ""; 349 | }; 350 | name = Release; 351 | }; 352 | 4ECF5F3A7DCBE32E59B23B0C7F362504 /* Release */ = { 353 | isa = XCBuildConfiguration; 354 | buildSettings = { 355 | ALWAYS_SEARCH_USER_PATHS = NO; 356 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 357 | CLANG_ANALYZER_NONNULL = YES; 358 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 359 | CLANG_CXX_LIBRARY = "libc++"; 360 | CLANG_ENABLE_MODULES = YES; 361 | CLANG_ENABLE_OBJC_ARC = YES; 362 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 363 | CLANG_WARN_BOOL_CONVERSION = YES; 364 | CLANG_WARN_COMMA = YES; 365 | CLANG_WARN_CONSTANT_CONVERSION = YES; 366 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 367 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 368 | CLANG_WARN_EMPTY_BODY = YES; 369 | CLANG_WARN_ENUM_CONVERSION = YES; 370 | CLANG_WARN_INFINITE_RECURSION = YES; 371 | CLANG_WARN_INT_CONVERSION = YES; 372 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 373 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 374 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 375 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 376 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 377 | CLANG_WARN_STRICT_PROTOTYPES = YES; 378 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 379 | CLANG_WARN_UNREACHABLE_CODE = YES; 380 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 381 | CODE_SIGNING_REQUIRED = NO; 382 | COPY_PHASE_STRIP = YES; 383 | ENABLE_NS_ASSERTIONS = NO; 384 | ENABLE_STRICT_OBJC_MSGSEND = YES; 385 | GCC_C_LANGUAGE_STANDARD = gnu99; 386 | GCC_NO_COMMON_BLOCKS = YES; 387 | GCC_PREPROCESSOR_DEFINITIONS = ( 388 | "POD_CONFIGURATION_RELEASE=1", 389 | "$(inherited)", 390 | ); 391 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 392 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 393 | GCC_WARN_UNDECLARED_SELECTOR = YES; 394 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 395 | GCC_WARN_UNUSED_FUNCTION = YES; 396 | GCC_WARN_UNUSED_VARIABLE = YES; 397 | MACOSX_DEPLOYMENT_TARGET = 10.9; 398 | PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; 399 | STRIP_INSTALLED_PRODUCT = NO; 400 | SWIFT_COMPILATION_MODE = wholemodule; 401 | SWIFT_VERSION = 5.0; 402 | SYMROOT = "${SRCROOT}/../build"; 403 | VALIDATE_PRODUCT = YES; 404 | }; 405 | name = Release; 406 | }; 407 | 62BA7506CD3BBE2C35C74AD4CF804CB3 /* Debug */ = { 408 | isa = XCBuildConfiguration; 409 | baseConfigurationReference = 73686E5028A3488C8AAC224DD9F32E4F /* Pods-iPicUploaderExample.debug.xcconfig */; 410 | buildSettings = { 411 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 412 | CODE_SIGN_IDENTITY = "-"; 413 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 414 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 415 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 416 | COMBINE_HIDPI_IMAGES = YES; 417 | CURRENT_PROJECT_VERSION = 1; 418 | DEBUG_INFORMATION_FORMAT = dwarf; 419 | DEFINES_MODULE = YES; 420 | DYLIB_COMPATIBILITY_VERSION = 1; 421 | DYLIB_CURRENT_VERSION = 1; 422 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 423 | ENABLE_STRICT_OBJC_MSGSEND = YES; 424 | FRAMEWORK_VERSION = A; 425 | GCC_NO_COMMON_BLOCKS = YES; 426 | INFOPLIST_FILE = "Target Support Files/Pods-iPicUploaderExample/Info.plist"; 427 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 428 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 429 | MACH_O_TYPE = staticlib; 430 | MACOSX_DEPLOYMENT_TARGET = 10.9; 431 | MODULEMAP_FILE = "Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample.modulemap"; 432 | MTL_ENABLE_DEBUG_INFO = YES; 433 | OTHER_LDFLAGS = ""; 434 | OTHER_LIBTOOLFLAGS = ""; 435 | PODS_ROOT = "$(SRCROOT)"; 436 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 437 | PRODUCT_NAME = Pods_iPicUploaderExample; 438 | SDKROOT = macosx; 439 | SKIP_INSTALL = YES; 440 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 441 | SWIFT_VERSION = 3.0; 442 | VERSIONING_SYSTEM = "apple-generic"; 443 | VERSION_INFO_PREFIX = ""; 444 | }; 445 | name = Debug; 446 | }; 447 | 75538234C692FAF4AE1F3241116AF0EB /* Release */ = { 448 | isa = XCBuildConfiguration; 449 | baseConfigurationReference = 205313F3332997F867D86645050C748E /* Pods-iPicUploaderExample.release.xcconfig */; 450 | buildSettings = { 451 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 452 | CODE_SIGN_IDENTITY = "-"; 453 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 454 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 455 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 456 | COMBINE_HIDPI_IMAGES = YES; 457 | CURRENT_PROJECT_VERSION = 1; 458 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 459 | DEFINES_MODULE = YES; 460 | DYLIB_COMPATIBILITY_VERSION = 1; 461 | DYLIB_CURRENT_VERSION = 1; 462 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 463 | ENABLE_STRICT_OBJC_MSGSEND = YES; 464 | FRAMEWORK_VERSION = A; 465 | GCC_NO_COMMON_BLOCKS = YES; 466 | INFOPLIST_FILE = "Target Support Files/Pods-iPicUploaderExample/Info.plist"; 467 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 468 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 469 | MACH_O_TYPE = staticlib; 470 | MACOSX_DEPLOYMENT_TARGET = 10.9; 471 | MODULEMAP_FILE = "Target Support Files/Pods-iPicUploaderExample/Pods-iPicUploaderExample.modulemap"; 472 | MTL_ENABLE_DEBUG_INFO = NO; 473 | OTHER_LDFLAGS = ""; 474 | OTHER_LIBTOOLFLAGS = ""; 475 | PODS_ROOT = "$(SRCROOT)"; 476 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 477 | PRODUCT_NAME = Pods_iPicUploaderExample; 478 | SDKROOT = macosx; 479 | SKIP_INSTALL = YES; 480 | SWIFT_VERSION = 3.0; 481 | VERSIONING_SYSTEM = "apple-generic"; 482 | VERSION_INFO_PREFIX = ""; 483 | }; 484 | name = Release; 485 | }; 486 | 7B55F8380C0C8B1DF0B393259BE9AA53 /* Debug */ = { 487 | isa = XCBuildConfiguration; 488 | baseConfigurationReference = DD06A8354E754C44FD8C33083D89CE07 /* iPicUploader.xcconfig */; 489 | buildSettings = { 490 | CODE_SIGN_IDENTITY = "-"; 491 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 492 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 493 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 494 | COMBINE_HIDPI_IMAGES = YES; 495 | CURRENT_PROJECT_VERSION = 1; 496 | DEBUG_INFORMATION_FORMAT = dwarf; 497 | DEFINES_MODULE = YES; 498 | DYLIB_COMPATIBILITY_VERSION = 1; 499 | DYLIB_CURRENT_VERSION = 1; 500 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 501 | ENABLE_STRICT_OBJC_MSGSEND = YES; 502 | FRAMEWORK_VERSION = A; 503 | GCC_NO_COMMON_BLOCKS = YES; 504 | GCC_PREFIX_HEADER = "Target Support Files/iPicUploader/iPicUploader-prefix.pch"; 505 | INFOPLIST_FILE = "Target Support Files/iPicUploader/Info.plist"; 506 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 507 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 508 | MACOSX_DEPLOYMENT_TARGET = 10.11; 509 | MODULEMAP_FILE = "Target Support Files/iPicUploader/iPicUploader.modulemap"; 510 | MTL_ENABLE_DEBUG_INFO = YES; 511 | PRODUCT_NAME = iPicUploader; 512 | SDKROOT = macosx; 513 | SKIP_INSTALL = YES; 514 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 515 | SWIFT_VERSION = 5.0; 516 | VERSIONING_SYSTEM = "apple-generic"; 517 | VERSION_INFO_PREFIX = ""; 518 | }; 519 | name = Debug; 520 | }; 521 | C269F16C69C874215FB299057455A930 /* Debug */ = { 522 | isa = XCBuildConfiguration; 523 | buildSettings = { 524 | ALWAYS_SEARCH_USER_PATHS = NO; 525 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 526 | CLANG_ANALYZER_NONNULL = YES; 527 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 528 | CLANG_CXX_LIBRARY = "libc++"; 529 | CLANG_ENABLE_MODULES = YES; 530 | CLANG_ENABLE_OBJC_ARC = YES; 531 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 532 | CLANG_WARN_BOOL_CONVERSION = YES; 533 | CLANG_WARN_COMMA = YES; 534 | CLANG_WARN_CONSTANT_CONVERSION = YES; 535 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 536 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 537 | CLANG_WARN_EMPTY_BODY = YES; 538 | CLANG_WARN_ENUM_CONVERSION = YES; 539 | CLANG_WARN_INFINITE_RECURSION = YES; 540 | CLANG_WARN_INT_CONVERSION = YES; 541 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 542 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 543 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 544 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 545 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 546 | CLANG_WARN_STRICT_PROTOTYPES = YES; 547 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 548 | CLANG_WARN_UNREACHABLE_CODE = YES; 549 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 550 | CODE_SIGNING_REQUIRED = NO; 551 | COPY_PHASE_STRIP = NO; 552 | ENABLE_STRICT_OBJC_MSGSEND = YES; 553 | ENABLE_TESTABILITY = YES; 554 | GCC_C_LANGUAGE_STANDARD = gnu99; 555 | GCC_DYNAMIC_NO_PIC = NO; 556 | GCC_NO_COMMON_BLOCKS = YES; 557 | GCC_OPTIMIZATION_LEVEL = 0; 558 | GCC_PREPROCESSOR_DEFINITIONS = ( 559 | "POD_CONFIGURATION_DEBUG=1", 560 | "DEBUG=1", 561 | "$(inherited)", 562 | ); 563 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 564 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 565 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 566 | GCC_WARN_UNDECLARED_SELECTOR = YES; 567 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 568 | GCC_WARN_UNUSED_FUNCTION = YES; 569 | GCC_WARN_UNUSED_VARIABLE = YES; 570 | MACOSX_DEPLOYMENT_TARGET = 10.9; 571 | ONLY_ACTIVE_ARCH = YES; 572 | PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; 573 | STRIP_INSTALLED_PRODUCT = NO; 574 | SWIFT_VERSION = 5.0; 575 | SYMROOT = "${SRCROOT}/../build"; 576 | }; 577 | name = Debug; 578 | }; 579 | /* End XCBuildConfiguration section */ 580 | 581 | /* Begin XCConfigurationList section */ 582 | 1101D4E62526D3BEE09CEA4DA8B37D91 /* Build configuration list for PBXNativeTarget "iPicUploader" */ = { 583 | isa = XCConfigurationList; 584 | buildConfigurations = ( 585 | 7B55F8380C0C8B1DF0B393259BE9AA53 /* Debug */, 586 | 32D9F8554D3E5E3A05372EC885BD2115 /* Release */, 587 | ); 588 | defaultConfigurationIsVisible = 0; 589 | defaultConfigurationName = Release; 590 | }; 591 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 592 | isa = XCConfigurationList; 593 | buildConfigurations = ( 594 | C269F16C69C874215FB299057455A930 /* Debug */, 595 | 4ECF5F3A7DCBE32E59B23B0C7F362504 /* Release */, 596 | ); 597 | defaultConfigurationIsVisible = 0; 598 | defaultConfigurationName = Release; 599 | }; 600 | 74FBD6423B3867F74687DB2DA2B44F92 /* Build configuration list for PBXNativeTarget "Pods-iPicUploaderExample" */ = { 601 | isa = XCConfigurationList; 602 | buildConfigurations = ( 603 | 62BA7506CD3BBE2C35C74AD4CF804CB3 /* Debug */, 604 | 75538234C692FAF4AE1F3241116AF0EB /* Release */, 605 | ); 606 | defaultConfigurationIsVisible = 0; 607 | defaultConfigurationName = Release; 608 | }; 609 | /* End XCConfigurationList section */ 610 | }; 611 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 612 | } 613 | -------------------------------------------------------------------------------- /Example/iPicUploaderExample/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | Default 536 | 537 | 538 | 539 | 540 | 541 | 542 | Left to Right 543 | 544 | 545 | 546 | 547 | 548 | 549 | Right to Left 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | Default 561 | 562 | 563 | 564 | 565 | 566 | 567 | Left to Right 568 | 569 | 570 | 571 | 572 | 573 | 574 | Right to Left 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | --------------------------------------------------------------------------------