How to Make Blur around Square Overlay QRCodeReader iOS

My friend asked me how to make background blur and make only center square camera that's not blur. It's like the screenshoot below. BTW i use QRCodeReader library and i can't find a config to do this. So i tried to do by myself and finally i found the way. I'm gonna share to you guys. 

This is the code :

Put this in method layoutSubviews class QRCodeReaderView.

First i made the square sample to get position x, y, width and height. Then i did make four views top, bottom, left and right. I made the views blur then i inserted it. It's not too complicated right.

link library :

Popular posts from this blog

How to restart the app with flutter Android and iOS

How to have ConstraintLayout inside ScrollView and ScrollView inside ConstraintLayout Android

Missing system image Android Studio solution