Swiftpack.co - ARamy23/PreviewableView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by ARamy23.
ARamy23/PreviewableView 1.0.0
Utility to maintain high quality of UI building in SwiftUI
⭐️ 0
🕓 2 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/ARamy23/PreviewableView.git", from: "1.0.0")

About PreviewableView

Previewable is a Utility reusable View class that allows for previewing the UI when building for iOS to show in different features

Requirements

  • iOS 13.0
  • Swift 5+

Demo

Light & Dark Modes No Notch, Small iPhones, and iPads

Dependencies

  • Currently, no dependencies are needed in this project

Installation

Swift Package Manager (SPM)

How to use

struct PrayersView_Previews: PreviewProvider {
  static var previews: some View {
    PreviewableView( // 2
      [
        .darkMode,
        .noNotch,
        .iPad
      ]
    ) {
    // 1
      PrayersView(
        store: .init(
          initialState: .init(),
          reducer: prayerReducer,
          environment: PrayerEnvironment()
        )
      )
    }
  }
}

In your Preview Views

  1. Wrap your preview View in PreviwableView(_ features: [PreviewableFeatures]) { /*...*/ }
  2. Specify which features you need, (⚠️ if you've too many features, it will slow down the Preview greatly, make sure you optimize this on Intel macs ⚠️)

Known Issues

  1. There is a localization feature, however, for some unknown reason, it's not working for me even after following Apple's Documentation here

Request

  1. This is my first actual Open-Source, before it was just some try outs, I'd really love any feedback, especially negative ones to improve upon this skill, if you think something can be improved, please do reach out 🙏

Contributions

You know the drill, Fork, Make your edits, and open a PR if you want

GitHub

link
Stars: 0
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics