onevcat hace 10 años
padre
commit
3c5127eda2
Se han modificado 4 ficheros con 47 adiciones y 12 borrados
  1. 1 0
      .gitignore
  2. 4 12
      Kingfisher.podspec
  3. 31 0
      Package.swift
  4. 11 0
      Sources/UIButton+Kingfisher.swift

+ 1 - 0
.gitignore

@@ -78,3 +78,4 @@ fastlane/test_output
 test_output
 fastlane/.env
 pre-change.yml
+.build

+ 4 - 12
Kingfisher.podspec

@@ -32,19 +32,11 @@ Pod::Spec.new do |s|
 
   s.source       = { :git => "https://github.com/onevcat/Kingfisher.git", :tag => s.version }
   
-  s.ios.source_files  = ["Sources/Kingfisher/*.swift", "Sources/Kingfisher/Kingfisher.h"]
-  s.ios.public_header_files = ["Sources/Kingfisher/Kingfisher.h"]
+  s.source_files  = ["Sources/*.swift", "Sources/Kingfisher.h"]
+  s.public_header_files = ["Sources/Kingfisher.h"]
   
-  s.osx.source_files  = ["Sources/Kingfisher/*.swift", "Sources/Kingfisher-OSX/Kingfisher-OSX.h"]
-  s.osx.exclude_files = "Sources/Kingfisher/UIButton+Kingfisher.swift"
-  s.osx.public_header_files = ["Sources/Kingfisher-OSX/Kingfisher-OSX.h"]
-  
-  s.tvos.source_files  = ["Sources/Kingfisher/*.swift", "Sources/Kingfisher-tvOS/Kingfisher-tvOS.h"]
-  s.tvos.public_header_files = ["Sources/Kingfisher-tvOS/Kingfisher-tvOS.h"]
-  
-  s.watchos.source_files  = ["Sources/Kingfisher/*.swift", "Sources/Kingfisher-watchOS/Kingfisher-watchOS.h"]
-  s.watchos.exclude_files = ["Sources/Kingfisher/UIButton+Kingfisher.swift", "Sources/Kingfisher/ImageView+Kingfisher.swift"]
-  s.watchos.public_header_files = ["Sources/Kingfisher-watchOS/Kingfisher-watchOS.h"]
+  s.osx.exclude_files = "Sources/UIButton+Kingfisher.swift"
+  s.watchos.exclude_files = ["Sources/UIButton+Kingfisher.swift", "Sources/ImageView+Kingfisher.swift"]
   
   s.requires_arc = true
   s.framework = "CFNetwork"

+ 31 - 0
Package.swift

@@ -0,0 +1,31 @@
+//
+//  Package.swift
+//  Kingfisher
+//
+//  Created by Wei Wang on 16/1/22.
+//
+//  Copyright (c) 2016 Wei Wang <onevcat@gmail.com>
+//
+//  Permission is hereby granted, free of charge, to any person obtaining a copy
+//  of this software and associated documentation files (the "Software"), to deal
+//  in the Software without restriction, including without limitation the rights
+//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+//  copies of the Software, and to permit persons to whom the Software is
+//  furnished to do so, subject to the following conditions:
+//
+//  The above copyright notice and this permission notice shall be included in
+//  all copies or substantial portions of the Software.
+//
+//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//  THE SOFTWARE.
+
+import PackageDescription
+
+let package = Package(
+  name: "Kingfisher"
+)

+ 11 - 0
Sources/UIButton+Kingfisher.swift

@@ -24,6 +24,8 @@
 //  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 //  THE SOFTWARE.
 
+#if os(iOS) || os(tvOS)
+
 import UIKit
 
 /**
@@ -524,3 +526,12 @@ extension UIButton {
         objc_setAssociatedObject(self, &lastBackgroundURLKey, URLs, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
     }
 }
+
+#elseif os(OSX)
+
+import AppKit
+extension NSButton {
+    // Not Implemented yet.
+}
+    
+#endif