diff --git a/.gitignore b/.gitignore index fe16b89..4c801f9 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ Carthage/Build # `pod install` in .travis.yml # # Pods/ + + +.build \ No newline at end of file diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..f99b4b2 --- /dev/null +++ b/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version: 5.4 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "UICountingLabel", + platforms: [ + .iOS(.v8), + .tvOS(.v9) + ], + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "UICountingLabel", + targets: ["UICountingLabel"] + ), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "UICountingLabel", + dependencies: [], + path: "UICountingLabel/Classes", + publicHeadersPath: "include", + cSettings: [ + .headerSearchPath("**") + ] + ) + ] + +) diff --git a/UICountingLabel.podspec b/UICountingLabel.podspec index b54df7a..54f9764 100644 --- a/UICountingLabel.podspec +++ b/UICountingLabel.podspec @@ -9,5 +9,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = '7.0' s.tvos.deployment_target = '9.0' s.source_files = 'UICountingLabel/Classes/**/*' + s.private_header_files = 'UICountingLabel/Classes/include/**/*.h' s.requires_arc = true end diff --git a/UICountingLabel/Classes/UICountingLabel.m b/UICountingLabel/Classes/UICountingLabel.m index 137ee37..326555a 100755 --- a/UICountingLabel/Classes/UICountingLabel.m +++ b/UICountingLabel/Classes/UICountingLabel.m @@ -1,6 +1,9 @@ #import -#import "UICountingLabel.h" +#import "include/UICountingLabel.h" + +#if TARGET_OS_IOS || TARGET_OS_TV +@import UIKit; #if !__has_feature(objc_arc) #error UICountingLabel is ARC only. Either turn on ARC for the project or use -fobjc-arc flag @@ -292,3 +295,5 @@ - (CGFloat)currentValue { } @end + +#endif //TARGET_OS_IOS diff --git a/UICountingLabel/Classes/UICountingLabel.h b/UICountingLabel/Classes/include/UICountingLabel.h similarity index 91% rename from UICountingLabel/Classes/UICountingLabel.h rename to UICountingLabel/Classes/include/UICountingLabel.h index 5bb4e26..6df86f7 100755 --- a/UICountingLabel/Classes/UICountingLabel.h +++ b/UICountingLabel/Classes/include/UICountingLabel.h @@ -1,5 +1,8 @@ -#import -#import +@import Foundation; +@import CoreGraphics; + +#if TARGET_OS_IOS || TARGET_OS_TV +@import UIKit; typedef NS_ENUM(NSInteger, UILabelCountingMethod) { UILabelCountingMethodEaseInOut, @@ -36,3 +39,4 @@ typedef NSAttributedString* (^UICountingLabelAttributedFormatBlock)(CGFloat valu @end +#endif //TARGET_OS_IOS