Skip to content

Commit

Permalink
Update Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bryankeller committed Jan 29, 2024
1 parent 6aecc28 commit 1c5e9ac
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 26 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Swift
name: CI

on:
push:
Expand All @@ -8,22 +8,25 @@ on:

jobs:
build:
runs-on: macos-latest
runs-on: macos-13
strategy:
matrix:
destination: ['platform=iOS Simulator,OS=11.0,name=iPhone 8', 'platform=iOS Simulator,OS=16.2,name=iPhone 14']
xcode:
- '15.0' # Swift 5.9
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Build
run: xcodebuild clean build -scheme HorizonCalendar
run: xcodebuild clean build -scheme HorizonCalendar -destination "generic/platform=iOS Simulator"
- name: Run tests
run: xcodebuild clean test -project HorizonCalendar.xcodeproj -scheme HorizonCalendar -destination "name=iPhone 8,OS=16.2"
run: xcodebuild clean test -project HorizonCalendar.xcodeproj -scheme HorizonCalendar -destination "name=iPhone 14,OS=17.2"

lint-swift:
runs-on: macos-13
strategy:
matrix:
xcode:
- '15.0' # Swift 5.9
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Lint Swift
run: swift package --allow-writing-to-package-directory format --lint


4 changes: 2 additions & 2 deletions HorizonCalendar.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Features:
spec.homepage = "https://github.com/airbnb/HorizonCalendar"
spec.authors = { "Bryan Keller" => "[email protected]" }
spec.social_media_url = "https://twitter.com/BKYourWay19"
spec.swift_version = "5.8"
spec.ios.deployment_target = '11.0'
spec.swift_version = "5.9"
spec.ios.deployment_target = '12.0'
spec.source_files = "Sources/**/*.{swift,h}"
end
10 changes: 6 additions & 4 deletions HorizonCalendar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down Expand Up @@ -622,6 +623,7 @@
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -644,7 +646,7 @@
GCC_WARN_UNUSED_PARAMETER = YES;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -678,7 +680,7 @@
GCC_WARN_UNUSED_PARAMETER = YES;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -702,7 +704,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5Q5SGQT2R4;
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -722,7 +724,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5Q5SGQT2R4;
INFOPLIST_FILE = Tests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
5 changes: 2 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// swift-tools-version:5.8

// swift-tools-version: 5.8.1
import PackageDescription

let package = Package(
name: "HorizonCalendar",
platforms: [
.iOS(.v11),
.iOS(.v12),
],
products: [
.library(name: "HorizonCalendar", targets: ["HorizonCalendar"]),
Expand Down
16 changes: 8 additions & 8 deletions Sources/Public/CalendarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,6 @@ public final class CalendarView: UIView {
private lazy var scrollViewDelegate = ScrollViewDelegate(calendarView: self)
private lazy var gestureRecognizerDelegate = GestureRecognizerDelegate(calendarView: self)

private var initialItemViewWasFocused = false {
didSet {
guard initialItemViewWasFocused != oldValue else { return }
setNeedsLayout()
layoutIfNeeded()
}
}

// Necessary to work around a `UIScrollView` behavior difference on Mac. See `scrollViewDidScroll`
// and `preventLargeOverScrollIfNeeded` for more context.
private lazy var isRunningOnMac: Bool = {
Expand All @@ -540,6 +532,14 @@ public final class CalendarView: UIView {
return false
}()

private var initialItemViewWasFocused = false {
didSet {
guard initialItemViewWasFocused != oldValue else { return }
setNeedsLayout()
layoutIfNeeded()
}
}

private var isReadyForLayout: Bool {
// There's no reason to attempt layout unless we have a non-zero `bounds.size`. We'll have a
// non-zero size once the `frame` is set to something non-zero, either manually or via the
Expand Down

0 comments on commit 1c5e9ac

Please sign in to comment.