Previewable is a Utility reusable View class that allows for previewing the UI when building for iOS to show in different features
- iOS 13.0
- Swift 5+
Light & Dark Modes | No Notch, Small iPhones, and iPads |
- Currently, no dependencies are needed in this project
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
- Wrap your preview View in
PreviwableView(_ features: [PreviewableFeatures]) { /*...*/ }
- 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⚠️ )
- There is a localization feature, however, for some unknown reason, it's not working for me even after following Apple's Documentation here
- 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 🙏
You know the drill, Fork, Make your edits, and open a PR if you want