Development Setup
This guide will help you set up a development environment to build and contribute to TablePro.Prerequisites
Before you begin, ensure you have the following installed:Required Software
| Software | Version | Purpose |
|---|---|---|
| macOS | 13.5+ (Ventura) | Target platform |
| Xcode | 15.0+ | Development IDE |
| Git | Latest | Version control |
Optional Tools
| Tool | Purpose |
|---|---|
| SwiftLint | Code linting |
| SwiftFormat | Code formatting |
| Homebrew | Package management |
Getting Started
Step 1: Clone the Repository
Step 2: Install Development Tools
Install SwiftLint and SwiftFormat for code quality:Step 3: Open in Xcode
TablePro.xcodeproj.
Step 4: Build and Run
- Select the TablePro scheme in Xcode
- Select My Mac as the destination
- Press
Cmd+Rto build and run


Project Structure
tablepro
TablePro
Models
Views
ViewModels
Core
Extensions
Theme
Resources
TableProTests
Libs
scripts
.swiftlint.yml
.swiftformat
Building
Development Build
For day-to-day development:Release Build
For distribution-ready builds:Running Tests
Cmd+U).
Code Quality
SwiftLint
Run SwiftLint to check for code issues:SwiftFormat
Format code to match project style:Configuration Files
.swiftlint.yml
SwiftLint rules and configuration:- Line length limits
- Function complexity limits
- Disabled rules
- Custom rules
.swiftformat
SwiftFormat options:- Indentation style
- Brace placement
- Import ordering
- Other formatting rules
Development Workflow
Making Changes
-
Create a feature branch:
- Make your changes
-
Run linting:
-
Run tests:
-
Commit your changes:
-
Push and create a pull request:
Debugging
Use Xcode’s debugging tools:- Set breakpoints by clicking line numbers
- Use
poin the debug console to print objects - Use the Variables View to inspect state
- Use Console.app for system logs
Logging
TablePro uses OSLog for debugging:Common Tasks
Adding a New View
- Create the SwiftUI view in appropriate
Views/subfolder - Follow existing naming conventions (
FeatureNameView.swift) - Use
@Observableor@StateObjectfor state management - Add to navigation/routing as needed
Adding a Database Feature
- Implement in the appropriate driver (
MySQLDriver.swift, etc.) - Add to
DatabaseDriverprotocol if generic - Add UI in relevant view components
- Add tests
Modifying Settings
- Add to appropriate settings struct in
AppSettings.swift - Update
SettingsViewto display the setting - Use setting throughout the app via
@AppStorageor settings manager
Troubleshooting
Build Fails
- Clean build folder:
Cmd+Shift+K - Delete derived data:
- Close and reopen Xcode
- Check for Xcode updates
SwiftLint Errors
- Read the error message carefully
- Check
.swiftlint.ymlfor rule configuration - Fix the issue or disable the rule if appropriate
- Run
swiftlint --fixfor auto-fixable issues
Missing Libraries
If native libraries are missing:- Check the
Libs/directory - Ensure
libmariadb_universal.aexists - Run
scripts/build-release.shto prepare libraries
