---
title: "init(uiImage:size:device:)"
framework: Touch Controller
role: symbol
role_heading: Initializer
platforms: [iOS 26.0+, iPadOS 26.0+, Mac Catalyst 26.0+]
path: "touchcontroller/tccontrolimage/init(uiimage:size:device:)-3hqf"
---

# init(uiImage:size:device:)

Creates a new image from a UIImage.

## Declaration

```swift
convenience init?(uiImage: UIImage, size: CGSize, device: any MTLDevice)
```

## Parameters

- `uiImage`: The UIKit image to create the texture from.
- `size`: The size of the image in points.
- `device`: The Metal device used to create the texture.

## Return Value

Return Value A new TCControlImage instance, or nil if the UIImage has no backing CGImage or if texture creation fails.

## See Also

### Creating a control image

- [init(cgImage:size:device:)](touchcontroller/tccontrolimage/init(cgimage:size:device:)-22z05.md)
- [init(texture:size:)](touchcontroller/tccontrolimage/init(texture:size:).md)
- [init(texture:size:highlight:offset:tintColor:)](touchcontroller/tccontrolimage/init(texture:size:highlight:offset:tintcolor:).md)
