Skip to content

alfredang/sgcarparkapp

Repository files navigation

SG Carpark

Swift iOS SwiftUI XcodeGen License

Native iOS carpark availability map for Singapore drivers.

Report Bug · Request Feature

Screenshot

SG Carpark screenshot

About

SG Carpark is a native SwiftUI iOS app that displays Singapore carpark availability on an interactive Apple Map. It fetches live availability from LTA DataMall, supports place search, highlights nearby parking, and opens Apple Maps directions from the selected carpark.

Features

  • Live carpark availability pins from LTA DataMall CarParkAvailabilityv2
  • Apple Map interface with compass, scale, pitch, and user-location controls
  • Search by postal code, mall, street, or place using MKLocalSearch
  • Nearest carpark selection with when-in-use location permission
  • Availability overview with total available lots and visible carpark count
  • Bottom detail panel with lot count, agency, lot type, distance, and directions
  • Full iPhone and iPad app icon asset catalog

Tech Stack

Layer Technology
App Swift, SwiftUI
Maps & Location MapKit, CoreLocation
Networking URLSession, async/await
Data Source LTA DataMall CarParkAvailabilityv2
Project Generation XcodeGen
Platform iOS 17.0+

Architecture

SG Carpark
├── SwiftUI App Entry
│   └── CarparkMapView
├── Presentation
│   ├── SearchBar
│   ├── OverviewStrip
│   ├── CarparkPin
│   └── BottomCarparkPanel
├── State & Coordination
│   └── CarparkMapViewModel
├── Services
│   ├── LTAClient
│   ├── SearchService
│   └── LocationService
└── Models
    ├── Carpark
    └── LTAResponse

Project Structure

.
├── project.yml
├── SGCarpark.xcodeproj
├── sgcarpark
│   ├── Models
│   ├── Services
│   ├── ViewModels
│   ├── Views
│   ├── Resources
│   ├── Info.plist
│   └── SGCarparkApp.swift
├── screenshots
│   └── sgcarpark-home.png
├── AppStore
│   ├── metadata.md
│   └── screenshots
└── scripts

Getting Started

Prerequisites

  • macOS with Xcode installed
  • iOS 17.0+ simulator or device
  • XcodeGen
  • LTA DataMall account key

Setup

git clone https://github.com/alfredang/sgcarparkapp.git
cd sgcarpark
xcodegen generate

Set the LTA account key as a build setting before running the app:

export LTA_ACCOUNT_KEY="your-lta-datamall-account-key"
xcodebuild \
  -project SGCarpark.xcodeproj \
  -scheme SGCarpark \
  -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.5' \
  LTA_ACCOUNT_KEY="$LTA_ACCOUNT_KEY" \
  build

You can also set LTA_ACCOUNT_KEY in Xcode under the target build settings for local development.

App Store Preparation

Before archiving for App Store Connect:

  1. Set DEVELOPMENT_TEAM in project.yml or in Xcode Signing & Capabilities.
  2. Confirm the bundle identifier, display name, version, and build number.
  3. Regenerate the project with xcodegen generate.
  4. Archive from Xcode using Any iOS Device.
  5. Complete App Privacy answers for location usage and network calls.

The app requests location only to find nearby carparks. The location purpose string is defined in sgcarpark/Info.plist.

Security

LTA_ACCOUNT_KEY is intentionally blank in project.yml so credentials are not committed. For production, consider moving LTA calls behind a small backend proxy because account keys embedded in iOS app bundles can be extracted.

Developed By

Tertiary Infotech Academy Pte. Ltd.

License

Proprietary. All rights reserved.

About

Native SwiftUI iOS app for Singapore carpark availability using LTA DataMall.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors