> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/ios/custom/ext/image/image-playground.md).

# Image(playground:)

{% tabs %}
{% tab title="🌀 Image" %}
{% hint style="info" %}
在 <mark style="color:orange;">**Swift Playground for iPad**</mark> 內使用：

```
#imageLiteral(resourceName: imgName)
```

目前得到的圖檔型別還是 <mark style="color:purple;">**UIImage**</mark>，所以必須利用下面的方式再轉一手。
{% endhint %}

```swift
import SwiftUI

// usage: `Image(playground: "hokaido.png")`
extension Image {
    public init(playground imgName: String) {
        self.init(uiImage: #imageLiteral(resourceName: imgName))
    }
}
```

{% endtab %}

{% tab title="💈範例" %}

* [view.watermark()](/ios/custom/ext/view/watermark.md)
  {% endtab %}
  {% endtabs %}
