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

Force camera view in landscape with orientation lock on

I am developing an augmented reality game, and I’ve encountered an issue with the orientation of the camera view when the orientation lock of the device is on. I am using this code to load the camera view inside of a View: AVCaptureSession *session = [[AVCaptureSession alloc] init]; AVCaptureVideoPreviewLayer *captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session]; captureVideoPreviewLayer.frame […]

Interface Builder Objects not visible in my storyboard (and titles are transparent)

I am using the same version of XCode as another developer I am working with but when I open the project on my machine the interface objects are not visible in the storyboard and their names are semi-transparent. I’ve Googled around but I cannot seem to figure out why this might be happening. Any ideas […]

Strange Crash when dismissing view controller, auto-layout to blame?

I am experiencing a very strange crash, here is the backtrace. * thread #1: tid = 0x2403, 0x3379516c CoreFoundation`CFHash + 8, stop reason = EXC_BREAKPOINT (code=EXC_ARM_BREAKPOINT, subcode=0xdefe) frame #0: 0x3379516c CoreFoundation`CFHash + 8 frame #1: 0x33797a9c CoreFoundation`CFBasicHashRemoveValue + 1408 frame #2: 0x337974ee CoreFoundation`CFDictionaryRemoveValue + 166 frame #3: 0x3420988e Foundation`-[NSISEngine removeConstraintWithMarker:] + 562 frame #4: 0x34211dbe […]

Differentiating between initial buy and free “re-buy” in StoreKit/In-App Purchase

From the StoreKit guide: If the user attempts to purchase a nonconsumable product or a renewable subscription they have already purchased, your application receives a regular transaction for that item, not a restore transaction. However, the user is not charged again for that product. Your application should treat these transactions identically to those of the […]

How to properly hide these ad banners?

(Sprite Kit Game) I want my ad banners to be hidden during gameplay. I’ve set up my project to contain both iAd and AdMob advertisement banners. Prior to adding in the AdMob SDK and the code for the AdMob advertisements, I had no problem with hiding the iAd banner when I wanted it hidden. Now […]

Zoom on a two dimensional UICollectionView

I created a UICollectionView which is horizontal and vertically. It has different UICollectionViewCells. Everything is layouted correctly. Now I am trying to make it zoomable. The UICollectionViewCells are resized correctly too. Every time the UIPinchGesture occures, I set the itemSize inside the UICollectionViewLayout dependend on the scale. TestLayout *layout = (TestLayout *) self.collectionViewLayout; CGSize newItemSize […]

How to create vCard/vcf file to use in share sheet?

I’m new to swift and methods I am finding are deprecated regarding my issue. I’m building a directory app and I’m pulling contact data from an API, not from the phone’s address book. In iOS, if you go to your address book, you can select a contact and choose ‘Share Contact’ which brings up a […]

Unique Identification of iOS device

I was using Mac address for unique identification of the iOS device, but from iOS7 the system always returns 02:00:00:00:00:00 value. I had searched three options for the mentioned issue: Vendor identification Advertising identification Getting serial number using IOUnit framework Since the IOUnitFramework is not approved by appstore, cant use it in my application. And […]

applicationWillResignActive and setBrightness not working?

I use [[UIScreen mainScreen]setBrightness: ] (in sdk 5.0) to change the system background light in my app. The following steps work with my app: Active the app, get the system brightness as default, then save as sysBright. Change the brightness with my app, changed brightness, then save as appBright. ResignActive app with home button or […]

NSPredicate 'The left hand side for an ALL or ANY operator must be either an NSArray or NSSet'

Not totally sure why this isn’t working now, i thought it had been working previously. Does anyone see an issue with this FetchRequest construction? – (NSArray *)entriesForDate:(NSDate *)date { NSFetchRequest *request = [[NSFetchRequest alloc]initWithEntityName:@”Entry”]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@”ANY addedOn.unique like %@”, [T3Utility identifierForDate:date]]; request.predicate = predicate; NSError *error = nil; NSArray *matches = [self.database.managedObjectContext […]