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

FacebookSDK(4.1.x) Custom Login UI Button – Swift(1.2)

Following this tutorial, I have managed to make a Facebook Login Button working. However, it is assigning the button image automatically from the SDK and it is not customisable (as it is not getting created on Storyboard), so I am unable to use my own button image or text instead. I believe this part of […]

UICollectionView registerClass: forCellWithReuseIdentifier method breaks UICollectionView

What’s the role of registerClass:forCellWithReuseIdentifier: method? According to Apple’s developer documentation it’s supposed to “Register a class for use in creating new collection view cells.” When I try to use it my project I get a black collection view. When I delete it everything works fine. #define cellId @”cellId” #import “ViewController.h” #import “Cell.h” @interface ViewController […]

How to write exif metadata to an image (not the camera roll, just a UIImage or JPEG)

I am aware of how to save metadata using ALAssets. But, I want to save an image, or upload it somewhere, with exif intact. I have exif data as an NSDictionary. But how can I inject it properly into a UIImage (or probably an NSData JPEG representation)?

How to embed a UITableView in a UIScrollview

How can I do the following in a UIViewController (containing a tableview as a subview) I initially have a UIViewController showing a preview section (UIView) //Setup container for preview section UIView *tempContainer = [[UIView alloc]initWithFrame:CGRectMake(0, 20, 320, 100)]; self.preview_answer_container = tempContainer; self.preview_answer_container.backgroundColor = [UIColor clearColor]; [tempContainer release]; [self.view addSubview:self.preview_answer_container]; I also added a UITableView (and […]

How to make my UIBezierPath animated with CAShapeLayer?

I’m trying to animate a UIBezierPath and I’ve installed a CAShapeLayer to try to do it. Unfortunately the animation isn’t working and I’m not sure any of the layers are having any affect (as the code is doing the same thing it was doing before I had the layers). Here is the actual code – […]

Can't install WatchKit app on Apple Watch

I have a WatchKit app that runs fine in the Simulator. But when I try to run it on an actual device it never finishes installing and never provides any error message or feedback. The iOS app installs and runs fine. I bring up the Apple Watch app on the iPhone and it lists the […]

How to properly format currency on ios

I’m looking for a way to format a string into currency without using the TextField hack. For example, i’d like to have the number “521242” converted into “5,212.42” Or if I have a number under 1$, I would like it to look like this: “52” -> “0.52” Thanks

How to find out what profile was used for building *.ipa file?

Is it possible and how to grab that information about profile just from existing *.ipa file?

Rails shows “WARNING: Can't verify CSRF token authenticity” from a RestKit POST

When I try to POST from RestKit, there is a warning in Rails console: Started POST “/friends” for at 2012-04-16 09:58:10 +0800 Processing by FriendsController#create as */* Parameters: {“friend”=>{“myself_id”=>”m001”, “friend_id”=>”f001”}} WARNING: Can’t verify CSRF token authenticity (0.1ms) BEGIN SQL (1.7ms) INSERT INTO `friends` (`friend_id`, `myself_id`) VALUES (‘f001’, ‘m001’) (1.1ms) COMMIT Redirected to Completed […]

How to download image with AFNetworking 2.0?

Appareantly there is no AFImageRequestOperation, but only AFImageResponseSerializer and frankly I don’t get it or maybe I’m just looking too long through AFNetworking site… Downloading images with previous AFNetworking was like a charm. I’d hate to go back to older AFnetworking, since I did almost all stuff via the new version… Anyone?