Layover

Layover - Quick Start Guide

What is Layover?

Layover is a multi-platform SwiftUI app that enables synchronized group experiences across:

Built with SharePlay API and AVPlaybackCoordinator for seamless synchronization.

Quick Start

1. Sign In with Apple

When you launch the app:

2. Open in Xcode

cd /Users/benh/Documents/Layover
open Package.swift

3. Select Your Platform

4. Run Tests

Press ⌘U or run:

swift test

4. Build and Run

Press ⌘R or run:

swift build

Key Features

βœ… Room Management

βœ… SharePlay Integration

βœ… Apple TV+ Integration

βœ… Apple Music Integration

βœ… Chess

βœ… Test Coverage

Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Views                      β”‚
β”‚  (SwiftUI - ContentView, RoomViews, etc.)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ observes
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              ViewModels                      β”‚
β”‚   (@Observable - RoomListVM, GameVM, etc.)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ uses
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               Services                       β”‚
β”‚  (SharePlay, Room, Media, Game Services)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ operates on
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                Models                        β”‚
β”‚    (User, Room, MediaContent, Game)         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Testing SharePlay

SharePlay requires specific setup:

  1. Two Physical Devices (simulator not supported)
  2. Active FaceTime Call between devices
  3. Same Apple ID (for testing)
  4. Same Network (Wi-Fi)

Test Flow:

  1. Start FaceTime call between devices
  2. Open Layover on both devices
  3. Create a room on device 1
  4. Join room on device 2
  5. SharePlay session starts automatically
  6. Actions sync across devices

Customization

Adding New Activity Types

  1. Add to RoomActivityType enum:
    enum RoomActivityType: String, Codable, Sendable {
     case myNewActivity = "my_activity"
    }
    
  2. Create Service:
    protocol MyActivityServiceProtocol: LayoverService {
     // Define methods
    }
    
  3. Create ViewModel:
    @Observable
    final class MyActivityViewModel: LayoverViewModel {
     // Implement logic
    }
    
  4. Create View:
    struct MyActivityView: View {
     // Build UI
    }
    

Adding New Game Logic

  1. Create model in Sources/Models/
  2. Create service in Sources/Services/
  3. Write tests in Tests/
  4. Create ViewModel and View
  5. Add to ContentView routing

Project Structure

Layover/
β”œβ”€β”€ Package.swift              # Swift Package definition
β”œβ”€β”€ README.md                  # Project overview
β”œβ”€β”€ DEVELOPMENT.md            # Detailed developer guide
β”œβ”€β”€ QUICKSTART.md             # This file
β”œβ”€β”€ setup.sh                  # Setup script
β”‚
β”œβ”€β”€ Sources/
β”‚   β”œβ”€β”€ LayoverApp.swift      # App entry point
β”‚   β”‚
β”‚   β”œβ”€β”€ Models/               # Data models
β”‚   β”‚   β”œβ”€β”€ User.swift
β”‚   β”‚   β”œβ”€β”€ Room.swift
β”‚   β”‚   β”œβ”€β”€ MediaContent.swift
β”‚   β”‚   β”œβ”€β”€ ChessGame.swift
β”‚   β”‚   └── LayoverActivity.swift
β”‚   β”‚
β”‚   β”œβ”€β”€ Services/             # Business logic
β”‚   β”‚   β”œβ”€β”€ SharePlayService.swift
β”‚   β”‚   β”œβ”€β”€ RoomService.swift
β”‚   β”‚   β”œβ”€β”€ AppleTVService.swift
β”‚   β”‚   β”œβ”€β”€ AppleMusicService.swift
β”‚   β”‚   └── ChessService.swift
β”‚   β”‚
β”‚   β”œβ”€β”€ ViewModels/           # MVVM ViewModels
β”‚   β”‚   β”œβ”€β”€ RoomListViewModel.swift
β”‚   β”‚   β”œβ”€β”€ AppleTVViewModel.swift
β”‚   β”‚   β”œβ”€β”€ AppleMusicViewModel.swift
β”‚   β”‚   └── ChessViewModel.swift
β”‚   β”‚
β”‚   └── Views/                # SwiftUI Views
β”‚       β”œβ”€β”€ ContentView.swift
β”‚       β”œβ”€β”€ RoomRowView.swift
β”‚       β”œβ”€β”€ CreateRoomView.swift
β”‚       β”œβ”€β”€ AppleTVView.swift
β”‚       β”œβ”€β”€ AppleMusicView.swift
β”‚       └── ChessView.swift
β”‚
β”œβ”€β”€ Tests/                    # Unit tests
β”‚   β”œβ”€β”€ Models/
β”‚   β”œβ”€β”€ Services/
β”‚   └── ViewModels/
β”‚
└── Resources/                # Configuration
    β”œβ”€β”€ Info.plist
    └── Layover.entitlements

Common Commands

Build

swift build

Test

swift test

Clean

swift package clean

Update Dependencies

swift package update

Generate Xcode Project (if needed)

swift package generate-xcodeproj

Documentation

Troubleshooting

β€œNo such module β€˜GroupActivities’”

β€œSharePlay not available”

β€œMusic authorization failed”

Build errors

Next Steps

  1. βœ… Explore the codebase
  2. βœ… Run the tests (swift test)
  3. βœ… Build the app (swift build)
  4. βœ… Try creating a room
  5. βœ… Test SharePlay with two devices
  6. βœ… Customize for your needs

Resources

Support

For issues or questions:

  1. Check DEVELOPMENT.md for detailed documentation
  2. Review test files for usage examples
  3. Consult Apple’s official documentation

Built with ❀️ using SwiftUI, SharePlay, and MVVM