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

Badge Count is not increasing for push notification.always badge count remains 1?

My app badge count in not increasing when app is in background for push notifications.Count increase by 1 only for the first push notification and always remains badge count as 1, if i get more then 1 notification also badge count remaing 1 only. Below is my code – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { NSString […]

Badge count is persisted after deleting an app and installing it again

My application has a notification section in it, and the sum of the notifications are displayed in the form of Badge Count on the app icon. When the user accesses the notifications the Badge count decreases. Suppose the User now uninstalls the build and reinstalls it, the badge count is displayed on the app icon […]

iPhone 4 is there an absolutely certain way to have a long term NSTimer fire

I keep having troubles with my NSTimers and background selectors. It is driving me nuts and takes a very long time to try out each tweak. To preserve my sanity, and the sanity of future generations of cocoa programmers, I’m asking this question: Is there an absolutely 100% sure way to have a scheduled, long-term […]

How to ask for permission to access iphone contacts adressbook again?

Hello everyone I am asking permission to access my contacts using the code below. ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) { ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) { } else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized) { } else { } So far everything is working but however if I delete the app and debug […]

CNContact last modified date and contacts changed

Questions: How to get the last modified date in CNContact (new apple contacts framework) ? The last modified date is not present in the list of keysToFetch I would like to fetch and update contacts that have been modified since my last fetch. How can I do this ?

Apply CGAffineTransform prior to layer being displayed

I’m trying to scale an AVCaptureVideoPreviewLayer so it displays a “zoomed in” preview from the camera; I can make this work using setAffineTransform:CGAffineTransformMakeScale(2.0f, 2.0f), but only once the layer is visible on screen. That is, the scale transform doesn’t seem to take effect unless I call it (from within a CATransaction) during a callback like […]

Apple FaceTime URL Scheme not initiating call

Using Apple’s URL Scheme Reference for FaceTime Links on a website, the link opens the FaceTime app but doesn’t pass the number/email to be called or start the FaceTime call. <a href=”facetime:user@example.com”>Connect using FaceTime</a> Is this scheme still supported? Any thoughts? Additional Info Edit: This is the actual code I’m using: <a href=”facetime:user@abc.com”>Apple FaceTime</a> This […]

How to achieve paint brush strokes in iOS

I am developing an iOS app that uses a paint brush to draw in a board.I have created a simple paint tool with which user can paint,but what I really need is a paint tool that draws with brush stroke.Is there anyway to achieve the same in native iOS app development? please see the link […]

NSUserDefaults Lose Newly Saved Data if App Killed Within 10 Seconds

I’m looking for a faster way to save user preferences than the NSUserDefaults. I’ve found that if the app is killed within around 10 seconds of writing to NSUserDefaults, it will not be saved permanently. I use the defaults to save paths to custom ring tones, paths to custom images, map coordinates, and basically just […]

Spritekit scale full game to iPad

So I’m developing a game on Xcode using Spritekit, for the iPhone. And it looks all the same and great on all iPhone devices, by using the node.setScale() method. Now I want to make it Universal and runnable on the iPad as well. How do I do this easily? Is there some formula for the […]