{"height":"190","type":"rich","version":"1.0","url":"https://xyk.hatenablog.com/entry/2020/08/22/220529","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","author_name":"xyk","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxyk.hatenablog.com%2Fentry%2F2020%2F08%2F22%2F220529\" title=\"UIImageView \u306e\u753b\u50cf\u306b AspectFit \u3092\u9069\u7528\u3057\u305f\u5f8c\u306e\u753b\u50cf\u30b5\u30a4\u30ba\u3092\u77e5\u308b\u65b9\u6cd5 - xyk blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"blog_title":"xyk blog","width":"100%","title":"UIImageView \u306e\u753b\u50cf\u306b AspectFit \u3092\u9069\u7528\u3057\u305f\u5f8c\u306e\u753b\u50cf\u30b5\u30a4\u30ba\u3092\u77e5\u308b\u65b9\u6cd5","categories":["ios","swift"],"blog_url":"https://xyk.hatenablog.com/","description":"\u691c\u8a3c\u74b0\u5883: Xcode 11.4 Swift 5.2 UIImageView \u306e\u753b\u50cf\u306b AspectFit \u3092\u9069\u7528\u3057\u305f\u5f8c\u306e\u753b\u50cf\u30b5\u30a4\u30ba\u306f\u3001AVFoundation \u306e AVMakeRect(aspectRatio:insideRect:) \u3092\u4f7f\u3046\u3068\u81ea\u5206\u3067\u8a08\u7b97\u305b\u305a\u306b\u7c21\u5358\u306b\u30b5\u30a4\u30ba\u3092\u77e5\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 UIImageView \u306e Extension \u3068\u3057\u3066\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3057\u305f\u3002 import AVFoundation extension UIImageView { var imageSize: CGSize { if let image = image { return AVMakeRect(aspec\u2026","published":"2020-08-22 22:05:29","author_url":"https://blog.hatena.ne.jp/xyk/"}