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

How to access User Defined Runtime Attribute from the 'sender' object?

I have a UIButton in a Storyboard scene. The button has a User-Defined-RunTime-Attribute ‘type'(String) configured. When pressed the button calls -(IBAction)pressedButton:(id)sender Will I be able to access the User-Defined-RunTime-Attribute from ‘sender’?

Programmatically get path to Application Support folder

I’m trying to get an NSString for the user’s Application Support folder. I know I can do NSString *path = @”~/Library/Application Support”; but this doesn’t seem very elegant. I’ve played around with using NSSearchPathForDirectoriesInDomains but it seems to be quite long-winded and creates several unnecessary objects (at least, my implementation of it does). Is there […]

Reload storyboard to change locale

I am using a single, localized Storyboard for my application. The app has to have an option to change language on the fly. So far I figured out how to change the language which is used during the app launch: [[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObjects:@”de”, @”en”, @”fr”, nil] forKey:@”AppleLanguages”]; [[NSUserDefaults standardUserDefaults] synchronize]; //to make the change […]

Removing a notification from notification center on click

Is it possible to remove the push notification from the notification center when one is clicked and the app launches? Most apps seem to leave the notification in place. I read on another question that this: [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; may work however it doesn’t work for me. The Facebook app definitely seems to remove the […]

Go vs. return button in iOS keyboard for HTML input forms

Managing the iOS keyboard for HTML <input> forms (used in UIWebView) is well known, i.e. <input type=”tel”></input> for telephone numbers. https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html But I was wondering about the keyboard’s blue ‘Go’ button. Sometimes the keyboard has a blue ‘Go’ button, sometimes the keyboard has a gray return button. Is there any opportunity to control this behavior […]

Problems with getting text from UIAlertView textfield

In my application I want a alert with a textfield. After clicking on “Done” I want to save the textfield input in a String. After clicking on “Cancel” I want only to close the alert. I’ve created my alert like this: var alert = UIAlertView() alert.title = “Enter Input” alert.addButtonWithTitle(“Done”) alert.alertViewStyle = UIAlertViewStyle.PlainTextInput alert.addButtonWithTitle(“Cancel”) alert.show() […]

Admob banner integration in Cocos2d 2.0 / Admob banner in iphone games

Does anybody know how to make work admob in cocos 2d v2, all the documentation is based in a view root controller and cocos2d 2 go just in another way. The only documentation I found was this: Working-with-admob-and-cocos2d but its a little poor for a newbie like me. If anyone can help me I appreciate […]

Pass UICollectionView touch event to its parent UITableViewCell

Here is the view structure: The outer view is a UITableView. Inside the UITableViewCell, there is a UICollectionView. And notice that there is some black spacing between the collection view cells. When I tap the spacing in the UICollectionView, I want the touch event to pass to the UITableViewCell.

Find the CGPoint on a UIView rectangle intersected by a straight line at a given angle from the center point

In iOS, I’m trying to determine the point on a rectangle intersected by an imaginary line from the center point to the perimeter of the rectangle at a predetermined angle. Say that I know the center point, the size of the rectangle, and the angle (starting from 0 degrees for East and going counterclockwise through […]

Add a circular cropping component for UIImagePicker?

I Have a circular framed UIImageView and I need to add a circular framed cropping tool for the UIImagePickerController, after the image is selected from a photo library. Very similar to Instagram’s UIImagePicker’s crop component. How do I add this type of component? UPDATE I’ve found this repo with a circular cropping tool https://github.com/ruslanskorb/RSKImageCropper but […]