mattmassicotte / nsui

AppKit and UIKit without conditional compilation
BSD 3-Clause "New" or "Revised" License
56 stars 4 forks source link

Add 'nsuiImage' attribute to ImageRenderer #3

Closed kaii-zen closed 11 months ago

kaii-zen commented 11 months ago

ImageRenderer was added in iOS 16/macOS 13 and it lets us turn any SwiftUI view into an image: Screenshot 2023-11-20 at 7 02 13 AM As it provides separate properties for NSImage and UIImage, I found myself wanting to push the hashtag conditionals out of my (eventually) multi-platform app and down into here. 🥰

I'm not entirely sure that Image.swift is the "correct" place to put this, but adding a new file felt a bit extraneous for code that's shorter than its own PR verbiage.

Cheers