Skip to content

Utility to maintain high quality of UI building in SwiftUI

Notifications You must be signed in to change notification settings

ARamy23/PreviewableView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Utility to maintain high quality of UI building in SwiftUI

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages