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

Xcode 6 keeps renaming my app's directory in iOS8 simulator after each run.

I’m running Xcode 6 Beta 5 but this has been happening since the first beta. My app’s directory in the simulator keeps being renamed after each run. It took me a while to figure this out. I’m using this to get the doc’s dir reference. NSString *folder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; NSLog(@”Documents Dir: %@”,folder); […]

How to download a file and save it to the documents directory with AFNetworking?

I am using the AFNetworking library. I can’t figure out how to download a file and save it to the documents directory.

Add “Edit in Excel” or “Edit photo” extension

I checked the latest Dropbox and Excel for iOS. In Dropbox we get an edit button. On click it opens Excel’s extension where you can edit the file. After save, changes are reflected in the Dropbox file too. I want to add such a button. Also I’d like to add such a button to images […]

Animate UILabel text between two numbers?

I’m new to iPhone and Mac programming (developed for Windows before), and I’ve got a question: How do I animate the text property of a UILabel between two numbers, e.g. from 5 to 80 in an Ease-Out style? Is it possible with CoreAnimation? I was searching on google for a hour, but I haven’t found […]

What is the difference between Modal and Push segue in Storyboards?

Can someone explain to me what is the exact difference between modal and push segue? I know that when we use push the segue gets added to a stack, so when we keep using push it keeps occupying memory? Can someone please show me how these two are implemented? Modal segues can be created by […]

How do I apply UIAppearance Proxy properties to UILabel?

I have been getting unreliable results while trying to apply UIAppearance proxy styles to the UILabel class proxy. For example, the following works as I would expect: [[UILabel appearance] setFont:[UIFont fontWithName:SOME_FONT size:SOME_SIZE]]; [[UILabel appearance] setShadowColor:[UIColor blackColor]]; Setting the textColor doesn’t work, however, this: [[UILabel appearance] setColor:[UIColor greenColor]]; does work. Kind of. It’s somewhat unreliable and […]

How to Apply Gradient to background view of iOS Swift App

I’m trying to apply a gradient as the background color of a View (main view of a storyboard). The code runs, but nothing changes. I’m using xCode Beta 2 and Swift. Here’s the code: class Colors { let colorTop = UIColor(red: 192.0/255.0, green: 38.0/255.0, blue: 42.0/255.0, alpha: 1.0) let colorBottom = UIColor(red: 35.0/255.0, green: 2.0/255.0, […]

Connect Objective C framework to Swift iOS 8 app (Parse framework)

I am trying to use an Objective C framework with the Swift programming language for iOS 8 development. This is a specific case of an import but the general problem is: How do you import an Objective C framework into swift and get the import recognized? I am trying to integrate the Parse framework into […]

Automatic perspective correction OpenCV

I am trying to implement Automatic perspective correction in my iOS program and when I use the test image I found on the tutorial everything works as expected. But when I take a picture I get back a weird result. I am using code found in this tutorial When I give it an image that […]

How to reload data in a TableView from a different ViewController in Swift

In a ViewController, I’m trying to reload data in a TableView in another ViewController like so: (self.presentedViewController as! tableViewController).table.reloadData() Where tableViewController is the class in the TableView’s controller (It’s not upper camel case, I know) and table is the TableView. Well, doing this yields “fatal error: unexpectedly found nil while unwrapping an Optional value” and […]