mirror of
https://github.com/home-assistant/iOS.git
synced 2026-06-17 09:25:54 -05:00
## Summary This pr does move test files to the test folder of the project. ## Screenshots NA ## Link to pull request in Documentation repository - ## Any other notes -
17 lines
410 B
Swift
17 lines
410 B
Swift
import Foundation
|
|
import Shared
|
|
import UIKit
|
|
|
|
extension UIImage {
|
|
func scaledToSize(_ size: CGSize) -> UIImage {
|
|
UIGraphicsImageRenderer(
|
|
size: size,
|
|
format: with(UIGraphicsImageRendererFormat.preferred()) {
|
|
$0.opaque = imageRendererFormat.opaque
|
|
}
|
|
).image { _ in
|
|
draw(in: CGRect(origin: .zero, size: size))
|
|
}
|
|
}
|
|
}
|