Skip to content

Commit

Permalink
Merge pull request #32 from jrsaruo/release-1.1.2
Browse files Browse the repository at this point in the history
Release 1.1.2
  • Loading branch information
jrsaruo committed Mar 30, 2024
2 parents fbb479a + 2136603 commit b7ef870
Show file tree
Hide file tree
Showing 29 changed files with 1,936 additions and 834 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/test.yml
Expand Up @@ -13,14 +13,14 @@ env:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test_on_macos:
runs-on: macos-latest
runs-on: macos-14

env:
CODECOV_PATH: "./coverage.lcov"

steps:
# Checks-out the repository under $GITHUB_WORKSPACE, so this job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build for macOS
run: swift build
Expand All @@ -38,21 +38,22 @@ jobs:
> ${{ env.CODECOV_PATH }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ env.CODECOV_PATH }}
fail_ci_if_error: true
verbose: true

test_on_ios:
runs-on: macos-latest
runs-on: macos-14

env:
IOS_SIMULATOR: "iPhone 13"
IOS_SIMULATOR: "iPhone 15"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build for iOS
run: xcodebuild build -scheme ${{ env.package }} -destination "name=${{ env.IOS_SIMULATOR }}"
Expand All @@ -61,13 +62,13 @@ jobs:
run: xcodebuild test -scheme ${{ env.package }} -destination "name=${{ env.IOS_SIMULATOR }}"

test_on_tvos:
runs-on: macos-latest
runs-on: macos-14

env:
TVOS_SIMULATOR: "Apple TV"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build for tvOS
run: xcodebuild build -scheme ${{ env.package }} -destination "name=${{ env.TVOS_SIMULATOR }}"
Expand Down
15 changes: 8 additions & 7 deletions Package.swift
@@ -1,16 +1,14 @@
// swift-tools-version:5.5
// swift-tools-version: 5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "AceLayout",
platforms: [.iOS(.v9), .macOS(.v10_11), .tvOS(.v9)],
platforms: [.iOS(.v11), .macOS(.v10_13), .tvOS(.v11)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "AceLayout",
targets: ["AceLayout"]),
.library(name: "AceLayout", targets: ["AceLayout"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
Expand All @@ -21,9 +19,12 @@ let package = Package(
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "AceLayout",
dependencies: []),
dependencies: [],
swiftSettings: [.enableUpcomingFeature("ExistentialAny")]
),
.testTarget(
name: "AceLayoutTests",
dependencies: ["AceLayout"]),
dependencies: ["AceLayout"]
),
]
)
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -6,9 +6,9 @@ AceLayout provides a Swifty DSL for Auto Layout.

## Requirements

- iOS 9.0+ / macOS 10.11+ / tvOS 9.0+
- Xcode 14+
- Swift 5.7+
- iOS 11.0+ / macOS 10.13+ / tvOS 11.0+
- Xcode 14.3+
- Swift 5.8+

## Features

Expand Down Expand Up @@ -175,7 +175,7 @@ view.autoLayout { item in
To use the `AceLayout` library in a SwiftPM project, add the following line to the dependencies in your `Package.swift` file:

```swift
.package(url: "https://github.com/jrsaruo/AceLayout", from: "1.1.1"),
.package(url: "https://github.com/jrsaruo/AceLayout", from: "1.1.2"),
```

and add `AceLayout` as a dependency for your target:
Expand Down
30 changes: 21 additions & 9 deletions Sources/AceLayout/LayoutAnchors/BaselineAnchor.swift
Expand Up @@ -34,8 +34,10 @@ extension BaselineAnchor {
/// - offset: A constant offset for the constraint. The default value is `0`.
/// - Returns: An `NSLayoutConstraint` object that represents `self` baseline == `another` baseline + `offset`.
@inlinable
public func equal(to another: some BaselinesConstrainable,
plus offset: CGFloat = 0) -> NSLayoutConstraint {
public func equal(
to another: some BaselinesConstrainable,
plus offset: CGFloat = 0
) -> NSLayoutConstraint {
anchor.constraint(equalTo: another[keyPath: anchorKeyPath], constant: offset)
}

Expand All @@ -53,8 +55,10 @@ extension BaselineAnchor {
/// - offset: A constant offset for the constraint. The default value is `0`.
/// - Returns: An `NSLayoutConstraint` object that represents `self` baseline <= `another` baseline + `offset`.
@inlinable
public func lessThanOrEqual(to another: some BaselinesConstrainable,
plus offset: CGFloat = 0) -> NSLayoutConstraint {
public func lessThanOrEqual(
to another: some BaselinesConstrainable,
plus offset: CGFloat = 0
) -> NSLayoutConstraint {
anchor.constraint(lessThanOrEqualTo: another[keyPath: anchorKeyPath], constant: offset)
}

Expand All @@ -72,8 +76,10 @@ extension BaselineAnchor {
/// - offset: A constant offset for the constraint. The default value is `0`.
/// - Returns: An `NSLayoutConstraint` object that represents `self` baseline >= `another` baseline + `offset`.
@inlinable
public func greaterThanOrEqual(to another: some BaselinesConstrainable,
plus offset: CGFloat = 0) -> NSLayoutConstraint {
public func greaterThanOrEqual(
to another: some BaselinesConstrainable,
plus offset: CGFloat = 0
) -> NSLayoutConstraint {
anchor.constraint(greaterThanOrEqualTo: another[keyPath: anchorKeyPath], constant: offset)
}

Expand All @@ -93,7 +99,9 @@ extension BaselineAnchor {
/// - Returns: An `NSLayoutConstraint` object that represents `self` baseline == `superview` baseline + `offset`.
public func equalToSuperview(plus offset: CGFloat = 0) -> NSLayoutConstraint {
guard let superview = target.superview else {
preconditionFailure("The layout target must have a superview before making constraints on it.")
preconditionFailure(
"The layout target must have a superview before making constraints on it."
)
}
return equal(to: superview, plus: offset)
}
Expand All @@ -112,7 +120,9 @@ extension BaselineAnchor {
/// - Returns: An `NSLayoutConstraint` object that represents `self` baseline <= `superview` baseline + `offset`.
public func lessThanOrEqualToSuperview(plus offset: CGFloat = 0) -> NSLayoutConstraint {
guard let superview = target.superview else {
preconditionFailure("The layout target must have a superview before making constraints on it.")
preconditionFailure(
"The layout target must have a superview before making constraints on it."
)
}
return lessThanOrEqual(to: superview, plus: offset)
}
Expand All @@ -131,7 +141,9 @@ extension BaselineAnchor {
/// - Returns: An `NSLayoutConstraint` object that represents `self` baseline >= `superview` baseline + `offset`.
public func greaterThanOrEqualToSuperview(plus offset: CGFloat = 0) -> NSLayoutConstraint {
guard let superview = target.superview else {
preconditionFailure("The layout target must have a superview before making constraints on it.")
preconditionFailure(
"The layout target must have a superview before making constraints on it."
)
}
return greaterThanOrEqual(to: superview, plus: offset)
}
Expand Down

0 comments on commit b7ef870

Please sign in to comment.