Is it only me who has a mind-blow every time dealing with the isHidden property of the UIView?
My intuition always was, that a ‘true’ value of Boolean type means something that exists, in contrast with a ‘false’ value that is about a non-existence.
With this in mind, it’s so puzzling and mind-consuming for me to deal with the isHidden property of the UIView.
Suppose, I want some UIView to be visible on my screen. My mind tends to set a ‘true’ (i.e. existence) value to some property of the UIView. But instead, I have to set a ‘false’ (non-existence)…
Every iOS Developer creates UITableViewCells, but let’s do it better.
Here are five principles based on my practice.
Source code of the complete sample application: https://github.com/alekseishirokov/medium-01-better-uitableviewcell
Every time you create a new UITableViewController in the storyboard, the XCode creates an empty cell prototype. That leads the developer to use this template to place UI elements right into this cell view.
But this is a bad habit. Sooner or later your project manager will ask you to use the exact…
Suppose we have a function with last parameter as a function type. For example ‘sort’ function, that sorts an array of strings, according to a decision function, passed as ‘isSortedPair:’ parameter.
isSortedPair: (s1: String, s2: String) -> Bool
// I use a build-in ‘sort’ function here, for briefity.
So, let’s sort some string array:
let strings = ["a", "c", "b"]
using our ‘sort’ function.
On a straightforward way, we declare some decision function:
func aToZ(s1: String, s2: String)
return s1 < s2
and pass it…