From f6a47114c5024c2d1faa5b614ee6e1cb971cb35b Mon Sep 17 00:00:00 2001 From: EyreFree Date: Wed, 30 Jun 2021 16:53:25 +0800 Subject: [PATCH] feat: spm --- .gitignore | 3 +++ CHANGELOG.md | 6 ++++++ EFCountingLabel.podspec | 2 +- Package.swift | 4 ++-- README.md | 18 ++++++++++++++++++ README_CN.md | 17 +++++++++++++++++ 6 files changed, 47 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2cf5303..03be600 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,6 @@ Carthage # `pod install` in .travis.yml # # Pods/ + +# SPM +.build \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f07ab6..90f0256 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ----- +## [5.1.4](https://github.com/EFPrefix/EFCountingLabel/releases/tag/5.1.4) (2021-06-30) + +* Support SPM. + +--- + ## [5.1.3](https://github.com/EFPrefix/EFCountingLabel/releases/tag/5.1.3) (2021-06-20) * Compiler error "Ambiguous use of 'pow'" in xCode beta. [#32](https://github.com/EFPrefix/EFCountingLabel/pull/32) diff --git a/EFCountingLabel.podspec b/EFCountingLabel.podspec index 69b9fe3..8486134 100644 --- a/EFCountingLabel.podspec +++ b/EFCountingLabel.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'EFCountingLabel' - s.version = '5.1.3' + s.version = '5.1.4' s.summary = 'A label which can show number change animated.' s.description = <<-DESC diff --git a/Package.swift b/Package.swift index 51e6360..e903301 100644 --- a/Package.swift +++ b/Package.swift @@ -1,10 +1,10 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.0 import PackageDescription let package = Package( name: "EFCountingLabel", platforms: [ - .iOS(.v10), + .iOS(.v8), ], products: [ .library(name: "EFCountingLabel", targets: ["EFCountingLabel"]), diff --git a/README.md b/README.md index 8b8ea2e..d5fdae2 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ + + + @@ -47,12 +50,27 @@ To run the example project, clone the repo, and run `pod install` from the Examp ## Installation +### CocoaPods + EFCountingLabel is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby pod 'EFCountingLabel' ``` + +### Swift Package Manager + +The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the Swift compiler. + +Once you have your Swift package set up, adding EFCountingLabel as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. + +```swift +dependencies: [ + .package(url: "https://github.com/EFPrefix/EFCountingLabel.git", .upToNextMinor(from: "5.1.4")) +] +``` + ## Setup Simply initialize a `EFCountingLabel` the same way you set up a regular `UILabel`: diff --git a/README_CN.md b/README_CN.md index ea3fba1..b20589a 100644 --- a/README_CN.md +++ b/README_CN.md @@ -4,6 +4,9 @@ + + + @@ -58,6 +61,8 @@ git clone git@github.com:EFPrefix/EFCountingLabel.git; cd EFCountingLabel/Exampl ## 安装 +### CocoaPods + EFCountingLabel 可以通过 [CocoaPods](https://cocoapods.org) 进行获取。只需要在你的 Podfile 中添加如下代码就能实现引入: ```ruby @@ -70,6 +75,18 @@ pod 'EFCountingLabel' pod install ``` +### Swift Package Manager + +[Swift Package Manager](https://swift.org/package-manager/) 是一个集成在 Swift 编译器中的用来进行 Swift 代码自动化发布的工具。 + +如果你已经建立了你的 Swift 包,将 EFCountingLabel 加入依赖是十分容易的,只需要将其添加到你的 `Package.swift` 文件的 `dependencies` 项中即可: + +```swift +dependencies: [ + .package(url: "https://github.com/EFPrefix/EFCountingLabel.git", .upToNextMinor(from: "5.1.4")) +] +``` + ## 设置 初始化 `EFCountingLabel` 的方式和普通的 `UILabel` 是一样的: