I am having a issue where my app runs fine when I run it through Xcode but crashes when I launch it manually. I have gone through a lot of posts on SO, but I couldn't find any specific answer. I checked the device log, here is a snippet which I think is the cause of the crash:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000180ff5b9c objc_msgSend +28
1 AppSupport 0x0000000183159f0c _updateDetachedRecord + 32
2 AppSupport 0x0000000183159ffc CPRecordGetProperty + 52
3 AppSupport 0x000000018315a270 CPRecordCopyProperty + 24
4 AddressBook 0x0000000187774498 ABRecordCopyValueUnfiltered + 68
5 AddressBook 0x00000001877743bc ABRecordCopyValue + 68
I am trying to access my address book and fetch a contacts details (whichever the user clicks on) and then display it in a pop-over. Here is a snippet of the code:
NSString *firstName = (__bridge NSString *) ABRecordCopyValue(person, kABPersonFirstNameProperty);
NSString *lastName = (__bridge NSString *) ABRecordCopyValue(person, kABPersonLastNameProperty);
NSString *company = (__bridge NSString *) ABRecordCopyValue(person, kABPersonOrganizationProperty);
NSString *title = (__bridge NSString *) ABRecordCopyValue(person, kABPersonPrefixProperty);
ABMultiValueRef emails = ABRecordCopyValue(person, kABPersonEmailProperty);
NSString *email = (__bridge NSString *)(ABMultiValueCopyValueAtIndex(emails, 0));
ABMultiValueRef phoneNo = ABRecordCopyValue(person, kABPersonPhoneProperty);
NSString *phnNo = (__bridge NSString *)(ABMultiValueCopyValueAtIndex(phoneNo, 0));
ABMultiValueRef skyepeIDs = ABRecordCopyValue(person, kABPersonInstantMessageProperty);
NSDictionary *skyepeID = (__bridge NSDictionary *)(ABMultiValueCopyValueAtIndex(skyepeIDs, 0));
P.S: The app runs completely fine when I run it via Xcode.

Swift compiler optimisationsfor the release build in build settings under under Swift Compiler/Code Generation and if still there then try to turn of thewhole module optimizationas well