Featured
-
Objective C or Swift - Which Technology to Learn for iOS Development?
Swift programming language is completely based on
by siddharth.sindhi -
Make UIImage White Background Transparent in iOS
If you came across to a requirement where you want
by ashish.nakoti -
User's location update on server when app is in background.
Code for those Apps where we need to update user's
by ashish.nakoti -
Animate button with zoom and bounce effect in ios
Many social apps are using bouncing effect for but
by ashish.nakoti -
Crop an image from UIImageView
With the following method stated below you can cro
by kuldeep.butola
Tags
How to set random numbers from an array as title of UIButton in iOS?
Hi Reader’s,
This blog includes the concept of how to set random numbers from an array as title of different UIButton taken in story board. Random numbers are much needed if you are making a number based gaming applic...
Passing data using NSNotificationCenter
There are different ways for passing data between controllers in Objective-C. In this example we are going to use NSNotificationCenter for passing data from one view controller to another view controller. NSNotificationCenter is generally used to...
Send e-mail in iOS
Email application of iOS device helps in sending emails. We can compose Email using MFMailComposeViewController in iOS.
A standard interface that manages the editing and sending of email message is provided by the MFMailComposeViewController cla...
How to check if text is truncated in UILabel?
Hello all ! Sometimes it happens that the content is more according to the size of UILabel then the three dots appears at the end of the UILabel. So we want to show the complete text of the UILabel. We can implement it by adding a UIButton, on cl...
Glow UIButton titleLabel on selection of UIButton
Hi all ! If we want to show the glowing effect on the UIButton i.e when you are selecting the UIButton then the titleLabel will glow and when its not selected the titleLabel will again come to its original color.
Here is an example which shows...
How to use the built-in camera of the iPhone ?
To use the built-in camera of the iPhone consider the following example. In this example we will also see how to access the photo library and select a photo and use it.
Create a single view application and assign a name to it. Then in the Main...
Line Break on UIButton Text
It is possible to set number of lines of a label by going to the Attribute Inspector and assigning value 0 to the lines attribute.
In case of Text Field we can use Text View but if we are using UIButton then there is no option for the mu...
How to add Gradient effect to UIButton ?
Hello all !
For adding Gradient effect to the UIButton we can implement the following code :-
CAGradientLayer *gradientLayer = [CAGradientLayer layer];
gradientLayer.frame = _customButton.layer.bounds; // _customButton is the outlet ...
Change background color of uibutton using subclass method
Hello all !
Explanation is,
Suppose we want to change the background color of the UIButton when it is selected and when reSelected change it to the default colour.
There are many methods for doing so and one of them I am explaining below :-
...
How to give border color to UIButton in objc and Swift.
To give border color to UIButton :-
1. Take UIButton as property .
2. Give corner radius and corner width to UIButton.
3. Now give border color to UIButton.
For Swift use :-
demoButton.backgroundColor = UIColor.clearColor()
demo...
Set Dynamic Size of button according to the Title text
if you want to change the size of UIButton according to the title text then use the following function--
-(void)setDynamicSizeOfButton:(UIButton *)button andSize:(CGFloat)Size {
CGSize size = [button.titleLabel.text sizeWithAttributes:
...
How to create a UILabel & UIButton programmatically in Swift
hello friends,
this is how we can create a UIButton and UILabel in swift.
Set a UILabel in swift
var label = UILabel(frame: CGRectMake(100, 100, self.view.bounds.size.width, 50))
label.center = self.view.center
la...
UIButton width according to Title text.
We can increase or set width of a UIButton according to button title test. To set the width of a UIButton use CGSize. Here is the code :-
CGSize stringsize = [yourButton.titleLabel.text sizeWithFont:[UIFont systemFontOfSize:17]];
[yourButto...