SwiftUIPreviewLayouts

SwiftUIPreviewLayouts is a Swift package for generating multiple SwiftUI previews for various device layouts and multitasking modes, specifically for iOS.

All Layouts in Action

Features

  • Multiple device types
  • Portrait and Landscape layouts
  • Multitasking support for iPads

Installation

dependencies: [
    .package(url: "https://github.com/Matt54/SwiftUIPreviewLayouts.git", from: "1.0.0")
]

Usage

import SwiftUI
import SwiftUIPreviewLayouts

struct YourView_Previews: PreviewProvider {
    static var previews: some View {
        PreviewLayouts() {
            YourView()
        }
    }
}

Screenshots

Portrait

Portrait

Landscape

Landscape

Landscape Half Split

Landscape Half Split

Landscape Large Split

Landscape Large Split

Landscape Slide

Landscape Slide

Landscape Small Split

Landscape Small Split

Portrait Large Split

Portrait Large Split

Portrait Slide

Portrait Slide

Portrait Small Split

Portrait Small Split

Contributing

Pull requests are welcome.

License

MIT

GitHub

View Github