/SampleBlurEffect

Moved sample project -> https://github.com/CH3COOH/Samples/tree/master/SampleBlurEffect

Primary LanguageSwiftMIT LicenseMIT

SampleBlurEffect

https://teratail.com/questions/235983 の質問に答えるために作成したサンプルプロジェクトです。

UIVisualEffectViewを使って画像をぼかしたいという質問でした。

Interface Builderで画面を組む際には、UIImageViewの前面にUIVisualEffectView置くと下図のように画像にブラーがかかります。

スクリーンショット 2020-03-30 21 21 50

動的に配置する際にも同様にUIVisualEffectView�がUIImageViewよりも前面になるように addSubview()する順番を変更しました。

Simulator Screen Shot - iPhone 8 - 2020-03-30 at 21 23 33

検証環境について

検証環境は以下の通りです。

  • Xcode 11.4
  • iOS 13.4