42nd Day As An iOS Developer With No Experience

October 30, 2015 - 42nd Day As An iOS Developer With No Experience BEFORE :)

FRIDAY - One of the things that I have discovered today is the open sourced project made by Chris Miles called "CMPopTipView". Ah I get it now, the CM means the author initials. haha! Anyway, this one is so easy to use. It is all well documented in his repository on Github. Click here.

Ah, I would like to inform you, my dear reader, that not all things that I discover or learn every single day is written here, for instance, I learn my trashy technique on how to layout my views. How do I do it? I don't use autolayout since I just recently learned it. I use center properties of views. Frame and Center. I usually put my views (ex. UIButtons, UITextFields, UILabels, etc...) inside a UIView which I call a container, and then use the power of frames and center. We all know that this can be applied to a project that doesn't need to be rotated.

Also, I posted another question on stackoverflow: http://stackoverflow.com/questions/33418804/input-range-width-of-uitextfield-ios/33428195#33428195

Basically, my question was simple:

Is it possible to set a UITextField's input range (not the number of characters)? You can check out my screenshot below.

At the end, I was the one who answered my own question. I just put two padding to both rightView and leftView of my view (UITextField).

UIView *paddingViewForArrowButton = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 35, 25)];
_billingAddressTextField.rightView = paddingViewForArrowButton;
_billingAddressTextField.rightViewMode = UITextFieldViewModeAlways;

UIView *paddingforBillingLeft = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 25)];
_billingAddressTextField.leftView = paddingforBillingLeft;
_billingAddressTextField.leftViewMode = UITextFieldViewModeAlways;

Finally, the freakin most amazing thing that happened to me today is to finally make my code work. Click the link below and you will be redirected to my another post :)


Post a Comment