Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add swift package #74

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ Carthage/Build
# `pod install` in .travis.yml
#
# Pods/


.build
37 changes: 37 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -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("**")
]
)
]

)
1 change: 1 addition & 0 deletions UICountingLabel.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion UICountingLabel/Classes/UICountingLabel.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#import <QuartzCore/QuartzCore.h>

#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
Expand Down Expand Up @@ -292,3 +295,5 @@ - (CGFloat)currentValue {
}

@end

#endif //TARGET_OS_IOS
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@import Foundation;
@import CoreGraphics;

#if TARGET_OS_IOS || TARGET_OS_TV
@import UIKit;

typedef NS_ENUM(NSInteger, UILabelCountingMethod) {
UILabelCountingMethodEaseInOut,
Expand Down Expand Up @@ -36,3 +39,4 @@ typedef NSAttributedString* (^UICountingLabelAttributedFormatBlock)(CGFloat valu

@end

#endif //TARGET_OS_IOS