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

Save Data to .plist File in Swift

I am trying to save data to a plist file in swift, but the data isn’t showing up as it was saved when the plist is read. This is the code I was using. var documentsDirectory = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as NSString var path : NSString = documentsDirectory.stringByAppendingPathComponent(“data.plist”) var data : NSMutableDictionary = NSMutableDictionary(contentsOfFile: path) […]

Storing images locally on an iOS device

Some iOS photo-related apps store images created with the app somewhere other than the photo library. For example Fat Booth shows a scrolling list of photos created with the app at app start-up. Note these photos are persisted w/o the user explicitly saving them to the photo library. What is the simplest way to save […]

Dynamically changing font size of UILabel

I currently have a UILabel: factLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 100, 280, 100)]; factLabel.text = @”some text some text some text some text”; factLabel.backgroundColor = [UIColor clearColor]; factLabel.lineBreakMode = UILineBreakModeWordWrap; factLabel.numberOfLines = 10; [self.view addSubview:factLabel]; Throughout the life of my iOS application, factLabel gets a bunch of different values. Some with multiple sentences, others with […]

Hide separator line on one UITableViewCell

I’m customizing a UITableView. I want to hide the line separating on the last cell … can i do this? I know I can do tableView.separatorStyle = UITableViewCellStyle.None but that would affect all the cells of the tableView. I want it to only affect my last cell.

This action could not be completed. Try Again (-22421)

I am trying to upload an Apple TV App to the App Store for testing purposes, but I got the issue: This Action could not be completed. Try Again (-22421) as in the below image: So what can I do?

Check if my app has a new version on AppStore

I would like to manually check if there are new updates for my app while the user is in it, and prompt him to download the new version. Can I do this by checking the version of my app in the app store – programatically?

Workaround on the threads limit in Grand Central Dispatch?

With Grand Central Dispatch, one can easily perform time consuming task on non-main thread, avoid blocking the main thead and keep the UI responsive. Simply by using dispatch_async and perform the task on a global concurrent queue. dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // code }); However, something sounds too good to be true like this one usually […]

Force landscape orientation in UIImagePickerController

I’m new to iOS development, and Im developing my first app. (so sorry if Im asking a newbie question) My app is all in portrait orientation, except to the place where I’m using UIImagePickerController to take a picture to be used in the app, what I’m doing is: UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate […]

iPhone app under test crashes after a few days

I am new to making iPhone apps and this is my first attempt. I have made a simple app which has two buttons in it. One button opens a URL and the other opens a Pop-up window. I am yet to enroll as an apple developer and am testing my application on the physical device […]

Present and dismiss modal view controller

Can anyone give me the example code that I can use to first present a modal view controller, then dismiss it? This is what I have been trying: NSLog(@”%@”, blue.modalViewController); [blue presentModalViewController:red animated:YES]; NSLog(@”%@”, blue.modalViewController); [blue dismissModalViewControllerAnimated:YES]; NSLog(@”%@”, blue.modalViewController); This code is in viewDidLoad (“blue” and “red” are both subclasses of UIViewController). I expect that […]