Skip to content
Open
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
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let package = Package(
name: "QGrid",
platforms: [
.iOS(.v13),
.watchOS(.v6),
.macOS(.v10_15),
.tvOS(.v13)
],
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions Sources/QGrid/QGrid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Data, Content>: View
where Data : RandomAccessCollection, Content : View, Data.Element : Identifiable {
private struct QGridIndex : Identifiable { var id: Int }
Expand Down Expand Up @@ -84,12 +84,12 @@ public struct QGrid<Data, Content>: 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
}

Expand Down