From f651c44c5bbac2b598763e138082e5c5e66742a2 Mon Sep 17 00:00:00 2001 From: Ethan Huang Date: Sat, 20 Jul 2019 00:09:36 +0800 Subject: [PATCH] [Removed] OS version requirements of Package.swift #1 --- CHANGELOG.md | 3 +++ Package.swift | 1 - README.md | 2 +- Sources/NSAttributedStringBuilder/Components/Component.swift | 1 + .../ComponentParagraphSylteModifierTests.swift | 4 ++++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e863da4..d962172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [0.3.1] - 2019-07-20 +- [Removed] OS version requirements of Package.swift #1 + ## [0.3.0] - 2019-07-18 - [Changed] Replace UIKitForMac to macCatalyst to reflect the changes in beta 4 - [Changed] Replace .color() with .foregroundColor() to reflect the changes in beta 4 diff --git a/Package.swift b/Package.swift index 5b6302f..cc40469 100644 --- a/Package.swift +++ b/Package.swift @@ -5,7 +5,6 @@ import PackageDescription let package = Package( name: "NSAttributedStringBuilder", - platforms: [.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)], products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( diff --git a/README.md b/README.md index b6ba541..bdc0b92 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ let attributedString = NSAttributedString { ``` ## Requirements -Xcode 11 beta 4, iOS 13, macOS 10.15, tvOS 13, or watchOS 13, because it uses Swift 5.1 features like [Function Builder](https://forums.swift.org/t/function-builders/25167). +Xcode 11 beta 4. This project uses Swift 5.1 feature [Function Builder](https://forums.swift.org/t/function-builders/25167). ## Installation Please use **Swift Package Manager** to install. diff --git a/Sources/NSAttributedStringBuilder/Components/Component.swift b/Sources/NSAttributedStringBuilder/Components/Component.swift index 1eaf23a..307524a 100644 --- a/Sources/NSAttributedStringBuilder/Components/Component.swift +++ b/Sources/NSAttributedStringBuilder/Components/Component.swift @@ -209,6 +209,7 @@ extension Component { return self.paragraphStyle(paragraphStyle) } + @available(iOS 9.0, tvOS 9.0, watchOS 2.0, OSX 10.11, *) public func allowsDefaultTighteningForTruncation() -> Component { let paragraphStyle = getMutableParagraphStyle() paragraphStyle.allowsDefaultTighteningForTruncation = true diff --git a/Tests/NSAttributedStringBuilderTests/ComponentParagraphSylteModifierTests.swift b/Tests/NSAttributedStringBuilderTests/ComponentParagraphSylteModifierTests.swift index 9510a13..c9a40d3 100644 --- a/Tests/NSAttributedStringBuilderTests/ComponentParagraphSylteModifierTests.swift +++ b/Tests/NSAttributedStringBuilderTests/ComponentParagraphSylteModifierTests.swift @@ -255,6 +255,7 @@ final class ComponentParagraphSylteModifierTests: XCTestCase { XCTAssertTrue(sut.isEqual(testData)) } + @available(iOS 9.0, tvOS 9.0, watchOS 2.0, OSX 10.11, *) func testAllowsDefaultTighteningForTruncation() { let testData: NSAttributedString = { let paragraphStyle = NSMutableParagraphStyle() @@ -322,6 +323,7 @@ final class ComponentParagraphSylteModifierTests: XCTestCase { XCTAssertTrue(sut.isEqual(testData)) } + @available(OSX 10.13, *) func testModifyTextList() { let textList = NSTextList(markerFormat: .box, options: 0) @@ -385,6 +387,7 @@ final class ComponentParagraphSylteModifierTests: XCTestCase { } #endif + @available(iOS 9.0, tvOS 9.0, watchOS 2.0, OSX 10.11, *) func testChaining() { let testData: NSAttributedString = { let paragraphStyle = NSMutableParagraphStyle() @@ -428,6 +431,7 @@ final class ComponentParagraphSylteModifierTests: XCTestCase { XCTAssertTrue(sut.isEqual(testData)) } + @available(iOS 9.0, tvOS 9.0, watchOS 2.0, OSX 10.11, *) func testRandomChainingOrderEqualness() { let sut = NSAttributedString { AText("Hello world")