Zurück zum Ranking

Q-Mobile/QGrid

Swift

🎛 QGrid: The missing SwiftUI collection view.

swiftuiswiftswift5iosswiftui-examplegriddeclarative-ui
Sterne-Wachstum
Sterne
1.6k
Forks
105
Wochenwachstum
Issues
16
5001k1.5k
Juli 2019Nov. 2021März 2024Juli 2026
README

[NOTE]
If you'd like to see QGrid in action, check out this demo of QDesigner (see video below).
Install QDesigner: https://apps.apple.com/us/app/qdesigner/id1500810470
Install a companion QDesigner Client on iPhone, to see your UI design on a target device, updated in real-time: https://apps.apple.com/us/app/qdesignerclient/id1500946484

Learn more at: https://Q-Mobile.IT/Q-Designer

QDesigner Preview

QGrid: The missing SwiftUI collection view.

“Build Platforms Swift Package Manager License: MIT Twitter: @karolkulesza

QGrid is the missing SwiftUI collection view. It uses the same approach as SwiftUI's List view, by computing its cells from an underlying collection of identified data.

🔷 Requirements

     ✅ macOS 10.15+
     ✅ Xcode 11.0
     ✅ Swift 5+
     ✅ iOS 13+
     ✅ tvOS 13+

🔷 Installation

QGrid is available via Swift Package Manager.

Using Xcode 11, go to File -> Swift Packages -> Add Package Dependency and enter https://github.com/Q-Mobile/QGrid

🔷 Usage

✴️ Basic scenario:

In its simplest form, QGrid can be used with just this 1 line of code within the body of your View, assuming you already have a custom cell view:

struct PeopleView: View {
  var body: some View {
    QGrid(Storage.people, columns: 3) { GridCell(person: $0) }
  }
}   

struct GridCell: View {
  var person: Person

  var body: some View {
    VStack() {
      Image(person.imageName)
        .resizable()
        .scaledToFit()
        .clipShape(Circle())
        .shadow(color: .primary, radius: 5)
        .padding([.horizontal, .top], 7)
      Text(person.firstName).lineLimit(1)
      Text(person.lastName).lineLimit(1)
    }
  }
}

✴️ Customize the default layout configuration:

You can customize how QGrid will layout your cells by providing some additional initializer parameters, which have default values:

struct PeopleView: View {
  var body: some View {
    QGrid(Storage.people,
          columns: 3,
          columnsInLandscape: 4,
          vSpacing: 50,
          hSpacing: 20,
          vPadding: 100,
          hPadding: 20) { person in
            GridCell(person: person)
    }
  }
}   

🔷 Example App

📱QGridTestApp directory in this repository contains a very simple application that uses QGrid. Open QGridTestApp/QGridTestApp.xcodeproj and either use the new Xcode Previews feature or just run the app.

🔷 QGrid Designer

📱QGridTestApp contains also the QGrid Designer area view, with sliders for dynamic run-time configuration of the QGrid view (with config option to hide it). Please refer to the following demo executed on the device:

🔷 Roadmap / TODOs

Version 0.1.1 of QGrid contains a very limited set of features. It could be extended by implementing the following tasks:

     ☘️ Parameterize spacing&padding configuration depending on the device orientation
     ☘️ Add the option to specify scroll direction
     ☘️ Add content-only initializer to QGrid struct, without a collection of identified data as argument (As in SwiftUI’s List)
     ☘️ Add support for other platforms (watchOS)
     ☘️ Add Stack layout option (as in UICollectionView)
     ☘️ Add unit/UI tests
     ☘️ ... many other improvements

🔷 Contributing

👨🏻‍🔧 Feel free to contribute to QGrid by creating a pull request, following these guidelines:

  1. Fork QGrid
  2. Create your feature branch
  3. Commit your changes, along with unit tests
  4. Push to the branch
  5. Create pull request

🔷 Author

     👨‍💻 Karol Kulesza (@karolkulesza)

🔷 License

     📄 QGrid is available under the MIT license. See the LICENSE file for more info.

Ähnliche Repositories
dkhamsing/open-source-ios-apps

:iphone: Collaborative List of Open-Source iOS Apps

Creative Commons Zero v1.0 Universaliosswift
51.3k6k
jordanbaird/Ice

Powerful menu bar manager for macOS

SwiftGNU General Public License v3.0macosmenubar
icemenubar.app
29k824
NativeScript/NativeScript

⚡ Write Native with TypeScript ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Flutter and you name it compatible.

TypeScriptnpmMIT Licensenativescriptandroid
nativescript.org
25.6k1.7k
CodeEditApp/CodeEdit

📝 CodeEdit App for macOS – Elevate your code editing experience. Open source, free forever.

SwiftMIT Licensemacosapple
codeedit.app
23k1.2k
Whisky-App/Whisky

A modern Wine wrapper for macOS built with SwiftUI

SwiftGNU General Public License v3.0macosswiftui
getwhisky.app
15.2k603
pointfreeco/swift-composable-architecture

A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.

SwiftMIT Licensearchitecturecomposition
pointfree.co/collections/composable-architecture
14.8k1.7k
mrkai77/Loop

Window management made elegant.

SwiftGNU General Public License v3.0macosswift
11.2k254
gao-sun/eul

🖥️ macOS status monitoring app written in SwiftUI.

SwiftMIT Licensemacosmonitoring
9.9k373
stonerl/Thaw

Menu bar manager for macOS 26

SwiftGNU General Public License v3.0macosmacos-app
8.9k207
sindresorhus/Gifski

🌈 Convert videos to high-quality GIFs on your Mac

SwiftMIT Licensegifskigif
sindresorhus.com/gifski
8.5k320
XcodesOrg/XcodesApp

The easiest way to install and switch between multiple versions of Xcode - with a mouse click.

SwiftMIT Licensexcodeswift
xcodes.app
8.5k376
ronitsingh10/FineTune

FineTune, a macOS menu bar app for per-app volume control, multi-device output, audio routing, and 10-band EQ. Free and open-source alternative to SoundSource.

SwiftGNU General Public License v3.0audioaudio-utility
8.2k280