-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 68c2417
Showing
5 changed files
with
275 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# createSwift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// PnffIdqbVController.swift | ||
// Orange | ||
|
||
// Created by Ashen on 18/06/06. | ||
// Copyright © 2018年 BeiLian. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class PnffIdqbVController: UIViewController { | ||
|
||
public var PnffIdqb:UIScrollView! | ||
public var YkkhbrFpzjqe:UILabel! | ||
public var QhvzFbqo:UIColor! | ||
|
||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
} | ||
|
||
public func PnffIdqbTOVC() { | ||
|
||
var realArr = Array<String>() | ||
realArr.append("PnffIdqb") | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("PnffIdqb") | ||
realArr.append("YkkhbrFpzjqe") | ||
|
||
} | ||
|
||
public func YkkhbrFpzjqeTOVC() { | ||
|
||
var realArr = Array<String>() | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("PnffIdqb") | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("YkkhbrFpzjqe") | ||
|
||
} | ||
|
||
public func QhvzFbqoTOVC() { | ||
|
||
var realArr = Array<String>() | ||
realArr.append("QhvzFbqo") | ||
realArr.append("QhvzFbqo") | ||
realArr.append("PnffIdqb") | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// QhvzFbqoVController.swift | ||
// Orange | ||
|
||
// Created by Ashen on 18/06/06. | ||
// Copyright © 2018年 BeiLian. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class QhvzFbqoVController: UIViewController { | ||
|
||
public var YkkhbrFpzjqe:UISlider! | ||
public var QhvzFbqo:UIButton! | ||
|
||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
} | ||
|
||
public func PnffIdqbTOVC() { | ||
|
||
var realArr = Array<String>() | ||
realArr.append("QhvzFbqo") | ||
realArr.append("PnffIdqb") | ||
realArr.append("QhvzFbqo") | ||
realArr.append("PnffIdqb") | ||
realArr.append("PnffIdqb") | ||
realArr.append("PnffIdqb") | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("PnffIdqb") | ||
|
||
} | ||
|
||
public func YkkhbrFpzjqeTOVC() { | ||
|
||
var realArr = Array<String>() | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("QhvzFbqo") | ||
realArr.append("QhvzFbqo") | ||
|
||
} | ||
|
||
public func QhvzFbqoTOVC() { | ||
|
||
var realArr = Array<String>() | ||
realArr.append("QhvzFbqo") | ||
realArr.append("QhvzFbqo") | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("QhvzFbqo") | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("YkkhbrFpzjqe") | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// YkkhbrFpzjqeVController.swift | ||
// Orange | ||
|
||
// Created by Ashen on 18/06/06. | ||
// Copyright © 2018年 BeiLian. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class YkkhbrFpzjqeVController: UIViewController { | ||
|
||
public var PnffIdqb:UILabel! | ||
public var YkkhbrFpzjqe:UIColor! | ||
public var QhvzFbqo:UIView! | ||
|
||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
} | ||
|
||
public func PnffIdqbTOVC() { | ||
|
||
var realArr = Array<String>() | ||
realArr.append("PnffIdqb") | ||
realArr.append("QhvzFbqo") | ||
realArr.append("PnffIdqb") | ||
realArr.append("QhvzFbqo") | ||
realArr.append("PnffIdqb") | ||
realArr.append("QhvzFbqo") | ||
realArr.append("QhvzFbqo") | ||
|
||
} | ||
|
||
public func YkkhbrFpzjqeTOVC() { | ||
|
||
var realArr = Array<String>() | ||
realArr.append("QhvzFbqo") | ||
realArr.append("QhvzFbqo") | ||
realArr.append("QhvzFbqo") | ||
|
||
} | ||
|
||
public func QhvzFbqoTOVC() { | ||
|
||
var realArr = Array<String>() | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("YkkhbrFpzjqe") | ||
realArr.append("PnffIdqb") | ||
realArr.append("PnffIdqb") | ||
realArr.append("QhvzFbqo") | ||
realArr.append("QhvzFbqo") | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import random | ||
|
||
import os,sys | ||
|
||
import string | ||
|
||
#创建.swift文件 | ||
|
||
def createSwift(fileNmae,propertyNumber,methodArray): | ||
|
||
full_path = sys.path[0] + '/SwiftFiles/' + fileNmae + '.swift' | ||
|
||
file = open(full_path, 'w') | ||
|
||
file.write('//\n// '+fileNmae+'.swift\n// Orange\n\n// Created by Ashen on 18/06/06.\n// Copyright © 2018年 BeiLian. All rights reserved.\n//\n\n') | ||
|
||
file.write('import UIKit \n\n' + 'class '+fileNmae+': UIViewController {\n\n') | ||
|
||
propryNameArray = [] | ||
|
||
for index in range(1,propertyNumber): | ||
|
||
propryNameArray.append(random.choice(array)) | ||
|
||
propryNameArray = list(set(propryNameArray)) | ||
|
||
for propertyName in propryNameArray: | ||
|
||
file.write(' public var '+propertyName+':'+random.choice(classArray)+'!\n') | ||
|
||
file.write('\n\n') | ||
|
||
file.write(' override func viewDidLoad() {\n super.viewDidLoad()\n }\n\n') | ||
|
||
|
||
for methodName in methodArray: | ||
|
||
file.write(' public func '+methodName+'TOVC() {\n\n var realArr = Array<String>()\n') | ||
|
||
number = random.randint(3, 10) | ||
|
||
for i in range(1,number): | ||
|
||
file.write(' realArr.append("'+random.choice(array)+'")\n') | ||
|
||
file.write('\n }\n\n') | ||
|
||
file.write('}') | ||
|
||
file.close() | ||
|
||
print('Done') | ||
|
||
|
||
def createClassName(): | ||
|
||
first = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | ||
|
||
second = "abcdefghijklmnopqrstuvwxyz" | ||
|
||
index = 0 | ||
|
||
array = [] | ||
|
||
# 设置生成多少个类 | ||
classNumber = 3 | ||
for i in range(classNumber): | ||
|
||
final=(random.choice(first)) | ||
|
||
index = random.randint(3, 5) | ||
|
||
for i in range(index): | ||
|
||
final+=(random.choice(second)) | ||
|
||
final += (random.choice(first)) | ||
|
||
for i in range(index): | ||
|
||
final+=(random.choice(second)) | ||
|
||
array.append(final) | ||
return array | ||
|
||
#属性类型 | ||
classArray = ['UIColor','UILabel','UITableView','UISlider','UIScrollView','UIView','UIButton'] | ||
|
||
array = createClassName() | ||
|
||
array = list(set(array)) | ||
|
||
for name in array: | ||
|
||
number = random.randint(3, 10) | ||
|
||
methodArray = [] | ||
|
||
for i in range(1,5): | ||
|
||
methodArray.append(random.choice(array)) | ||
|
||
methodArray = list(set(methodArray))#数组去重 | ||
|
||
createSwift(name+'VController',number,methodArray) | ||
|