From be5dd359f221f9fcff9dc5f56bdf6a534743f357 Mon Sep 17 00:00:00 2001 From: Julian Schiavo Date: Sun, 8 Mar 2020 14:35:07 +0800 Subject: [PATCH 1/3] Add watchOS support to Package file --- Package.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Package.swift b/Package.swift index 2c54526..6b3c222 100644 --- a/Package.swift +++ b/Package.swift @@ -6,6 +6,7 @@ let package = Package( name: "QGrid", platforms: [ .iOS(.v13), + .watchOS(.v6), .macOS(.v10_15), .tvOS(.v13) ], From fca412590f6d0ce964441c0081c1b19a9605d21f Mon Sep 17 00:00:00 2001 From: Julian Schiavo Date: Sun, 8 Mar 2020 14:35:39 +0800 Subject: [PATCH 2/3] Note watchOS support in README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 420c038..22c3399 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ If you want to influence the future of app design & development, please [Retweet      ✅ Xcode 11.0      ✅ Swift 5+      ✅ iOS 13+ +     ✅ watchOS 6+      ✅ tvOS 13+ ## 🔷 Installation From e49cbcc0c0fdeb6995414abbc7aff88d661d1426 Mon Sep 17 00:00:00 2001 From: Julian Schiavo Date: Sun, 8 Mar 2020 14:37:26 +0800 Subject: [PATCH 3/3] watchOS availability and column count fix --- Sources/QGrid/QGrid.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/QGrid/QGrid.swift b/Sources/QGrid/QGrid.swift index 42c4d2f..60b0876 100644 --- a/Sources/QGrid/QGrid.swift +++ b/Sources/QGrid/QGrid.swift @@ -28,7 +28,7 @@ import SwiftUI /// A container that presents rows of data arranged in multiple columns. -@available(iOS 13.0, OSX 10.15, *) +@available(iOS 13.0, watchOS 6.0, OSX 10.15, *) public struct QGrid: View where Data : RandomAccessCollection, Content : View, Data.Element : Identifiable { private struct QGridIndex : Identifiable { var id: Int } @@ -84,12 +84,12 @@ public struct QGrid: View } private var cols: Int { - #if os(tvOS) - return columnsInLandscape - #elseif os(macOS) - return columnsInLandscape - #else + #if os(iOS) return UIDevice.current.orientation.isLandscape ? columnsInLandscape : columns + #elseif os(watchOS) + return columns + #else + return columnsInLandscape #endif }