iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

Make a phone call programmatically

How can I make a phone call programmatically on iPhone? I tried the following code but nothing happened: NSString *phoneNumber = mymobileNO.titleLabel.text; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];

AFNetworking Post Request

I’m a newbie in obj-c and have been using asihttp for some of my projects. When doing a post request in asihttp its done this way. ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setPostValue:height forKey:@”user[height]”]; [request setPostValue:weight forKey:@”user[weight]”]; [request setDelegate:self]; [request startAsynchronous]; How would go about doing this is AFNetworking with a code example ? I […]

Close iOS Keyboard by touching anywhere using Swift

I have been looking all over for this but I can’t seem to find it. I know how to dismiss the keyboard using Objective-C but I have no idea how to do that using Swift? Does anyone know?

Unable to use protocol as associatedtype in another protocol in Swift

I have a protocol, Address, which inherits from another protocol, Validator, and Address fulfills the Validator requirement in the extension. There is another protocol, FromRepresentable, which has an associatedType (ValueWrapper) requirement which should be Validator. Now if I try to use Address as associatedType, then it does not compile. It says, Inferred type ‘Address’ (by […]

What is the best practice to parse html in swift?

I’m a Swift newbie. I need for something like Python’s BeautifulSoup in Swift iOS project. Precisely, I need to get all href of <a> that ends with “.txt”. What are the steps that I should take?

How to resize superview to fit all subviews with autolayout?

My understanding of autolayout is that it takes the size of superview and base on constrains and intrinsic sizes it calculates positions of subviews. Is there a way to reverse this process? I want to resize superview on the base of constrains and intrinsic sizes. What is the simplest way of achieving this? I have […]

Enabling auto layout in iOS 6 while remaining backwards compatible with iOS 5

What is the best way to take advantage of the new auto layout features of iOS 6 while still providing compability with older devices on earlier versions of iOS?

How to calculate UILabel height dynamically?

I want to calculate number of lines and height of UILabel dynamically from given text for same.

Start Location Manager in iOS 7 from background task

It seems that in iOS 7 an app can not start Location Manager (by calling startUpdatingLocation) from the background task anymore. In iOS 6 I used approach described here: https://stackoverflow.com/a/6465280 to run background location update every n minutes. The idea was to run background task with a timer and start Location Manager when the timer […]

How to post string with special character and Thai Language using XML parsing in objective c

I am new in ios and I am facing problem regarding to post string containing special character. My code is like this in DidFinishLoading: NSXMLParser *myNSXMLParserPostObj=[[NSXMLParser alloc]initWithData:myNSMDataPostFromServer]; myNSXMLParserPostObj.delegate=self; [myNSXMLParserPostObj parse]; NSLog(@”%@”,myNSXMLParserPostObj.parserError); NSString *responseStringWithEncoded = [[NSString alloc] initWithData: myNSMDataPostFromServer encoding:NSUTF8StringEncoding]; //NSLog(@”Response from Server : %@”, responseStringWithEncoded); NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[responseStringWithEncoded dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: […]