I wrote like this in my main app file which is shared with extension too.
Detect whether run target is App Extension or iOS App
#ifdef SHARE_EXTENSION
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:APP_NAME message:@"You only have 1 photo. Confirm deletion? (Please note that you have to submit at least 1 photo for iFeedback)." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
[alert show];
#endif
However, it still give me error saying that UIAlertview can't be used in extension. I need to share that file too and don't wana create another same file just only for this code. How shall I check?