Skip to content

Commit

Permalink
增加 QMUI 常用的 superclass 的模板
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLice committed Apr 6, 2017
1 parent 7a78906 commit ad8d7a2
Show file tree
Hide file tree
Showing 17 changed files with 412 additions and 0 deletions.
13 changes: 13 additions & 0 deletions QMUICommonTableViewController/___FILEBASENAME___.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

___IMPORTHEADER_cocoaTouchSubclass___

@interface ___FILEBASENAMEASIDENTIFIER___ : ___VARIABLE_cocoaTouchSubclass___

@end
65 changes: 65 additions & 0 deletions QMUICommonTableViewController/___FILEBASENAME___.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

#import "___FILEBASENAME___.h"

@interface ___FILEBASENAMEASIDENTIFIER___ ()

@end

@implementation ___FILEBASENAMEASIDENTIFIER___

- (void)didInitialized {
[super didInitialized];
// init 时做的事情请写在这里
}

- (void)viewDidLoad {
[super viewDidLoad];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
}

- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
}

- (void)setNavigationItemsIsInEditMode:(BOOL)isInEditMode animated:(BOOL)animated {
[super setNavigationItemsIsInEditMode:isInEditMode animated:animated];
self.title = @"<##>";
}

#pragma mark - <QMUITableViewDataSource, QMUITableViewDelegate>

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
return nil;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

}

@end
13 changes: 13 additions & 0 deletions QMUICommonViewController/___FILEBASENAME___.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

___IMPORTHEADER_cocoaTouchSubclass___

@interface ___FILEBASENAMEASIDENTIFIER___ : ___VARIABLE_cocoaTouchSubclass___

@end
51 changes: 51 additions & 0 deletions QMUICommonViewController/___FILEBASENAME___.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

#import "___FILEBASENAME___.h"

@interface ___FILEBASENAMEASIDENTIFIER___ ()

@end

@implementation ___FILEBASENAMEASIDENTIFIER___

- (void)didInitialized {
[super didInitialized];
// init 时做的事情请写在这里
}

- (void)viewDidLoad {
[super viewDidLoad];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
}

- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
}

- (void)setNavigationItemsIsInEditMode:(BOOL)isInEditMode animated:(BOOL)animated {
[super setNavigationItemsIsInEditMode:isInEditMode animated:animated];
self.title = @"<##>";
}

@end
13 changes: 13 additions & 0 deletions QMUINavigationController/___FILEBASENAME___.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

___IMPORTHEADER_cocoaTouchSubclass___

@interface ___FILEBASENAMEASIDENTIFIER___ : ___VARIABLE_cocoaTouchSubclass___

@end
22 changes: 22 additions & 0 deletions QMUINavigationController/___FILEBASENAME___.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

#import "___FILEBASENAME___.h"

@interface ___FILEBASENAMEASIDENTIFIER___ ()

@end

@implementation ___FILEBASENAMEASIDENTIFIER___

- (void)didInitialized {
[super didInitialized];
// init 时做的事情请写在这里
}

@end
13 changes: 13 additions & 0 deletions QMUIPopupContainerView/___FILEBASENAME___.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

___IMPORTHEADER_cocoaTouchSubclass___

@interface ___FILEBASENAMEASIDENTIFIER___ : ___VARIABLE_cocoaTouchSubclass___

@end
28 changes: 28 additions & 0 deletions QMUIPopupContainerView/___FILEBASENAME___.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

#import "___FILEBASENAME___.h"

@implementation ___FILEBASENAMEASIDENTIFIER___

- (void)didInitialized {
[super didInitialized];
// init 时做的事情请写在这里,subview 请添加到 self.contentView 上
}

- (CGSize)sizeThatFitsInContentView:(CGSize)size {
// 在这里计算当前控件的 subviews 大小,注意不需要包含 self.contentEdgeInsets
return size;
}

- (void)layoutSubviews {
[super layoutSubviews];
// 所有 subviews 请参照 self.contentView 布局
}

@end
13 changes: 13 additions & 0 deletions QMUITabBarViewController/___FILEBASENAME___.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

___IMPORTHEADER_cocoaTouchSubclass___

@interface ___FILEBASENAMEASIDENTIFIER___ : ___VARIABLE_cocoaTouchSubclass___

@end
22 changes: 22 additions & 0 deletions QMUITabBarViewController/___FILEBASENAME___.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

#import "___FILEBASENAME___.h"

@interface ___FILEBASENAMEASIDENTIFIER___ ()

@end

@implementation ___FILEBASENAMEASIDENTIFIER___

- (void)didInitialized {
[super didInitialized];
// init 时做的事情请写在这里
}

@end
13 changes: 13 additions & 0 deletions QMUITableViewCell/___FILEBASENAME___.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

___IMPORTHEADER_cocoaTouchSubclass___

@interface ___FILEBASENAMEASIDENTIFIER___ : ___VARIABLE_cocoaTouchSubclass___

@end
29 changes: 29 additions & 0 deletions QMUITableViewCell/___FILEBASENAME___.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// ___FILENAME___
// ___PROJECTNAME___
//
// Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

#import "___FILEBASENAME___.h"

@implementation ___FILEBASENAMEASIDENTIFIER___

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
// init 时做的事情请写在这里
}
return self;
}

- (void)updateCellAppearanceWithIndexPath:(NSIndexPath *)indexPath {
[super updateCellAppearanceWithIndexPath:indexPath];
// 每次 cellForRow 时都要做的事情请写在这里
}

- (void)layoutSubviews {
[super layoutSubviews];
}

@end
Binary file added TemplateIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added [email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions TemplateInfo.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Kind</key>
<string>Xcode.IDEFoundation.TextSubstitutionFileTemplateKind</string>
<key>Description</key>
<string>QMUI iOS 框架的基础类</string>
<key>Summary</key>
<string>QMUI iOS 框架的基础类</string>
<key>SortOrder</key>
<string>0</string>
<key>DefaultCompletionName</key>
<string>MyClass</string>
<key>Platforms</key>
<array>
<string>com.apple.platform.iphoneos</string>
</array>
<key>Options</key>
<array>
<dict>
<key>Identifier</key>
<string>productName</string>
<key>Required</key>
<true/>
<key>Name</key>
<string>Class:</string>
<key>Description</key>
<string>The name of the class to create</string>
<key>Type</key>
<string>text</string>
<key>NotPersisted</key>
<true/>
</dict>
<dict>
<key>Identifier</key>
<string>cocoaTouchSubclass</string>
<key>Required</key>
<string>YES</string>
<key>Name</key>
<string>Subclass of:</string>
<key>Description</key>
<string>What class to subclass in the new file</string>
<key>Type</key>
<string>class</string>
<key>Default</key>
<string>NSObject</string>
<key>FallbackHeader</key>
<string>#import &lt;QMUIKit/QMUIKit.h&gt;</string>
<key>Values</key>
<array>
<string>QMUICommonViewController</string>
<string>QMUICommonTableViewController</string>
<string>QMUINavigationController</string>
<string>QMUITabBarViewController</string>
<string>QMUIPopupContainerView</string>
<string>QMUITableViewCell</string>
<string>UIView</string>
</array>
<key>Suffixes</key>
<dict>
<key>QMUICommonViewController</key>
<string>ViewController</string>
<key>QMUICommonTableViewController</key>
<string>TableViewController</string>
<key>QMUINavigationController</key>
<string>NavigationController</string>
<key>QMUITabBarViewController</key>
<string>TabBarViewController</string>
<key>QMUIPopupContainerView</key>
<string>PopupView</string>
<key>QMUITableViewCell</key>
<string>TableViewCell</string>
<key>UIView</key>
<string>View</string>
</dict>
</dict>
</array>
</dict>
</plist>
Loading

0 comments on commit ad8d7a2

Please sign in to comment.