Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shang1219178163 committed Jul 20, 2020
1 parent cdcd038 commit b679c47
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 93 deletions.
8 changes: 8 additions & 0 deletions MacTemplet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
1476854E243425CD00C2C78A /* OthersViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1476854D243425CD00C2C78A /* OthersViewController.swift */; };
147787802428844D00D438CC /* NNButtonStudyController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1477877F2428844C00D438CC /* NNButtonStudyController.swift */; };
147787892428BDED00D438CC /* NSObject+CrashProtector.m in Sources */ = {isa = PBXBuildFile; fileRef = 147787882428BDED00D438CC /* NSObject+CrashProtector.m */; };
147E3066246E1E020076C704 /* NSWorkspace+Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 147E3065246E1E020076C704 /* NSWorkspace+Helper.swift */; };
1480B0D7238CB8F000E24BDB /* Skull.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1480B0D6238CB8F000E24BDB /* Skull.jpg */; };
1480B0D9238CBDC200E24BDB /* NSStackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1480B0D8238CBDC200E24BDB /* NSStackViewController.swift */; };
1480B0E3238CC63900E24BDB /* MapViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1480B0E2238CC63900E24BDB /* MapViewController.swift */; };
Expand Down Expand Up @@ -199,6 +200,7 @@
1477877F2428844C00D438CC /* NNButtonStudyController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NNButtonStudyController.swift; sourceTree = "<group>"; };
147787872428BDED00D438CC /* NSObject+CrashProtector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+CrashProtector.h"; sourceTree = "<group>"; };
147787882428BDED00D438CC /* NSObject+CrashProtector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+CrashProtector.m"; sourceTree = "<group>"; };
147E3065246E1E020076C704 /* NSWorkspace+Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSWorkspace+Helper.swift"; sourceTree = "<group>"; };
1480B0D6238CB8F000E24BDB /* Skull.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Skull.jpg; sourceTree = "<group>"; };
1480B0D8238CBDC200E24BDB /* NSStackViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSStackViewController.swift; sourceTree = "<group>"; };
1480B0E2238CC63900E24BDB /* MapViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -707,6 +709,7 @@
14F5497E24305BEF003BC739 /* AppIconActionController.swift */,
14F5498324306395003BC739 /* NSAlertStudyController.swift */,
14C0093F2431C3B700F490D6 /* NSPanelStudyController.swift */,
147E3065246E1E020076C704 /* NSWorkspace+Helper.swift */,
);
path = Controller;
sourceTree = "<group>";
Expand Down Expand Up @@ -1027,6 +1030,7 @@
14C009402431C3B700F490D6 /* NSPanelStudyController.swift in Sources */,
14F2F58D22B881C4009D49CE /* NSTextFieldCell+Hook.m in Sources */,
1445780F22BDF0520007C7B3 /* NNLanguageModel.m in Sources */,
147E3066246E1E020076C704 /* NSWorkspace+Helper.swift in Sources */,
14F0FDA622ADF20400057093 /* NSView+Hook.m in Sources */,
14705CDA243DAD70009600C9 /* NNSplitViewController.swift in Sources */,
148BB4142437114A00ECEF3B /* DragDropImageView.m in Sources */,
Expand Down Expand Up @@ -1174,9 +1178,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MacTemplet/MacTemplet.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.4.0;
DEVELOPMENT_TEAM = UB99NJ7K8G;
GCC_PREFIX_HEADER = MacTemplet/PrefixHeader.pch;
INFOPLIST_FILE = MacTemplet/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1201,9 +1207,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = MacTemplet/MacTemplet.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.4.0;
DEVELOPMENT_TEAM = UB99NJ7K8G;
GCC_PREFIX_HEADER = MacTemplet/PrefixHeader.pch;
INFOPLIST_FILE = MacTemplet/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
1 change: 1 addition & 0 deletions MacTemplet/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ @implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
[NSFont initializeMethod];

[NSUserDefaults.standardUserDefaults setBool:YES forKey:@"NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints"];
[NSUserDefaults.standardUserDefaults setBool:YES forKey:@"LAYOUT_CONSTRAINTS_NOT_SATISFIABLE"];
[NSUserDefaults.standardUserDefaults setObject:@(0) forKey: @"NSInitialToolTipDelay"];
Expand Down
2 changes: 2 additions & 0 deletions MacTemplet/BatchCreateFiles/NNViewControllerCreater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import UIKit
///
@objcMembers class \(prefix)Controller: UIViewController{
var dataList = NSMutableArray()
lazy var rightBtn: UIButton = {
let button = UIButton.create(.zero, title: "进件须知", imgName: nil, type: 6)
button.sizeToFit()
Expand Down
123 changes: 57 additions & 66 deletions MacTemplet/BatchCreateFiles/NNViewControllerEntryCreater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import UIKit
// if isValidateParams == false {
// return
// }
requestETCFilesAdd()
requestAdd()
}
// lazy var uploadImageVC: IOPUploadImageController = {
Expand Down Expand Up @@ -119,73 +119,62 @@ import UIKit
tableView.reloadData()
}
// MARK: -funtions
func jumpFileAction(_ itemList: [String]) {
// func jumpFileAction(_ itemList: [String]) {
// DDLog(itemList)
let urlString = dataModel.valueText(forKeyPath: itemList[4], defalut: "")
let controller = IOPFileUploadController()
controller.delegate = self
controller.title = itemList[0].replacingOccurrences(of: "*", with: "")
controller.key = itemList[4]
controller.isUpload = urlString == ""
controller.fileUrl = urlString == "" ? nil : NSURL(string: urlString)
//
// let urlString = dataModel.valueText(forKeyPath: itemList[4], defalut: "")
//
// let controller = IOPFileUploadController()
// controller.delegate = self
// controller.title = itemList[0].replacingOccurrences(of: "*", with: "")
// controller.key = itemList[4]
//
// controller.isUpload = urlString == ""
// controller.fileUrl = urlString == "" ? nil : NSURL(string: urlString)
// DDLog("isUpload:%@_fileUrl:%@", controller.isUpload, controller.fileUrl)
navigationController?.pushViewController(controller, animated: true);
}
func jumpXiangce(_ itemList:[String]) {
let controller = UIStoryboard.storyboard(with: "ParkRecord", identifier: "IOPParkRecordImageViewController") as! IOPParkRecordImageViewController
controller.title = itemList[0].replacingOccurrences(of: "*", with: "")
if let url = URL(string: dataModel.value(forKeyPath: itemList[4]) as! String) {
controller.inImageUrlArray = [url]
}
navigationController?.pushViewController(controller, animated: true)
}
func jumpUploadPicture(_ itemList: [String]) {
// navigationController?.pushViewController(controller, animated: true);
// }
//
// func jumpXiangce(_ itemList:[String]) {
// let controller = UIStoryboard.storyboard(with: "ParkRecord", identifier: "IOPParkRecordImageViewController") as! IOPParkRecordImageViewController
// controller.title = itemList[0].replacingOccurrences(of: "*", with: "")
// if let url = URL(string: dataModel.value(forKeyPath: itemList[4]) as! String) {
// controller.inImageUrlArray = [url]
// }
// navigationController?.pushViewController(controller, animated: true)
// }
//
// func jumpUploadPicture(_ itemList: [String]) {
// DDLog(itemList)
let controller = IOPUploadImageController()
controller.delegate = self
controller.title = itemList[0].replacingOccurrences(of: "*", with: "")
controller.key = itemList[4]
let imgUrl = dataModel.valueText(forKeyPath: itemList[4], defalut: "")
controller.imgUrl = imgUrl
controller.isFromPickerVC = false
controller.showImageDefault = true
navigationController?.pushViewController(controller, animated: true)
}
func popToListController() {
let controller = self.navigationController?.viewControllers[1]
if controller != nil && controller is IOPGoodsInPartListController {
self.navigationController?.popToViewController(controller!, animated: true)
} else {
self.navigationController?.popViewController(animated: true)
}
}
func requestETCFilesAdd() {
viewModel.etcFilesAPI.dataModel = dataModel
viewModel.requestETCFilesAdd { (dic) in
DDLog(dic)
if let code = dic["code"] as? String {
if code == "1" {
IOPProgressHUD.showSuccess(withStatus: kAPISuccess)
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
// self.navigationController?.popViewController(animated: true)
self.popToListController()
}
}
} else {
IOPProgressHUD.showError(withStatus: dic["message"] as? String)
}
}
}
//
// let controller = IOPUploadImageController()
// controller.delegate = self
// controller.title = itemList[0].replacingOccurrences(of: "*", with: "")
// controller.key = itemList[4]
//
// let imgUrl = dataModel.valueText(forKeyPath: itemList[4], defalut: "")
// controller.imgUrl = imgUrl
// controller.isFromPickerVC = false
// controller.showImageDefault = true
// navigationController?.pushViewController(controller, animated: true)
// }
func requestAdd() {
// viewModel.etcFilesAPI.dataModel = dataModel
// viewModel.requestETCFilesAdd { (dic) in
// DDLog(dic)
// if let code = dic["code"] as? String {
// if code == "1" {
// IOPProgressHUD.showSuccess(withStatus: kAPISuccess)
// DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
// self.popToListController()
// }
// }
// } else {
// IOPProgressHUD.showError(withStatus: dic["message"] as? String)
// }
// }
// }
}
extension \(prefix)Controller: UITableViewDataSource, UITableViewDelegate{
Expand All @@ -200,7 +189,9 @@ extension \(prefix)Controller: UITableViewDataSource, UITableViewDelegate{
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return tableView.rowHeight
let sections = list[indexPath.section]
let itemList = sections[indexPath.row]
return itemList[2].cgFloatValue
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
Expand Down
11 changes: 8 additions & 3 deletions MacTemplet/BatchCreateFiles/NNViewControllerListCreater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import UIKit
return viewModel
}()
var dataList = NSMutableArray()
// MARK: - lazy
lazy var tableView: UITableView = {
let view: UITableView = UITableView.create(self.view.bounds, style: .plain, rowHeight: 60)
Expand Down Expand Up @@ -130,7 +132,8 @@ import UIKit
view.addSubview(searchBar);
view.addSubview(tipLab);
view.addSubview(tableView);
searchBar.isHidden = true
}
func requestForSearch(_ searchbar: UISearchBar) {
Expand All @@ -152,12 +155,14 @@ extension \(prefix)Controller: UITableViewDataSource, UITableViewDelegate{
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return tableView.rowHeight
let sections = list[indexPath.section]
let itemList = sections[indexPath.row]
return itemList[2].cgFloatValue
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell.cellWithTableView(tableView, identifier: "UITableViewCellSubtitle", style: .subtitle)
let cell = UITableViewCell.dequeueReusableCell(tableView, identifier: "UITableViewCellSubtitle", style: .subtitle)
cell.textLabel?.font = UIFont.systemFont(ofSize: 15)
cell.textLabel?.text = "--"
cell.textLabel?.textColor = UIColor.textColor3;
Expand Down
26 changes: 8 additions & 18 deletions MacTemplet/BatchCreateFiles/NNViewCreater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ class NNViewCreater: NSObject {
return """
\(copyRight)
import UIKit
import SnapKit
import SwiftExpand
@objc protocol \(name)Delegate{
@objc func \(name.lowercased())(_ rangeView: \(name))
@objc func \(name.lowercased())(_ rangeView: \(name))
}
///
class \(name): UIView {
@objcMembers class \(name): UIView {
weak var delegate: \(name)Delegate?
Expand Down Expand Up @@ -61,23 +60,14 @@ class \(name): UIView {
}
//MARK: - lazy
lazy var btnCancell: UIButton = {
let view = UIButton(type: .custom);
view.tag = 0;
//MARK: -lazy
lazy var imgView: UIImageView = {
var view = UIImageView(frame: .zero);
view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.image = UIImage(named: "icon_avatar")
view.titleLabel?.font = UIFont.systemFont(ofSize: 16);
view.setTitle(kTitleCancell, for: .normal);
view.setTitleColor(.lightGray, for: .normal);
view.addActionHandler({ (control) in
if let sender = control as? UIButton {
self.viewBlock!(self,sender.tag);
self.dismiss();
}
}, for: .touchUpInside)
return view;
}();
}()
lazy var label: UILabel = {
let view = UILabel(frame: .zero);
Expand Down
6 changes: 3 additions & 3 deletions MacTemplet/HomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ - (void)setupUI{
@[@"NNButtonStyleController", @"NSButon研究",],
@[@"NNButtonStudyController", @"NNButton封装",],
@[@"NNLabelStudyController", @"NNLabel封装",],
// @[@"TmpViewController", @"Tmp模块",],
// @[@"OthersViewController", @"Others",],
// @[@"NNSplitViewController", @"SplitView",],
@[@"TmpViewController", @"Tmp模块",],
@[@"OthersViewController", @"Others",],
@[@"NNSplitViewController", @"SplitView",],

// @[@"YYModelSwiftController", @"YYModelSwift",],
// @[@"CollectionViewController", @"CollectionView模块",],
Expand Down
4 changes: 3 additions & 1 deletion MacTemplet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>202004210858</string>
<string>202007202029</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSDownloadsFolderUsageDescription</key>
<string>App需要您的文件夹操作权限,创建您需要的的文件</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 Bin Shang. All rights reserved.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
Expand Down
1 change: 0 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def common_pods

# pod 'FlatButton'


end

target 'MacTemplet' do
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ App代码助手

![iOS类批量生成](https://github.com/shang1219178163/MacTemplet/blob/master/ScreenShots/batchClassCreate.png?raw=true)

![mac 地图定位](https://github.com/shang1219178163/MacTemplet/blob/master/ScreenShots/ScreenShots3.png?raw=true)
![mac 地图定位](https://github.com/shang1219178163/MacTemplet/blob/master/ScreenShots/ScreenShots3.png?raw=true)

附:
Mac OS 10.14之后,需要获取完全磁盘访问权限,才能访问Mail,Messages,Safari,Home,Time Machine backups等等为所有用户准备的工具区域。
Binary file not shown.

0 comments on commit b679c47

Please sign in to comment.