GitHub

Installation

Detailed installation instructions for Xcode and Package.swift.

SwiftDataTables is distributed via Swift Package Manager (SPM), Apple's built-in dependency manager. This guide covers all installation methods and common troubleshooting.

Requirements

RequirementMinimum Version
iOS17.0+
Swift5.9+
Xcode15.0+

The easiest way to add SwiftDataTables to an existing Xcode project:

  1. Open your project in Xcode
  2. Go to File → Add Package Dependencies...
  3. In the search field, paste: https://github.com/pavankataria/SwiftDataTables
  4. Click Add Package
  5. Select your target and click Add Package again

Xcode will fetch the package and add it to your project. You can now import SwiftDataTables in any Swift file.

Choosing a Version Rule

When adding the package, Xcode asks for a version rule. Here's what each option means:

RuleWhen to Use
Up to Next MajorRecommended. Gets bug fixes and new features, but not breaking changes.
Up to Next MinorMore conservative. Only gets patch releases (bug fixes).
Exact VersionLocks to a specific version. Use if you need reproducible builds.
BranchTracks a branch (e.g., main). Use for testing unreleased features.

For most projects, Up to Next Major starting from 0.9.0 is the best choice.

Via Package.swift

If you're building a Swift package or prefer manual configuration, add SwiftDataTables to your Package.swift:

Package.swift
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
    name: "YourPackage",
    platforms: [
        .iOS(.v17)
    ],
    dependencies: [
        .package(url: "https://github.com/pavankataria/SwiftDataTables", from: "0.9.0")
    ],
    targets: [
        .target(
            name: "YourTarget",
            dependencies: ["SwiftDataTables"]
        )
    ]
)

Then run swift build or open the package in Xcode.

Verifying Installation

To confirm SwiftDataTables is installed correctly, add this to any Swift file and build:

import SwiftDataTables

// If this compiles, you're all set!
let _ = SwiftDataTable<String>.self

Troubleshooting

"No such module 'SwiftDataTables'"

  • Make sure the package was added to the correct target (not just the project)
  • Try Product → Clean Build Folder (⇧⌘K) then rebuild
  • Close and reopen Xcode
  • Check that your deployment target is iOS 17.0 or higher

Package resolution fails

  • Check your internet connection
  • Try File → Packages → Reset Package Caches
  • If using a VPN or corporate network, ensure GitHub is accessible

Version conflicts

If you see version resolution errors, another package may depend on a different version of SwiftDataTables. Try updating all packages with File → Packages → Update to Latest Package Versions.

Next Steps

Now that SwiftDataTables is installed, head to the Quick Start to build your first data table.