Skip to content

Commit

Permalink
Merge pull request #18 from stonko1994/feature/add-visionos-support
Browse files Browse the repository at this point in the history
Add visionOS support
  • Loading branch information
stonko1994 authored Jan 31, 2024
2 parents bc090eb + d5955ff commit fd0b125
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 16 deletions.
42 changes: 36 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,41 @@ on:
- opened

jobs:
build:
runs-on: macos-latest
build-ios:
name: Build iOS
runs-on: macOS-14
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.2'

- name: Build iOS
run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator"
- name: Build tvOS
run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk appletvsimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-tvos13.0-simulator"
run: xcodebuild -scheme SimultaneouslyScrollView -destination "platform=iOS Simulator,name=iPhone 15 Pro,OS=latest"

build-tvos:
name: Build tvOS
runs-on: macOS-14
steps:
- uses: actions/checkout@v4

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.2'

- name: Build tvOS
run: xcodebuild -scheme SimultaneouslyScrollView -destination "platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest"

build-visionos:
name: Build visionOS
runs-on: macOS-14
steps:
- uses: actions/checkout@v4

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.2'

- name: Build visionOS
run: xcodebuild -scheme SimultaneouslyScrollView -destination "platform=visionOS Simulator,name=Apple Vision Pro,OS=latest"
2 changes: 1 addition & 1 deletion .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
swiftlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: SwiftLint
uses: norio-nomura/[email protected]
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// swift-tools-version:5.3
// swift-tools-version:5.9
import PackageDescription

let package = Package(
name: "SimultaneouslyScrollView",
platforms: [
.iOS(.v13),
.tvOS(.v13)
.tvOS(.v13),
.visionOS(.v1)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
import Combine
import UIKit

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
import UIKit

internal extension UIScrollView {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
import Foundation
import UIKit

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
import Foundation

public struct SimultaneouslyScrollViewDirection: OptionSet {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import Combine
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
import UIKit
#endif

/// Handler to enable simultaneously scrolling of `ScrollView`s
@available(iOS 13, *)
@available(tvOS 13, *)
@available(visionOS 1, *)
@available(macOS, unavailable)
public protocol SimultaneouslyScrollViewHandler {
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
/// Publisher to notify if the `ScrollView`s are scrolled to the bottom
var scrolledToBottomPublisher: AnyPublisher<Bool, Never> { get }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import Foundation
/// Factory class to create `SimultaneouslyScrollViewHandler` instance
@available(iOS 13, *)
@available(tvOS 13, *)
@available(visionOS 1, *)
@available(macOS, unavailable)
public class SimultaneouslyScrollViewHandlerFactory {
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
/// Creates a new `SimultaneouslyScrollViewHandler` instance
/// - Returns: A new `SimultaneouslyScrollViewHandler` instance
public static func create() -> SimultaneouslyScrollViewHandler {
Expand Down

0 comments on commit fd0b125

Please sign in to comment.