Ever wanted to install pnctl extension for Mamp PRO on Catalina in 16 easy steps? If yes, read below.Continue reading
Ever wanted to fetch your entities using complex query from inside you form class? Check out below.Continue reading
This is a bit scary for all beginners. You made your pretty view in Interface Builder, attached UIViewController and trying to:
let vc = new MyNewController()
self.present(vc, animated: true, completion: nil)
If you already upgraded XCode to newest 10.3 version, you may notice that opening XIBs created in older versions causes “Internal error” and UI elements are not visible. But there is simple solution for that. Continue reading
So you made brand new and shiny enum, and want to use it in f.e. picker? To achieve this you need to prepare array of strings which every picker can use. How to do it? Continue reading
I’m pretty sure there are lot of tutorials about mixing ObjectiveC with Swift in both ways. But most of them are covering only normal projects. If you have framework in which you need to mix both languages, you cannot create simple bridging header because you will hit “using bridging headers with framework targets is unsupported” error. What to do then?Continue reading
Yeah, I know it’s been a while. Will try to get back with some new interesting stuff this month.
Expected argument of type “string”, “NULL” given is very common question and seems to not be handled since Symfony 2
Probably you saw many JSON parsing examples, but this one is really easy. And available out of the box with Swift 4.
All you have to do is create models from Codable superclass, and use:
let decoder = JSONDecoder();
let myData = try! decoder.decode(MyModel.self, from: data!)
Check out provided playground here!
Output in console should be:
Color(color: "black", category: "hue", type: "primary")
Color(color: "white", category: "value", type: "primary")
Color(color: "red", category: "hue", type: "primary")
Color(color: "blue", category: "hue", type: "primary")
Color(color: "yellow", category: "hue", type: "primary")
Color(color: "green", category: "hue", type: "secondary")
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:
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:
Now you can create new Virtual Env with forced python 3.6:
virtualenv envname --python=python3.6
Now installing packages should work.