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

Run tests on Xcode 16 #128

Merged
merged 20 commits into from
Sep 25, 2024
Merged
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
36 changes: 16 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
version: 2.1

anchors:
- &test_device "iPhone 15"
- &test_device_os "17.0"
- &test_device "iPhone 16"
- &test_device_os "18.0"
- &clean_before_build true
- &default_executor
macos:
xcode: "15.1.0"
xcode: "16.0.0"
resource_class: macos.m1.large.gen1

env:
Expand Down Expand Up @@ -62,8 +62,8 @@ commands:
workspace: "Example.xcworkspace"
scheme: "Example"
path: <<parameters.path>>
simulator: "iPhone 14"
os_version: "16.0"
simulator: *test_device
os_version: *test_device_os

# We introduced two separate commands for projects and workspaces because we didn't find a generic and non-confusing way to introduce
# a condition to only pass either the project or the workspace environment argument to the test output
Expand All @@ -83,7 +83,7 @@ commands:
xcodebuild -scheme Flow \
-project Flow.xcodeproj \
-destination "platform=iOS Simulator,OS=<<parameters.os_version>>,name=<<parameters.simulator>>" \
build test \
build test \
| xcpretty --report junit --output 'test_output/report.junit'
- store_artifacts: # This will by default store an html and junit file as artifacts (See "Artifacts" tab in CircleCI report)
path: test_output # test_output is the default temporary folder for test output
Expand Down Expand Up @@ -148,25 +148,21 @@ jobs:
- store_test_results:
path: swiftlint.html

test-xcode14-ios16:
macos:
xcode: "14.0.0"
test-xcode16-ios18:
<<: *default_executor
steps:
- test_main_project:
simulator: "iPhone 14"
os_version: "16.0"
- test_main_project

test-xcode15-ios17:
<<: *default_executor
macos:
xcode: "15.4.0"
steps:
- test_main_project
- test_main_project:
simulator: "iPhone 15"
os_version: "17.0"

test-example-login:
# can not use xcode > 14 since we have this error.
# deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
# to solve it we need to update the podspec.
macos:
xcode: "14.0.0"
<<: *default_executor
steps:
- test_example_project:
path: Examples/login
Expand All @@ -177,7 +173,7 @@ workflows:
jobs:
- swiftlint:
version: 0.49.1
- test-xcode14-ios16
- test-xcode16-ios18
- test-xcode15-ios17
- test-example-login

5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.12.0
- Xcode 16.0 compatibility

# 1.11.1
- Xcode 15.1 compatibility

Expand Down Expand Up @@ -57,7 +60,7 @@

# 1.6

- Addition: Make `Callbacker` conform to `SignalProvider`.
- Addition: Make `Callbacker` conform to `SignalProvider`.

# 1.5.2

Expand Down
13 changes: 10 additions & 3 deletions Flow/UIView+Signal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,20 @@ public extension UIView {
private extension UIView {
func signal<T>(for keyPath: KeyPath<CallbackerView, Callbacker<T>>) -> Signal<T> {
return Signal(onValue: { callback in
let view = (self.viewWithTag(987892442) as? CallbackerView) ?? {
let view = (self.subviews.compactMap({ $0 as? CallbackerView}).first) ?? {
let view = CallbackerView(frame: self.bounds)
view.autoresizingMask = [.flexibleWidth, .flexibleHeight] // trick so layoutsubViews is called when the view is resized
view.tag = 987892442
view.translatesAutoresizingMaskIntoConstraints = false
view.backgroundColor = .clear
view.isUserInteractionEnabled = false
self.insertSubview(view, at: 0)

NSLayoutConstraint.activate([
view.leadingAnchor.constraint(equalTo: self.leadingAnchor),
view.trailingAnchor.constraint(equalTo: self.trailingAnchor),
view.topAnchor.constraint(equalTo: self.topAnchor),
view.bottomAnchor.constraint(equalTo: self.bottomAnchor)
])

view.setNeedsLayout()
return view
}()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Platforms](https://img.shields.io/badge/platform-%20iOS%20|%20macOS%20|%20tvOS%20|%20linux-gray.svg)](https://img.shields.io/badge/platform-%20iOS%20|%20macOS%20|%20tvOS%20|%20linux-gray.svg)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Swift Package Manager Compatible](https://img.shields.io/badge/SwiftPM-Compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
![Xcode version](https://img.shields.io/badge/Xcode-15.1.0-green)
![Xcode version](https://img.shields.io/badge/Xcode-16.0.0-green)

Modern applications often contain complex asynchronous flows and life cycles. Flow is a Swift library aiming to simplify building these by solving three main problems:

Expand Down