If executing:
python setup.py install
give you error like:
[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) -- Some packages may not be found!
it may be caused by outdate OpenSSL. But if after executing:
python -c "import ssl; print(ssl.OPENSSL_VERSION)"
you see something like:
OpenSSL 1.0.2n 7 Dec 2017
then your SSL is pretty good. What to do then?

1. If you are in Virtual Env mode, deactivate it
2. Remove your Virtual Env
3. Run “brew update”
4. Run “brew install openssl” just in case
5. Run “brew install python3”

Next thing is check available python versions which you can use in venv:
ls /Library/Frameworks/Python.framework/Versions/
If you will see only “3.5”, go to python.org and download newest MacOs package (currently 3.6.5) then install as usual.
After installing make you that:
ls /Library/Frameworks/Python.framework/Versions/
will show:
3.5 3.6

Now you can create new Virtual Env with forced python 3.6:
virtualenv envname --python=python3.6

Now installing packages should work.

This may seem trivial, but in fact about 2 months ago some clever guys made changes in brew repository, so doing just:
brew install php71-intl
will show you error with message that such recipe doesn’t exists. Also XAMPP comes without intl extension so is there any working solution which does not require full and manual php compilation?

Fortunately, there is. There is temporary fix in another brew repo, so all you have to do is:
brew tap kyslik/homebrew-php
brew install kyslik/php/php71-intl

And this works. Really. Enjoy.

As you probably notices, simple screen drawing is useless if it comes to OpenGL view. So is it possible to generate UIImage from such? Of course, lets suppose your custom drawing class extends UIView, then just add:

This code works in XCode 9 and Swift 3.x.

Sooner or later, you will face the problem with object which are not deallocating. How to check if object gets deallocated? Just use deinit method like below:

If you won’t see such message when you think you class should be gone, the easiest way is to debug allocations. Because the most common reason for such behavior are strong references, you can print allocation counter this way:

But where to put this? First of all, in all you initialization methods. Just add some those prints after each few lines, and you should see where counter is growing. The same in cleanup methods, or if you dont have any, you can put this somewhere when your view controller is closing, like:

And how to avoid strong references? The most common mistake, is using self in blocks, this is the place where you should use [unowned self], this way:

Are you still using self.interfaceOrientation and getting deprecation warning? Well, don’t. Not only because it is depracated, but it can give you wrong result. Device might be in landscape mode, but a view controller that only supports portrait will remain in portrait. Solution for everything is:

which will not only return correct orientation, but also result is UIInterfaceOrientation enum so you don’t need to change your switches.

Getting “User interaction is not allowed” error in your build task? If yes, solution is very simple. Just login your build user (usually “jenkins”) via the GUI (which means VNC) and open Keychain Access. Select your signing private key, right-click, choose Get Info, change to the Access Control tab and select the “Allow all applications to access this item”.
Now error should be gone.