├── .gitignore ├── LICENSE ├── Podfile ├── Podfile.lock ├── QiniuMacUploader.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── QiniuMacUploader.xcworkspace └── contents.xcworkspacedata ├── QiniuMacUploader ├── AppDelegate.swift ├── AppMainWindow.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── cloud-upload-outline.imageset │ │ ├── Contents.json │ │ └── cloud-upload-outline@2x.png │ └── copy_icon.imageset │ │ ├── Contents.json │ │ └── copy_icon@2x.png ├── Base.lproj │ └── Main.storyboard ├── DragDropView.swift ├── Info.plist └── ViewController.swift ├── README.md └── screenshot@2x.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 isaced 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :osx, '10.11' 3 | 4 | target 'QiniuMacUploader' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for QiniuMacUploader 9 | pod "QiniuUpload" 10 | 11 | end 12 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - QiniuUpload (2.0.2) 3 | 4 | DEPENDENCIES: 5 | - QiniuUpload 6 | 7 | SPEC CHECKSUMS: 8 | QiniuUpload: 577ffa610f08c127f95c5e85b54f706bd670cff8 9 | 10 | PODFILE CHECKSUM: e5ccef326d5075d666d94fe8673798ab0e5de721 11 | 12 | COCOAPODS: 1.2.0 13 | -------------------------------------------------------------------------------- /QiniuMacUploader.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0BE34A0A1DE69C4400C43AE6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE34A091DE69C4400C43AE6 /* AppDelegate.swift */; }; 11 | 0BE34A0C1DE69C4400C43AE6 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE34A0B1DE69C4400C43AE6 /* ViewController.swift */; }; 12 | 0BE34A0E1DE69C4400C43AE6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0BE34A0D1DE69C4400C43AE6 /* Assets.xcassets */; }; 13 | 0BE34A111DE69C4400C43AE6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0BE34A0F1DE69C4400C43AE6 /* Main.storyboard */; }; 14 | 0BE34A191DE6B85900C43AE6 /* AppMainWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE34A181DE6B85900C43AE6 /* AppMainWindow.swift */; }; 15 | 0BE34A1B1DE6C0E900C43AE6 /* DragDropView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE34A1A1DE6C0E900C43AE6 /* DragDropView.swift */; }; 16 | C8401E9065F3C723E4DE1C7C /* Pods_QiniuMacUploader.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4025A04FAEFEF7FB1EF46F25 /* Pods_QiniuMacUploader.framework */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 0BE34A061DE69C4400C43AE6 /* QiniuMacUploader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QiniuMacUploader.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 0BE34A091DE69C4400C43AE6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22 | 0BE34A0B1DE69C4400C43AE6 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 23 | 0BE34A0D1DE69C4400C43AE6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 24 | 0BE34A101DE69C4400C43AE6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 25 | 0BE34A121DE69C4400C43AE6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26 | 0BE34A181DE6B85900C43AE6 /* AppMainWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppMainWindow.swift; sourceTree = ""; }; 27 | 0BE34A1A1DE6C0E900C43AE6 /* DragDropView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DragDropView.swift; sourceTree = ""; }; 28 | 4025A04FAEFEF7FB1EF46F25 /* Pods_QiniuMacUploader.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_QiniuMacUploader.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 755F5F319A8C049DC537A887 /* Pods-QiniuMacUploader.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuMacUploader.debug.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuMacUploader/Pods-QiniuMacUploader.debug.xcconfig"; sourceTree = ""; }; 30 | 8278CFB4E61768457176A17A /* Pods-QiniuMacUploader.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QiniuMacUploader.release.xcconfig"; path = "Pods/Target Support Files/Pods-QiniuMacUploader/Pods-QiniuMacUploader.release.xcconfig"; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 0BE34A031DE69C4400C43AE6 /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | C8401E9065F3C723E4DE1C7C /* Pods_QiniuMacUploader.framework in Frameworks */, 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 0BE349FD1DE69C4400C43AE6 = { 46 | isa = PBXGroup; 47 | children = ( 48 | 0BE34A081DE69C4400C43AE6 /* QiniuMacUploader */, 49 | 0BE34A071DE69C4400C43AE6 /* Products */, 50 | EAFB307D65B0D2ED53B833DA /* Pods */, 51 | C26087D6DDBF93D4DD59FABF /* Frameworks */, 52 | ); 53 | sourceTree = ""; 54 | }; 55 | 0BE34A071DE69C4400C43AE6 /* Products */ = { 56 | isa = PBXGroup; 57 | children = ( 58 | 0BE34A061DE69C4400C43AE6 /* QiniuMacUploader.app */, 59 | ); 60 | name = Products; 61 | sourceTree = ""; 62 | }; 63 | 0BE34A081DE69C4400C43AE6 /* QiniuMacUploader */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | 0BE34A091DE69C4400C43AE6 /* AppDelegate.swift */, 67 | 0BE34A181DE6B85900C43AE6 /* AppMainWindow.swift */, 68 | 0BE34A0B1DE69C4400C43AE6 /* ViewController.swift */, 69 | 0BE34A1A1DE6C0E900C43AE6 /* DragDropView.swift */, 70 | 0BE34A0D1DE69C4400C43AE6 /* Assets.xcassets */, 71 | 0BE34A0F1DE69C4400C43AE6 /* Main.storyboard */, 72 | 0BE34A121DE69C4400C43AE6 /* Info.plist */, 73 | ); 74 | path = QiniuMacUploader; 75 | sourceTree = ""; 76 | }; 77 | C26087D6DDBF93D4DD59FABF /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 4025A04FAEFEF7FB1EF46F25 /* Pods_QiniuMacUploader.framework */, 81 | ); 82 | name = Frameworks; 83 | sourceTree = ""; 84 | }; 85 | EAFB307D65B0D2ED53B833DA /* Pods */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 755F5F319A8C049DC537A887 /* Pods-QiniuMacUploader.debug.xcconfig */, 89 | 8278CFB4E61768457176A17A /* Pods-QiniuMacUploader.release.xcconfig */, 90 | ); 91 | name = Pods; 92 | sourceTree = ""; 93 | }; 94 | /* End PBXGroup section */ 95 | 96 | /* Begin PBXNativeTarget section */ 97 | 0BE34A051DE69C4400C43AE6 /* QiniuMacUploader */ = { 98 | isa = PBXNativeTarget; 99 | buildConfigurationList = 0BE34A151DE69C4400C43AE6 /* Build configuration list for PBXNativeTarget "QiniuMacUploader" */; 100 | buildPhases = ( 101 | 470E972A2AC50530B537382E /* [CP] Check Pods Manifest.lock */, 102 | 0BE34A021DE69C4400C43AE6 /* Sources */, 103 | 0BE34A031DE69C4400C43AE6 /* Frameworks */, 104 | 0BE34A041DE69C4400C43AE6 /* Resources */, 105 | 010FEB756ECC7F8884215655 /* [CP] Embed Pods Frameworks */, 106 | E110AE73782A2DF2C955FD9B /* [CP] Copy Pods Resources */, 107 | ); 108 | buildRules = ( 109 | ); 110 | dependencies = ( 111 | ); 112 | name = QiniuMacUploader; 113 | productName = QiniuMacUploader; 114 | productReference = 0BE34A061DE69C4400C43AE6 /* QiniuMacUploader.app */; 115 | productType = "com.apple.product-type.application"; 116 | }; 117 | /* End PBXNativeTarget section */ 118 | 119 | /* Begin PBXProject section */ 120 | 0BE349FE1DE69C4400C43AE6 /* Project object */ = { 121 | isa = PBXProject; 122 | attributes = { 123 | LastSwiftUpdateCheck = 0810; 124 | LastUpgradeCheck = 0810; 125 | TargetAttributes = { 126 | 0BE34A051DE69C4400C43AE6 = { 127 | CreatedOnToolsVersion = 8.1; 128 | ProvisioningStyle = Automatic; 129 | }; 130 | }; 131 | }; 132 | buildConfigurationList = 0BE34A011DE69C4400C43AE6 /* Build configuration list for PBXProject "QiniuMacUploader" */; 133 | compatibilityVersion = "Xcode 3.2"; 134 | developmentRegion = English; 135 | hasScannedForEncodings = 0; 136 | knownRegions = ( 137 | en, 138 | Base, 139 | ); 140 | mainGroup = 0BE349FD1DE69C4400C43AE6; 141 | productRefGroup = 0BE34A071DE69C4400C43AE6 /* Products */; 142 | projectDirPath = ""; 143 | projectRoot = ""; 144 | targets = ( 145 | 0BE34A051DE69C4400C43AE6 /* QiniuMacUploader */, 146 | ); 147 | }; 148 | /* End PBXProject section */ 149 | 150 | /* Begin PBXResourcesBuildPhase section */ 151 | 0BE34A041DE69C4400C43AE6 /* Resources */ = { 152 | isa = PBXResourcesBuildPhase; 153 | buildActionMask = 2147483647; 154 | files = ( 155 | 0BE34A0E1DE69C4400C43AE6 /* Assets.xcassets in Resources */, 156 | 0BE34A111DE69C4400C43AE6 /* Main.storyboard in Resources */, 157 | ); 158 | runOnlyForDeploymentPostprocessing = 0; 159 | }; 160 | /* End PBXResourcesBuildPhase section */ 161 | 162 | /* Begin PBXShellScriptBuildPhase section */ 163 | 010FEB756ECC7F8884215655 /* [CP] Embed Pods Frameworks */ = { 164 | isa = PBXShellScriptBuildPhase; 165 | buildActionMask = 2147483647; 166 | files = ( 167 | ); 168 | inputPaths = ( 169 | ); 170 | name = "[CP] Embed Pods Frameworks"; 171 | outputPaths = ( 172 | ); 173 | runOnlyForDeploymentPostprocessing = 0; 174 | shellPath = /bin/sh; 175 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QiniuMacUploader/Pods-QiniuMacUploader-frameworks.sh\"\n"; 176 | showEnvVarsInLog = 0; 177 | }; 178 | 470E972A2AC50530B537382E /* [CP] Check Pods Manifest.lock */ = { 179 | isa = PBXShellScriptBuildPhase; 180 | buildActionMask = 2147483647; 181 | files = ( 182 | ); 183 | inputPaths = ( 184 | ); 185 | name = "[CP] Check Pods Manifest.lock"; 186 | outputPaths = ( 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | shellPath = /bin/sh; 190 | 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"; 191 | showEnvVarsInLog = 0; 192 | }; 193 | E110AE73782A2DF2C955FD9B /* [CP] Copy Pods Resources */ = { 194 | isa = PBXShellScriptBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | ); 198 | inputPaths = ( 199 | ); 200 | name = "[CP] Copy Pods Resources"; 201 | outputPaths = ( 202 | ); 203 | runOnlyForDeploymentPostprocessing = 0; 204 | shellPath = /bin/sh; 205 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QiniuMacUploader/Pods-QiniuMacUploader-resources.sh\"\n"; 206 | showEnvVarsInLog = 0; 207 | }; 208 | /* End PBXShellScriptBuildPhase section */ 209 | 210 | /* Begin PBXSourcesBuildPhase section */ 211 | 0BE34A021DE69C4400C43AE6 /* Sources */ = { 212 | isa = PBXSourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | 0BE34A0C1DE69C4400C43AE6 /* ViewController.swift in Sources */, 216 | 0BE34A191DE6B85900C43AE6 /* AppMainWindow.swift in Sources */, 217 | 0BE34A0A1DE69C4400C43AE6 /* AppDelegate.swift in Sources */, 218 | 0BE34A1B1DE6C0E900C43AE6 /* DragDropView.swift in Sources */, 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | /* End PBXSourcesBuildPhase section */ 223 | 224 | /* Begin PBXVariantGroup section */ 225 | 0BE34A0F1DE69C4400C43AE6 /* Main.storyboard */ = { 226 | isa = PBXVariantGroup; 227 | children = ( 228 | 0BE34A101DE69C4400C43AE6 /* Base */, 229 | ); 230 | name = Main.storyboard; 231 | sourceTree = ""; 232 | }; 233 | /* End PBXVariantGroup section */ 234 | 235 | /* Begin XCBuildConfiguration section */ 236 | 0BE34A131DE69C4400C43AE6 /* Debug */ = { 237 | isa = XCBuildConfiguration; 238 | buildSettings = { 239 | ALWAYS_SEARCH_USER_PATHS = NO; 240 | CLANG_ANALYZER_NONNULL = YES; 241 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 242 | CLANG_CXX_LIBRARY = "libc++"; 243 | CLANG_ENABLE_MODULES = YES; 244 | CLANG_ENABLE_OBJC_ARC = YES; 245 | CLANG_WARN_BOOL_CONVERSION = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 248 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 254 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 255 | CLANG_WARN_UNREACHABLE_CODE = YES; 256 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 257 | CODE_SIGN_IDENTITY = "-"; 258 | COPY_PHASE_STRIP = NO; 259 | DEBUG_INFORMATION_FORMAT = dwarf; 260 | ENABLE_STRICT_OBJC_MSGSEND = YES; 261 | ENABLE_TESTABILITY = YES; 262 | GCC_C_LANGUAGE_STANDARD = gnu99; 263 | GCC_DYNAMIC_NO_PIC = NO; 264 | GCC_NO_COMMON_BLOCKS = YES; 265 | GCC_OPTIMIZATION_LEVEL = 0; 266 | GCC_PREPROCESSOR_DEFINITIONS = ( 267 | "DEBUG=1", 268 | "$(inherited)", 269 | ); 270 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 271 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 272 | GCC_WARN_UNDECLARED_SELECTOR = YES; 273 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 274 | GCC_WARN_UNUSED_FUNCTION = YES; 275 | GCC_WARN_UNUSED_VARIABLE = YES; 276 | MACOSX_DEPLOYMENT_TARGET = 10.12; 277 | MTL_ENABLE_DEBUG_INFO = YES; 278 | ONLY_ACTIVE_ARCH = YES; 279 | SDKROOT = macosx; 280 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 281 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 282 | }; 283 | name = Debug; 284 | }; 285 | 0BE34A141DE69C4400C43AE6 /* Release */ = { 286 | isa = XCBuildConfiguration; 287 | buildSettings = { 288 | ALWAYS_SEARCH_USER_PATHS = NO; 289 | CLANG_ANALYZER_NONNULL = YES; 290 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 291 | CLANG_CXX_LIBRARY = "libc++"; 292 | CLANG_ENABLE_MODULES = YES; 293 | CLANG_ENABLE_OBJC_ARC = YES; 294 | CLANG_WARN_BOOL_CONVERSION = YES; 295 | CLANG_WARN_CONSTANT_CONVERSION = YES; 296 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 297 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 298 | CLANG_WARN_EMPTY_BODY = YES; 299 | CLANG_WARN_ENUM_CONVERSION = YES; 300 | CLANG_WARN_INFINITE_RECURSION = YES; 301 | CLANG_WARN_INT_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 304 | CLANG_WARN_UNREACHABLE_CODE = YES; 305 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 306 | CODE_SIGN_IDENTITY = "-"; 307 | COPY_PHASE_STRIP = NO; 308 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 309 | ENABLE_NS_ASSERTIONS = NO; 310 | ENABLE_STRICT_OBJC_MSGSEND = YES; 311 | GCC_C_LANGUAGE_STANDARD = gnu99; 312 | GCC_NO_COMMON_BLOCKS = YES; 313 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 314 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 315 | GCC_WARN_UNDECLARED_SELECTOR = YES; 316 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 317 | GCC_WARN_UNUSED_FUNCTION = YES; 318 | GCC_WARN_UNUSED_VARIABLE = YES; 319 | MACOSX_DEPLOYMENT_TARGET = 10.12; 320 | MTL_ENABLE_DEBUG_INFO = NO; 321 | SDKROOT = macosx; 322 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 323 | }; 324 | name = Release; 325 | }; 326 | 0BE34A161DE69C4400C43AE6 /* Debug */ = { 327 | isa = XCBuildConfiguration; 328 | baseConfigurationReference = 755F5F319A8C049DC537A887 /* Pods-QiniuMacUploader.debug.xcconfig */; 329 | buildSettings = { 330 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 331 | COMBINE_HIDPI_IMAGES = YES; 332 | INFOPLIST_FILE = QiniuMacUploader/Info.plist; 333 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 334 | PRODUCT_BUNDLE_IDENTIFIER = com.isaced.QiniuMacUploader; 335 | PRODUCT_NAME = "$(TARGET_NAME)"; 336 | SWIFT_VERSION = 3.0; 337 | }; 338 | name = Debug; 339 | }; 340 | 0BE34A171DE69C4400C43AE6 /* Release */ = { 341 | isa = XCBuildConfiguration; 342 | baseConfigurationReference = 8278CFB4E61768457176A17A /* Pods-QiniuMacUploader.release.xcconfig */; 343 | buildSettings = { 344 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 345 | COMBINE_HIDPI_IMAGES = YES; 346 | INFOPLIST_FILE = QiniuMacUploader/Info.plist; 347 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 348 | PRODUCT_BUNDLE_IDENTIFIER = com.isaced.QiniuMacUploader; 349 | PRODUCT_NAME = "$(TARGET_NAME)"; 350 | SWIFT_VERSION = 3.0; 351 | }; 352 | name = Release; 353 | }; 354 | /* End XCBuildConfiguration section */ 355 | 356 | /* Begin XCConfigurationList section */ 357 | 0BE34A011DE69C4400C43AE6 /* Build configuration list for PBXProject "QiniuMacUploader" */ = { 358 | isa = XCConfigurationList; 359 | buildConfigurations = ( 360 | 0BE34A131DE69C4400C43AE6 /* Debug */, 361 | 0BE34A141DE69C4400C43AE6 /* Release */, 362 | ); 363 | defaultConfigurationIsVisible = 0; 364 | defaultConfigurationName = Release; 365 | }; 366 | 0BE34A151DE69C4400C43AE6 /* Build configuration list for PBXNativeTarget "QiniuMacUploader" */ = { 367 | isa = XCConfigurationList; 368 | buildConfigurations = ( 369 | 0BE34A161DE69C4400C43AE6 /* Debug */, 370 | 0BE34A171DE69C4400C43AE6 /* Release */, 371 | ); 372 | defaultConfigurationIsVisible = 0; 373 | }; 374 | /* End XCConfigurationList section */ 375 | }; 376 | rootObject = 0BE349FE1DE69C4400C43AE6 /* Project object */; 377 | } 378 | -------------------------------------------------------------------------------- /QiniuMacUploader.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /QiniuMacUploader.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /QiniuMacUploader/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // QiniuMacUploader 4 | // 5 | // Created by feeling on 2016/11/24. 6 | // 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | 15 | func applicationDidFinishLaunching(_ aNotification: Notification) { 16 | NSApplication.shared().keyWindow?.titlebarAppearsTransparent = true // gives it "flat" look 17 | 18 | } 19 | 20 | func applicationWillTerminate(_ aNotification: Notification) { 21 | // Insert code here to tear down your application 22 | } 23 | 24 | func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 25 | return true 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /QiniuMacUploader/AppMainWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppMainWindow.swift 3 | // QiniuMacUploader 4 | // 5 | // Created by feeling on 2016/11/24. 6 | // 7 | // 8 | 9 | import AppKit 10 | 11 | class AppMainWindow: NSWindow { 12 | 13 | override init(contentRect: NSRect, styleMask style: NSWindowStyleMask, backing bufferingType: NSBackingStoreType, defer flag: Bool) { 14 | super.init(contentRect: contentRect, styleMask: style, backing: bufferingType, defer: flag) 15 | 16 | self.titlebarAppearsTransparent = true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /QiniuMacUploader/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /QiniuMacUploader/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /QiniuMacUploader/Assets.xcassets/cloud-upload-outline.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "cloud-upload-outline@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /QiniuMacUploader/Assets.xcassets/cloud-upload-outline.imageset/cloud-upload-outline@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isaced/QiniuMacUploader/d434e2cb6012873154484d322bdddf6e81c08718/QiniuMacUploader/Assets.xcassets/cloud-upload-outline.imageset/cloud-upload-outline@2x.png -------------------------------------------------------------------------------- /QiniuMacUploader/Assets.xcassets/copy_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "copy_icon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /QiniuMacUploader/Assets.xcassets/copy_icon.imageset/copy_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isaced/QiniuMacUploader/d434e2cb6012873154484d322bdddf6e81c08718/QiniuMacUploader/Assets.xcassets/copy_icon.imageset/copy_icon@2x.png -------------------------------------------------------------------------------- /QiniuMacUploader/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 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 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /QiniuMacUploader/DragDropView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DragDropView.swift 3 | // QiniuMacUploader 4 | // 5 | // Created by feeling on 2016/11/24. 6 | // 7 | // 8 | 9 | import Cocoa 10 | 11 | class DragDropView: NSImageView { 12 | 13 | let acceptableTypes: Set = [NSFilenamesPboardType] 14 | let filteringOptions = [NSPasteboardURLReadingContentsConformToTypesKey:NSImage.imageTypes()] 15 | var isReceivingDrag = false { 16 | didSet { 17 | needsDisplay = true 18 | } 19 | } 20 | var dragDropFileURLs:(([URL]) -> ())? 21 | 22 | //MARK: - Life 23 | required init?(coder: NSCoder) { 24 | super.init(coder: coder) 25 | 26 | setup() 27 | } 28 | 29 | override func draw(_ dirtyRect: NSRect) { 30 | super.draw(dirtyRect) 31 | 32 | if isReceivingDrag { 33 | NSColor.selectedControlColor.set() 34 | }else{ 35 | NSColor.lightGray.set() 36 | } 37 | 38 | let path = NSBezierPath(rect:bounds) 39 | path.lineWidth = 2 40 | path.stroke() 41 | } 42 | 43 | func setup() { 44 | register(forDraggedTypes: Array(acceptableTypes)) 45 | } 46 | 47 | func shouldAllowDrag(_ draggingInfo: NSDraggingInfo) -> Bool { 48 | var canAccept = false 49 | let pasteBoard = draggingInfo.draggingPasteboard() 50 | if pasteBoard.canReadObject(forClasses: [NSURL.self], options: filteringOptions) { 51 | canAccept = true 52 | } 53 | return canAccept 54 | 55 | } 56 | 57 | //MARK: - 58 | override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation { 59 | let allow = shouldAllowDrag(sender) 60 | isReceivingDrag = allow 61 | return allow ? .copy : NSDragOperation() 62 | } 63 | 64 | override func draggingExited(_ sender: NSDraggingInfo?) { 65 | isReceivingDrag = false 66 | } 67 | 68 | override func prepareForDragOperation(_ sender: NSDraggingInfo) -> Bool { 69 | return shouldAllowDrag(sender) 70 | } 71 | 72 | override func performDragOperation(_ sender: NSDraggingInfo) -> Bool { 73 | isReceivingDrag = false 74 | let pasteBoard = sender.draggingPasteboard() 75 | if let urls = pasteBoard.readObjects(forClasses: [NSURL.self], options:filteringOptions) as? [URL], urls.count > 0 { 76 | self.dragDropFileURLs?(urls) 77 | return true 78 | } 79 | return false 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /QiniuMacUploader/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 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSMainStoryboardFile 26 | Main 27 | NSPrincipalClass 28 | NSApplication 29 | 30 | 31 | -------------------------------------------------------------------------------- /QiniuMacUploader/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // QiniuMacUploader 4 | // 5 | // Created by feeling on 2016/11/24. 6 | // 7 | // 8 | 9 | import Cocoa 10 | import QiniuUpload 11 | 12 | class ViewController: NSViewController { 13 | 14 | @IBOutlet weak var dragDropView: DragDropView! 15 | 16 | @IBOutlet weak var urlTextField: NSTextField! 17 | 18 | let scope = "" // Bucket 19 | let accessKey = "" // AK 20 | let secretKey = "" // SK 21 | let rootDomain = "" // Domain, for join final link and show 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | QiniuToken.register(withScope: self.scope, secretKey: self.secretKey, accesskey: self.accessKey) 27 | 28 | dragDropView.dragDropFileURLs = { urls in 29 | print(urls) 30 | if let url = urls.first { 31 | if let uploadToken = QiniuToken.shared().uploadToken(){ 32 | if let file = QiniuFile(path: url.path) { 33 | print("start upload : \(url)") 34 | 35 | self.urlTextField.stringValue = "" 36 | 37 | let uploader = QiniuUploader() 38 | uploader.addFile(file) 39 | uploader.startUpload(withAccessToken: uploadToken) 40 | uploader.uploadOneFileSucceeded = { index, key, info in 41 | print("upload succeeded : \(index) - \(key)") 42 | 43 | let url = "\(self.rootDomain)/\(key)" 44 | self.urlTextField.stringValue = url 45 | } 46 | uploader.uploadOneFileFailed = { index, error in 47 | print("upload Failed : \(index) - \(error)") 48 | 49 | self.urlTextField.stringValue = "" 50 | } 51 | uploader.uploadAllFilesComplete = { 52 | print("upload complete...") 53 | } 54 | } 55 | } 56 | } 57 | } 58 | 59 | 60 | } 61 | 62 | @IBAction func _tapCopyButton(_ sender: NSButton) { 63 | if self.urlTextField.stringValue.characters.count > 0 { 64 | NSPasteboard.general().declareTypes([NSStringPboardType], owner: nil) 65 | NSPasteboard.general().setString(self.urlTextField.stringValue, forType: NSStringPboardType) 66 | } 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QiniuMacUploader 2 | Mac 平台的七牛云拖拽上传小工具 3 | 4 | screenshot 5 | 6 | ### 开始 🏋 7 | 8 | 暂时需要自己在 `ViewController.swift` 中配置七牛相关密钥,后面会做成配置项方便灵活使用。 9 | 10 | ``` 11 | let scope = "" 12 | let accessKey = "" 13 | let secretKey = "" 14 | let rootDomain = "" 15 | ``` 16 | 17 | ### 感谢 🔨 18 | 19 | 没有直接使用七牛官方的 SDK,用了 @huhuanming 童鞋写的一个七牛 SDK,支持本地直接生成 token,而且没有其他第三方依赖很清爽。 20 | 21 | - [huhuanming/qiniu_upload](https://github.com/huhuanming/qiniu_upload) 22 | -------------------------------------------------------------------------------- /screenshot@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isaced/QiniuMacUploader/d434e2cb6012873154484d322bdddf6e81c08718/screenshot@2x.png --------------------------------------------------------------------------------