Preventing the Retain Cycle Memory Leak Of Strong Swift Arrays

Let’s create a retain cycle memory leak with arrays: Subscriber holds publisher strong and publisher holds its subscribers back in its subscribers array. Paste the code into your playground and observe that deinit never gets called, too bad! The array itself can not be a weak reference. But its elements can be defined as weak…

Testing iOS SSL Pinning With Charles

So you have finished implementing SSL Pinning with your favorite tool (URLSession, AlamoFire, AFNetworking, etc…) and you want to test it. I would suggest using Charles on doing that. As in “https://www.charlesproxy.com” stated, “Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP and…

UIScrollView Content Layout Guide with Auto Layout in Interface Builder

I will try to keep this short enough. With iOS11, Apple introduced Content Layout Guide for UIScrollView and I will show you how it’s used with a vertical UIScrollView example: 1- Add a UIScrollView and attach it to safe area. Don’t worry about the errors yet. Content Layout Guides is checked by default. 2- You…