diff --git a/CCLoader Plugin.xctemplate/CCSection-Protocol.h b/CCLoader Plugin.xctemplate/CCSection-Protocol.h new file mode 100755 index 0000000..6cba5f1 --- /dev/null +++ b/CCLoader Plugin.xctemplate/CCSection-Protocol.h @@ -0,0 +1,27 @@ +#import +#import + +@protocol CCSectionDelegate + +- (void)updateStatusText:(NSString *)text; +- (void)requestControlCenterDismissal; +- (void)sectionHeightChanged; +- (void)showViewController:(UIViewController *)vc animated:(BOOL)animated completion:(void (^)(void))completion; + +@end + +@protocol CCSection + +@required +- (UIView *)view; + +- (CGFloat)sectionHeight; + +@optional +- (void)setDelegate:(UIViewController *)delegate; + +- (void)controlCenterWillAppear; + +- (void)controlCenterDidDisappear; + +@end diff --git a/CCLoader Plugin.xctemplate/Info.plist b/CCLoader Plugin.xctemplate/Info.plist new file mode 100755 index 0000000..ad90716 --- /dev/null +++ b/CCLoader Plugin.xctemplate/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleName + ___PACKAGENAME___ + CFBundleIdentifier + ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.___VARIABLE_productName:RFC1034Identifier___ + CFBundleDisplayName + ___PACKAGENAME___ + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + DTPlatformName + iphoneos + MinimumOSVersion + 7.0 + CCReplacingStockSectionID + ___VARIABLE_REPLACESECTION___ + NSPrincipalClass + ___PACKAGENAME___Section + + diff --git a/CCLoader Plugin.xctemplate/TemplateIcon.icns b/CCLoader Plugin.xctemplate/TemplateIcon.icns new file mode 100644 index 0000000..9c46ee0 Binary files /dev/null and b/CCLoader Plugin.xctemplate/TemplateIcon.icns differ diff --git a/CCLoader Plugin.xctemplate/TemplateInfo.plist b/CCLoader Plugin.xctemplate/TemplateInfo.plist new file mode 100755 index 0000000..8bf6580 --- /dev/null +++ b/CCLoader Plugin.xctemplate/TemplateInfo.plist @@ -0,0 +1,146 @@ + + + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + de.j-gessner.ccloader.iosopendevtemplate + Concrete + + Description + Template for a CCLoader Control Center section. + Ancestors + + com.kokoabim.iosopendev.base + + Targets + + + ProductType + com.apple.product-type.bundle + SharedSettings + + GCC_PREFIX_HEADER + ___PACKAGENAME___/___PACKAGENAME___-Prefix.pch + GCC_PRECOMPILE_PREFIX_HEADER + YES + INFOPLIST_FILE + ___PACKAGENAME___/Info.plist + WRAPPER_EXTENSION + bundle + INSTALL_PATH + /Library/CCLoader/Bundles + + BuildPhases + + + Class + Sources + + + Class + Frameworks + + + Class + Headers + + + ShellScript + /opt/iOSOpenDev/bin/iosod --xcbp + ShellPath + /bin/sh + RunOnlyForDeploymentPostprocessing + + Class + ShellScript + + + Frameworks + + Foundation + UIKit + + + + Nodes + + ___PACKAGENAME___-Prefix.pch:objC:importFoundation + ___PACKAGENAME___-Prefix.pch:objC:importCocoa + ___PACKAGENAMEASIDENTIFIER___Section.h + ___PACKAGENAMEASIDENTIFIER___Section.m + ___PACKAGENAMEASIDENTIFIER___SectionView.h + ___PACKAGENAMEASIDENTIFIER___SectionView.m + Package/DEBIAN/control:debianControl:section + Package/DEBIAN/control:debianControl:depends + Info.plist + CCSection-Protocol.h + + Options + + + Identifier + REPLACESECTION + Required + + Name + Replace a stock Control Center section? + Description + Stock Control Center section to replace. Select 'None' to create an additional section for Control Center. + Type + popup + Default + None + Values + + None + com.apple.controlcenter.brightness + com.apple.controlcenter.settings + com.apple.controlcenter.media-controls + com.apple.controlcenter.air-stuff + com.apple.controlcenter.quick-launch + + + + Definitions + + ___PACKAGENAMEASIDENTIFIER___Section.h + + Path + ___PACKAGENAMEASIDENTIFIER___Section.h + + ___PACKAGENAMEASIDENTIFIER___Section.m + + Path + ___PACKAGENAMEASIDENTIFIER___Section.m + + ___PACKAGENAMEASIDENTIFIER___SectionView.h + + Path + ___PACKAGENAMEASIDENTIFIER___SectionView.h + + ___PACKAGENAMEASIDENTIFIER___SectionView.m + + Path + ___PACKAGENAMEASIDENTIFIER___SectionView.m + + CCSection-Protocol.h + + Path + CCSection-Protocol.h + + Info.plist + + Group + Supporting Files + Path + Info.plist + + *:debianControl:section + Section: Addons (ControlCenter) + *:debianControl:depends + Depends: de.j-gessner.ccloader, firmware (>= 7.0) + + + diff --git a/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___Section.h b/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___Section.h new file mode 100755 index 0000000..71741ba --- /dev/null +++ b/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___Section.h @@ -0,0 +1,14 @@ +// +// ___FILENAME___ +// ___PACKAGENAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// + +#import "CCSection-Protocol.h" +#import "___PACKAGENAMEASIDENTIFIER___SectionView.h" + +@interface ___PACKAGENAMEASIDENTIFIER___Section : NSObject + +@end diff --git a/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___Section.m b/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___Section.m new file mode 100755 index 0000000..ed8784e --- /dev/null +++ b/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___Section.m @@ -0,0 +1,81 @@ +// +// ___FILENAME___ +// ___PACKAGENAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// + +#define MRC !__has_feature(objc_arc) + +#if MRC + +#define CC_Strong retain +#define CC_Weak assign + +#else + +#define CC_Strong strong +#define CC_Weak weak + +#endif + +#import "___PACKAGENAMEASIDENTIFIER___Section.h" + +@interface ___PACKAGENAMEASIDENTIFIER___Section () + +@property (nonatomic, CC_Strong) NSBundle *bundle; +@property (nonatomic, CC_Strong) ___PACKAGENAMEASIDENTIFIER___SectionView *view; + +@property (nonatomic, CC_Weak) UIViewController *delegate; + +@end + +@implementation ___PACKAGENAMEASIDENTIFIER___Section + +- (instancetype)init { + self = [super init]; + if (self) { + self.bundle = [NSBundle bundleForClass:[self class]]; + } + return self; +} + +- (CGFloat)sectionHeight { + return 50.0f; +} + +- (void)loadView { + self.view = [[___PACKAGENAMEASIDENTIFIER___SectionView alloc] init]; +} + +- (UIView *)view { + if (!_view) { + [self loadView]; + } + + return _view; +} + +- (void)dealloc { +#if MRC + [self.view release]; +#endif + self.view = nil; + self.bundle = nil; + + +#if MRC + [super dealloc]; +#endif +} + +- (void)controlCenterWillAppear { + +} + +- (void)controlCenterDidDisappear { + +} + +@end diff --git a/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___SectionView.h b/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___SectionView.h new file mode 100755 index 0000000..ed74c78 --- /dev/null +++ b/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___SectionView.h @@ -0,0 +1,14 @@ +// +// ___FILENAME___ +// ___PACKAGENAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// + +#import +#import + +@interface ___PACKAGENAMEASIDENTIFIER___SectionView : UIView + +@end diff --git a/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___SectionView.m b/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___SectionView.m new file mode 100755 index 0000000..0f6eb85 --- /dev/null +++ b/CCLoader Plugin.xctemplate/___PACKAGENAMEASIDENTIFIER___SectionView.m @@ -0,0 +1,26 @@ +// +// ___FILENAME___ +// ___PACKAGENAME___ +// +// Created by ___FULLUSERNAME___ on ___DATE___. +// Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. +// + +#import "___PACKAGENAMEASIDENTIFIER___SectionView.h" + +@implementation ___PACKAGENAMEASIDENTIFIER___SectionView + +- (instancetype)init { + self = [super init]; + if (self) { + //Load additional views + } + return self; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + //Layout any subviews +} + +@end