DarkLightModePreview

Screen Shot 2021-01-15 at 16 12 13

You can use this simple view to preview your SwiftUI views in different appearances:

import DarkLightModePreview

struct Checkbox_Previews: PreviewProvider {
    static var previews: some View {
        DarkLightModePreview {
            HStack {
                CustomCheckbox(checked: false, hover: false) {}
                CustomCheckbox(checked: false, hover: true) {}
                CustomCheckbox(checked: true, hover: false) {}
                CustomCheckbox(checked: true, hover: true) {}
            }
        }
    }
}

How to use

  • Add this repository to Swift Package Manager