Skip to content

Instantly share code, notes, and snippets.

@choefele
choefele / extension
Last active April 22, 2025 10:51
How to know at run-time whether your code runs inside an iOS extension
NSDictionary *extensionInfo = [NSBundle.mainBundle objectForInfoDictionaryKey:@"NSExtension"];
NSString *extensionPointIdentifier = extensionInfo[@"NSExtensionPointIdentifier"];
if ([extensionPointIdentifier isEqualToString:@"com.apple.watchkit"]) {
NSLog(@"WatchKit extension");
} else if ([extensionPointIdentifier isEqualToString:@"com.apple.widget-extension"]) {
NSLog(@"Widget extension");
} else if (extensionPointIdentifier == nil) {
NSLog(@"iOS app");
} else {
NSLog(@"Unknown extension type");
@choefele
choefele / Xcode crash
Last active August 29, 2015 14:00
Xcode crash when opening help
Process: Xcode [1860]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 5.1.1 (5085)
Build Info: IDEFrameworks-5085000000000000~10
App Item ID: 497799835
App External ID: 520942841
Code Type: X86-64 (Native)
Parent Process: launchd [251]
Responsible: Xcode [1860]
//
// CCHLinkLabel.h
// Stolpersteine
//
// Created by Hoefele, Claus(choefele) on 21.01.14.
// Copyright (c) 2014 Option-U Software. All rights reserved.
//
#import <UIKit/UIKit.h>