diff --git a/Demo.xcodeproj/project.pbxproj b/Demo.xcodeproj/project.pbxproj deleted file mode 100644 index 2e43481..0000000 --- a/Demo.xcodeproj/project.pbxproj +++ /dev/null @@ -1,382 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - E058E156169493BD009A0BCE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E058E155169493BD009A0BCE /* UIKit.framework */; }; - E058E158169493BD009A0BCE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E058E157169493BD009A0BCE /* Foundation.framework */; }; - E058E15A169493BD009A0BCE /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E058E159169493BD009A0BCE /* CoreGraphics.framework */; }; - E058E160169493BD009A0BCE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E058E15E169493BD009A0BCE /* InfoPlist.strings */; }; - E058E162169493BD009A0BCE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E058E161169493BD009A0BCE /* main.m */; }; - E058E166169493BD009A0BCE /* CXAAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E058E165169493BD009A0BCE /* CXAAppDelegate.m */; }; - E058E168169493BD009A0BCE /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = E058E167169493BD009A0BCE /* Default.png */; }; - E058E16A169493BD009A0BCE /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E058E169169493BD009A0BCE /* Default@2x.png */; }; - E058E16C169493BD009A0BCE /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E058E16B169493BD009A0BCE /* Default-568h@2x.png */; }; - E058E17516949402009A0BCE /* CXADemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E058E17416949402009A0BCE /* CXADemoViewController.m */; }; - E058E18A1694A40D009A0BCE /* broom.png in Resources */ = {isa = PBXBuildFile; fileRef = E058E1861694A40D009A0BCE /* broom.png */; }; - E058E18B1694A40D009A0BCE /* broom@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E058E1871694A40D009A0BCE /* broom@2x.png */; }; - E058E18C1694A40D009A0BCE /* camera.png in Resources */ = {isa = PBXBuildFile; fileRef = E058E1881694A40D009A0BCE /* camera.png */; }; - E058E18D1694A40D009A0BCE /* camera@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E058E1891694A40D009A0BCE /* camera@2x.png */; }; - E09B62C41AD7A61A00A8CB79 /* ImageMenuItem.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E09B62C31AD7A61300A8CB79 /* ImageMenuItem.framework */; }; - E09B62C51AD7A61A00A8CB79 /* ImageMenuItem.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E09B62C31AD7A61300A8CB79 /* ImageMenuItem.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - E09B62C21AD7A61300A8CB79 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = E09B62BE1AD7A61300A8CB79 /* ImageMenuItem.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E09B629E1AD7A57900A8CB79; - remoteInfo = ImageMenuItem; - }; - E09B62C61AD7A61A00A8CB79 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = E09B62BE1AD7A61300A8CB79 /* ImageMenuItem.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = E09B629D1AD7A57900A8CB79; - remoteInfo = ImageMenuItem; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - E09B62C81AD7A61A00A8CB79 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - E09B62C51AD7A61A00A8CB79 /* ImageMenuItem.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - E058E151169493BD009A0BCE /* UIMenuItem+CXAImageSupport Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "UIMenuItem+CXAImageSupport Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - E058E155169493BD009A0BCE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - E058E157169493BD009A0BCE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - E058E159169493BD009A0BCE /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - E058E15F169493BD009A0BCE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - E058E161169493BD009A0BCE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - E058E163169493BD009A0BCE /* Demo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Demo-Prefix.pch"; sourceTree = ""; }; - E058E164169493BD009A0BCE /* CXAAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CXAAppDelegate.h; sourceTree = ""; }; - E058E165169493BD009A0BCE /* CXAAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CXAAppDelegate.m; sourceTree = ""; }; - E058E167169493BD009A0BCE /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - E058E169169493BD009A0BCE /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; - E058E16B169493BD009A0BCE /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; - E058E17316949402009A0BCE /* CXADemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CXADemoViewController.h; sourceTree = ""; }; - E058E17416949402009A0BCE /* CXADemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CXADemoViewController.m; sourceTree = ""; }; - E058E1861694A40D009A0BCE /* broom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = broom.png; sourceTree = ""; }; - E058E1871694A40D009A0BCE /* broom@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "broom@2x.png"; sourceTree = ""; }; - E058E1881694A40D009A0BCE /* camera.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = camera.png; sourceTree = ""; }; - E058E1891694A40D009A0BCE /* camera@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "camera@2x.png"; sourceTree = ""; }; - E07759F6169B2FF500151A23 /* Demo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Demo.plist; sourceTree = ""; }; - E09B62BE1AD7A61300A8CB79 /* ImageMenuItem.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = ImageMenuItem.xcodeproj; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - E058E14E169493BD009A0BCE /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E058E156169493BD009A0BCE /* UIKit.framework in Frameworks */, - E058E158169493BD009A0BCE /* Foundation.framework in Frameworks */, - E09B62C41AD7A61A00A8CB79 /* ImageMenuItem.framework in Frameworks */, - E058E15A169493BD009A0BCE /* CoreGraphics.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - E058E146169493BD009A0BCE = { - isa = PBXGroup; - children = ( - E09B62BE1AD7A61300A8CB79 /* ImageMenuItem.xcodeproj */, - E058E15B169493BD009A0BCE /* Demo */, - E058E154169493BD009A0BCE /* Frameworks */, - E058E152169493BD009A0BCE /* Products */, - ); - sourceTree = ""; - }; - E058E152169493BD009A0BCE /* Products */ = { - isa = PBXGroup; - children = ( - E058E151169493BD009A0BCE /* UIMenuItem+CXAImageSupport Demo.app */, - ); - name = Products; - sourceTree = ""; - }; - E058E154169493BD009A0BCE /* Frameworks */ = { - isa = PBXGroup; - children = ( - E058E155169493BD009A0BCE /* UIKit.framework */, - E058E157169493BD009A0BCE /* Foundation.framework */, - E058E159169493BD009A0BCE /* CoreGraphics.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - E058E15B169493BD009A0BCE /* Demo */ = { - isa = PBXGroup; - children = ( - E058E164169493BD009A0BCE /* CXAAppDelegate.h */, - E058E165169493BD009A0BCE /* CXAAppDelegate.m */, - E058E17316949402009A0BCE /* CXADemoViewController.h */, - E058E17416949402009A0BCE /* CXADemoViewController.m */, - E058E15C169493BD009A0BCE /* Supporting Files */, - ); - path = Demo; - sourceTree = ""; - }; - E058E15C169493BD009A0BCE /* Supporting Files */ = { - isa = PBXGroup; - children = ( - E058E1861694A40D009A0BCE /* broom.png */, - E058E1871694A40D009A0BCE /* broom@2x.png */, - E058E1881694A40D009A0BCE /* camera.png */, - E058E1891694A40D009A0BCE /* camera@2x.png */, - E058E15E169493BD009A0BCE /* InfoPlist.strings */, - E058E161169493BD009A0BCE /* main.m */, - E07759F6169B2FF500151A23 /* Demo.plist */, - E058E163169493BD009A0BCE /* Demo-Prefix.pch */, - E058E167169493BD009A0BCE /* Default.png */, - E058E169169493BD009A0BCE /* Default@2x.png */, - E058E16B169493BD009A0BCE /* Default-568h@2x.png */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - E09B62BF1AD7A61300A8CB79 /* Products */ = { - isa = PBXGroup; - children = ( - E09B62C31AD7A61300A8CB79 /* ImageMenuItem.framework */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - E058E150169493BD009A0BCE /* UIMenuItem+CXAImageSupport Demo */ = { - isa = PBXNativeTarget; - buildConfigurationList = E058E16F169493BD009A0BCE /* Build configuration list for PBXNativeTarget "UIMenuItem+CXAImageSupport Demo" */; - buildPhases = ( - E058E14D169493BD009A0BCE /* Sources */, - E058E14E169493BD009A0BCE /* Frameworks */, - E058E14F169493BD009A0BCE /* Resources */, - E09B62C81AD7A61A00A8CB79 /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - E09B62C71AD7A61A00A8CB79 /* PBXTargetDependency */, - ); - name = "UIMenuItem+CXAImageSupport Demo"; - productName = CXAMenuItem; - productReference = E058E151169493BD009A0BCE /* UIMenuItem+CXAImageSupport Demo.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E058E148169493BD009A0BCE /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = CXA; - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = lazyapps; - }; - buildConfigurationList = E058E14B169493BD009A0BCE /* Build configuration list for PBXProject "Demo" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = E058E146169493BD009A0BCE; - productRefGroup = E058E152169493BD009A0BCE /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = E09B62BF1AD7A61300A8CB79 /* Products */; - ProjectRef = E09B62BE1AD7A61300A8CB79 /* ImageMenuItem.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - E058E150169493BD009A0BCE /* UIMenuItem+CXAImageSupport Demo */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - E09B62C31AD7A61300A8CB79 /* ImageMenuItem.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = ImageMenuItem.framework; - remoteRef = E09B62C21AD7A61300A8CB79 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - E058E14F169493BD009A0BCE /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E058E160169493BD009A0BCE /* InfoPlist.strings in Resources */, - E058E168169493BD009A0BCE /* Default.png in Resources */, - E058E16A169493BD009A0BCE /* Default@2x.png in Resources */, - E058E16C169493BD009A0BCE /* Default-568h@2x.png in Resources */, - E058E18A1694A40D009A0BCE /* broom.png in Resources */, - E058E18B1694A40D009A0BCE /* broom@2x.png in Resources */, - E058E18C1694A40D009A0BCE /* camera.png in Resources */, - E058E18D1694A40D009A0BCE /* camera@2x.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - E058E14D169493BD009A0BCE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E058E162169493BD009A0BCE /* main.m in Sources */, - E058E166169493BD009A0BCE /* CXAAppDelegate.m in Sources */, - E058E17516949402009A0BCE /* CXADemoViewController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - E09B62C71AD7A61A00A8CB79 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = ImageMenuItem; - targetProxy = E09B62C61AD7A61A00A8CB79 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - E058E15E169493BD009A0BCE /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - E058E15F169493BD009A0BCE /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - E058E16D169493BD009A0BCE /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - E058E16E169493BD009A0BCE /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - E058E170169493BD009A0BCE /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Demo/Demo-Prefix.pch"; - INFOPLIST_FILE = Demo/Demo.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.lazyapps.UIMenuItem-CXAImageSupport-Demo"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - E058E171169493BD009A0BCE /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Demo/Demo-Prefix.pch"; - INFOPLIST_FILE = Demo/Demo.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.lazyapps.UIMenuItem-CXAImageSupport-Demo"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - E058E14B169493BD009A0BCE /* Build configuration list for PBXProject "Demo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E058E16D169493BD009A0BCE /* Debug */, - E058E16E169493BD009A0BCE /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E058E16F169493BD009A0BCE /* Build configuration list for PBXNativeTarget "UIMenuItem+CXAImageSupport Demo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E058E170169493BD009A0BCE /* Debug */, - E058E171169493BD009A0BCE /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = E058E148169493BD009A0BCE /* Project object */; -} diff --git a/Demo/CXAAppDelegate.h b/Demo/CXAAppDelegate.h deleted file mode 100644 index 9616b5a..0000000 --- a/Demo/CXAAppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// CXAAppDelegate.h -// UIMenuItem+CXAImageSupport -// -// Created by CHEN Xian'an on 1/3/13. -// Copyright (c) 2013 lazyapps. All rights reserved. -// - -#import - -@interface CXAAppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/Demo/CXAAppDelegate.m b/Demo/CXAAppDelegate.m deleted file mode 100644 index c018f2f..0000000 --- a/Demo/CXAAppDelegate.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// CXAAppDelegate.m -// UIMenuItem+CXAImageSupport -// -// Created by CHEN Xian'an on 1/3/13. -// Copyright (c) 2013 lazyapps. All rights reserved. -// - -#import "CXAAppDelegate.h" -#import "CXADemoViewController.h" - -@implementation CXAAppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.rootViewController = [[CXADemoViewController alloc] init]; - [self.window makeKeyAndVisible]; - - return YES; -} - -@end diff --git a/Demo/CXADemoViewController.h b/Demo/CXADemoViewController.h deleted file mode 100644 index 0a23152..0000000 --- a/Demo/CXADemoViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// CXADemoViewController.h -// UIMenuItem+CXAImageSupport -// -// Created by CHEN Xian'an on 1/3/13. -// Copyright (c) 2013 lazyapps. All rights reserved. -// - -#import - -@interface CXADemoViewController : UIViewController - -@end diff --git a/Demo/CXADemoViewController.m b/Demo/CXADemoViewController.m deleted file mode 100644 index d81459a..0000000 --- a/Demo/CXADemoViewController.m +++ /dev/null @@ -1,118 +0,0 @@ -// -// CXADemoViewController.m -// UIMenuItem+CXAImageSupport -// -// Created by CHEN Xian'an on 1/3/13. -// Copyright (c) 2013 lazyapps. All rights reserved. -// - -#import "CXADemoViewController.h" -#import - -@interface CXADemoViewController(){ - UIButton *_button; - UILabel *_label; -} - -- (void)pressme:(id)sender; -- (void)cameraAction:(id)sender; -- (void)broomAction:(id)sender; -- (void)textAction:(id)sender; - -@end - -@implementation CXADemoViewController - -- (id)init -{ - if (self = [super initWithNibName:nil bundle:nil]){ - - } - - return self; -} - -- (void)loadView -{ - [super loadView]; - - self.view.backgroundColor = [UIColor whiteColor]; - _button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [_button setTitle:NSLocalizedString(@"Press Me", nil) forState:UIControlStateNormal]; - [_button addTarget:self action:@selector(pressme:) forControlEvents:UIControlEventTouchUpInside]; - [self.view addSubview:_button]; - _label = [[UILabel alloc] initWithFrame:CGRectZero]; - _label.font = [UIFont fontWithName:@"AvenirNext-Bold" size:15.]; - _label.textAlignment = NSTextAlignmentCenter; - _label.numberOfLines = 0; - _label.text = NSLocalizedString(@"Under MIT License.\n(c) 2013 — Present CHEN Xian’an\n", nil); - [self.view addSubview:_label]; - UIMenuItem *cameraItem = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Camera", nil) action:@selector(cameraAction:) image:[UIImage imageNamed:@"camera"]]; - - UIMenuItem *broomItem = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Broom", nil) action:@selector(broomAction:)]; - CXAMenuItemSettings *settings = [CXAMenuItemSettings new]; - settings.image = [UIImage imageNamed:@"broom"]; - settings.shadowDisabled = YES; - settings.shrinkWidth = 16; - [broomItem cxa_setSettings:settings]; - - UIMenuItem *broomItem2 = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"Broom2", nil) action:@selector(broomAction:)]; - settings.shadowDisabled = NO; - settings.shadowColor = [UIColor redColor]; - [broomItem2 cxa_setSettings:settings]; - - UIMenuItem *textItem = [[UIMenuItem alloc] initWithTitle:NSLocalizedString(@"No Image", nil) action:@selector(textAction:)]; - [UIMenuController sharedMenuController].menuItems = @[cameraItem, broomItem, broomItem2, textItem]; -} - -- (void)viewWillLayoutSubviews -{ - [_button sizeToFit]; - _button.center = self.view.center; - [_label sizeToFit]; - CGRect r = _label.bounds; - r.origin.y = CGRectGetHeight(self.view.bounds) - CGRectGetHeight(r) - 10; - r.size.width = CGRectGetWidth(self.view.bounds); - _label.frame = r; -} - -#pragma mark - -- (BOOL)canBecomeFirstResponder -{ - return YES; -} - -- (BOOL)canPerformAction:(SEL)action - withSender:(id)sender -{ - if (action == @selector(cameraAction:) || - action == @selector(broomAction:) || - action == @selector(textAction:)) - return YES; - - return [super canPerformAction:action withSender:sender]; -} - -#pragma mark - privates -- (void)pressme:(id)sender -{ - [[UIMenuController sharedMenuController] setTargetRect:[sender frame] inView:self.view]; - [[UIMenuController sharedMenuController] setMenuVisible:YES animated:YES]; -} - -- (void)cameraAction:(id)sender -{ - [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Camera Item Pressed", nil) message:nil delegate:nil cancelButtonTitle:NSLocalizedString(@"Dismiss", nil) otherButtonTitles:nil] show]; -} - -- (void)broomAction:(id)sender -{ - [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Broom Item Pressed", nil) message:nil delegate:nil cancelButtonTitle:NSLocalizedString(@"Dismiss", nil) otherButtonTitles:nil] show]; -} - -- (void)textAction:(id)sender -{ - [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Text Item Pressed", nil) message:nil delegate:nil cancelButtonTitle:NSLocalizedString(@"Dismiss", nil) otherButtonTitles:nil] show]; -} - -@end diff --git a/Demo/Default-568h@2x.png b/Demo/Default-568h@2x.png deleted file mode 100644 index 0891b7a..0000000 Binary files a/Demo/Default-568h@2x.png and /dev/null differ diff --git a/Demo/Default.png b/Demo/Default.png deleted file mode 100644 index 4c8ca6f..0000000 Binary files a/Demo/Default.png and /dev/null differ diff --git a/Demo/Default@2x.png b/Demo/Default@2x.png deleted file mode 100644 index 35b84cf..0000000 Binary files a/Demo/Default@2x.png and /dev/null differ diff --git a/Demo/Demo-Prefix.pch b/Demo/Demo-Prefix.pch deleted file mode 100644 index f67cdc0..0000000 --- a/Demo/Demo-Prefix.pch +++ /dev/null @@ -1,14 +0,0 @@ -// -// Prefix header for all source files of the 'UIMenuItem+CXAImageSupport' target in the 'UIMenuItem+CXAImageSupport' project -// - -#import - -#ifndef __IPHONE_3_0 -#warning "This project uses features only available in iOS SDK 3.0 and later." -#endif - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/Demo/Demo.plist b/Demo/Demo.plist deleted file mode 100644 index 3eb7025..0000000 --- a/Demo/Demo.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - - diff --git a/Demo/broom.png b/Demo/broom.png deleted file mode 100644 index 809cddd..0000000 Binary files a/Demo/broom.png and /dev/null differ diff --git a/Demo/broom@2x.png b/Demo/broom@2x.png deleted file mode 100644 index 03ad458..0000000 Binary files a/Demo/broom@2x.png and /dev/null differ diff --git a/Demo/camera.png b/Demo/camera.png deleted file mode 100644 index ab64bfc..0000000 Binary files a/Demo/camera.png and /dev/null differ diff --git a/Demo/camera@2x.png b/Demo/camera@2x.png deleted file mode 100644 index 84133b9..0000000 Binary files a/Demo/camera@2x.png and /dev/null differ diff --git a/Demo/en.lproj/InfoPlist.strings b/Demo/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/Demo/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/Demo/main.m b/Demo/main.m deleted file mode 100644 index f8aca1b..0000000 --- a/Demo/main.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// main.m -// UIMenuItem+CXAImageSupport -// -// Created by CHEN Xian'an on 1/3/13. -// Copyright (c) 2013 lazyapps. All rights reserved. -// - -#import - -#import "CXAAppDelegate.h" - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([CXAAppDelegate class])); - } -}