Understanding UIView ContentMode with a simple example

Most of the time there is confusion about various content modes. I would like to clarify all 13 of them in this post. There are 13 content modes as listed below Scale To Fill Aspect Fit Aspect Fill Redraw Center Top Bottom Left Right Top Left Top Right Bottom Left Bottom Right Now I would … Read more

Making RGB colour in Xcode

I remember when I first tried using the colour directly from photoshop into my project the colours were appearing whitish while it was yellowish in photoshop the colour value was Color-R-160, G-97, B-5. though very basic but somehow I could not take into account that I need to give a value between 0 and 1.0. … Read more

Set UISegmentedControl selected segment color

Previously in order to set selected segment color in UISegmentControl we needed to loop through subviews and set the right one like this imagine the uncertainties 😀 But since Xcode 11+ we can directly set selected tint in storyboard like this. In iops 13 + we can also use selectedSegmentTintColor. Makes life easy.