Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/donggyushin/dgpreview
Make UIKit project enable preview feature of SwiftUI
https://github.com/donggyushin/dgpreview
preview previewer swift
Last synced: 17 days ago
JSON representation
Make UIKit project enable preview feature of SwiftUI
- Host: GitHub
- URL: https://github.com/donggyushin/dgpreview
- Owner: donggyushin
- License: mit
- Created: 2022-02-13T08:01:23.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-13T08:46:55.000Z (almost 3 years ago)
- Last Synced: 2024-12-11T17:50:27.625Z (22 days ago)
- Topics: preview, previewer, swift
- Language: Swift
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DGPreview
Make UIKit project enable preview feature of SwiftUI![Group 1](https://user-images.githubusercontent.com/34573243/153745535-c3de8c2a-4619-40cb-a4e9-0b21cd4b36a1.png)
## Requirements
- iOS 13 +
- Swift 5 +
- Xcode 13 +## Installaction
### SPM
```
File > Add Packages > https://github.com/donggyushin/DGPreview
```### CocoaPod
```
pod 'DGPreview', :git => 'https://github.com/donggyushin/DGPreview'
```## Usage
### UIView
```
import SwiftUI
import DGPreviewstruct MyButtonPreview: PreviewProvider {
static var previews: some View {
DGPreview {
return MyButton()
}.previewLayout(.sizeThatFits)
}
}
```### UIViewController
```
import SwiftUI
import DGPreviewstruct ViewControllerPreview: PreviewProvider {
static var previews: some View {
ViewController().showDGPreview(.iPhone13Pro)
}
}
```