
UIViewAPI
UIKit related domain extensions that you just have to write from project to project.
isHidden
Sometimes getting this in a complicated if
s might be hard. Now you have isHidden
, isNotHidden
, isVisible
and isNotVisible
to help you say what you want 💬
Old:
view.isHidden = false
or
if view.isHidden == false {
// ...
}
That’s annoying… now you can do what you have always wanted!
if view.isVisible {
// ...
}
if view.isNotVisible {
// ...
}
if view.isNotHidden {
// ...
}
// with old
if view.isHidden {
// ...
}
And you can also set on those properties to if you want:
view.isVisible = true
view.isNotVisible = true
view.isNotHidden = true
// with old
view.isHidden = true
That way you can always say what you want without inverted logic! 🤓
intrinsicWidth
If you need to get intrinsic width of UILabel (width of a label based on its content - font and text)
yourLabel.intrinsicWidth
width
If you need to get width of UILabel
yourLabel.width
linesCount
If you need to get number of lines in UILabel. If your view uses Auto Layout call self.layoutIfNeeded() to receive proper number of lines.
yourLabel.linesCount
That’s it
Hope it will help you :)
Cheers! :D
UIViewAPI
UIKit related domain extensions that you just have to write from project to project.
isHidden
Sometimes getting this in a complicated
if
s might be hard. Now you haveisHidden
,isNotHidden
,isVisible
andisNotVisible
to help you say what you want 💬Old:
or
That’s annoying… now you can do what you have always wanted!
And you can also set on those properties to if you want:
That way you can always say what you want without inverted logic! 🤓
intrinsicWidth
If you need to get intrinsic width of UILabel (width of a label based on its content - font and text)
width
If you need to get width of UILabel
linesCount
If you need to get number of lines in UILabel. If your view uses Auto Layout call self.layoutIfNeeded() to receive proper number of lines.
That’s it
Hope it will help you :)
Cheers! :D