最近在使用swift开发iOS的app,经常需要预览UI
![](https://user-gold-cdn.xitu.io/2020/5/19/1722ca7dbefb1414?w=862&h=1682&f=png&s=447966)
```
struct PostImageCell_Previews: PreviewProvider {
static var previews: some View {
let images = postList.list[0].images
let width=UIScreen.main.bounds.width
return Group{
PostImageCell(images: Array(images[0...0]),width: width)
PostImageCell(images: Array(images[0...1]),width: width)
}
}
}
```
有时候需要设置预览的效果,更改预览的大小
```
struct PostImageCell_Previews: PreviewProvider {
static var previews: some View {
let images = postList.list[0].images
let width=UIScreen.main.bounds.width
return Group{