Skip to content

Commit 2fe3463

Browse files
committed
Update for 1.3.2
1 parent 759892c commit 2fe3463

File tree

366 files changed

+16113
-6875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

366 files changed

+16113
-6875
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [1.3.2](https://github.com/HDB-Li/LLDebugToolSwift/releases/tag/1.3.2) (09/29/2019)
2+
3+
### Synchronous update
4+
5+
#### Update
6+
7+
* Update `LLog.swift`, In order to solve `LLLogHelper` isn't public in `LLDebugTool`.
8+
19
## [1.3.1](https://github.com/HDB-Li/LLDebugToolSwift/releases/tag/1.3.1) (09/06/2019)
210

311
### Synchronous update

LLDebugToolSwift.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "LLDebugToolSwift"
3-
s.version = "1.3.1"
3+
s.version = "1.3.2"
44
s.summary = "LLDebugTool is a debugging tool for developers and testers that can help you analyze and manipulate data in non-xcode situations."
55
s.homepage = "https://github.com/HDB-Li/LLDebugToolSwift"
66
s.license = "MIT"
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
1111
s.requires_arc = true
1212
s.source_files = "LLDebugToolSwift/**/*.{h,m,swift}"
1313
# s.resources = "LLDebugToolSwift/**/*.{xib,storyboard,bundle}"
14-
s.dependency "LLDebugTool" , '1.3.1'
14+
s.dependency "LLDebugTool" , '1.3.2'
1515
s.swift_version = "4.0"
1616

1717
end

LLDebugToolSwift/LLog.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class LLog: NSObject {
3737
/// Log a normal message with event.
3838
public static func log(message : String? , event : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
3939
#if DEBUG
40-
LLLogHelper.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .default, onEvent: event, message: message)
40+
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .default, onEvent: event, message: message)
4141
#endif
4242
}
4343

@@ -49,7 +49,7 @@ public class LLog: NSObject {
4949
/// Log a alert message with event.
5050
public static func alertLog(message : String? , event : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
5151
#if DEBUG
52-
LLLogHelper.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .alert, onEvent: event, message: message)
52+
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .alert, onEvent: event, message: message)
5353
#endif
5454
}
5555

@@ -61,7 +61,7 @@ public class LLog: NSObject {
6161
/// Log a warning message with event.
6262
public static func warningLog(message : String? , event : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
6363
#if DEBUG
64-
LLLogHelper.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .warning, onEvent: event, message: message)
64+
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .warning, onEvent: event, message: message)
6565
#endif
6666
}
6767

@@ -73,7 +73,7 @@ public class LLog: NSObject {
7373
/// Log a error message with event.
7474
public static func errorLog(message : String? , event : String? , file : String = #file , function : String = #function , lineNumber : Int = #line) {
7575
#if DEBUG
76-
LLLogHelper.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .error, onEvent: event, message: message)
76+
LLDebugTool.shared().log(inFile: (file as NSString).lastPathComponent, function: function, lineNo: lineNumber, level: .error, onEvent: event, message: message)
7777
#endif
7878
}
7979

LLDebugToolSwiftDemo.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
36762101214A6D9F00F433EE /* TestLogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36762100214A6D9F00F433EE /* TestLogViewController.swift */; };
2525
36762103214A6DA800F433EE /* TestNetworkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36762102214A6DA800F433EE /* TestNetworkViewController.swift */; };
2626
36762105214A6DB300F433EE /* TestWindowStyleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36762104214A6DB300F433EE /* TestWindowStyleViewController.swift */; };
27+
36FB8E6D23409F5C00ACB6CB /* TestHierarchyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36FB8E6C23409F5C00ACB6CB /* TestHierarchyViewController.swift */; };
2728
75C3C7BAEB5DA6775A13824C /* Pods_LLDebugToolSwiftDemoTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD3780C4404350A00107BAAD /* Pods_LLDebugToolSwiftDemoTests.framework */; };
2829
9B3FB081B8AD3B63B74EAB84 /* Pods_LLDebugToolSwiftDemoUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 48CCDFFC351EDFC7025E3FFD /* Pods_LLDebugToolSwiftDemoUITests.framework */; };
2930
C4320D41214DFB41000CC110 /* MyService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4320D40214DFB41000CC110 /* MyService.swift */; };
@@ -80,6 +81,7 @@
8081
36762100214A6D9F00F433EE /* TestLogViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestLogViewController.swift; sourceTree = "<group>"; };
8182
36762102214A6DA800F433EE /* TestNetworkViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestNetworkViewController.swift; sourceTree = "<group>"; };
8283
36762104214A6DB300F433EE /* TestWindowStyleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestWindowStyleViewController.swift; sourceTree = "<group>"; };
84+
36FB8E6C23409F5C00ACB6CB /* TestHierarchyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestHierarchyViewController.swift; sourceTree = "<group>"; };
8385
48CCDFFC351EDFC7025E3FFD /* Pods_LLDebugToolSwiftDemoUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LLDebugToolSwiftDemoUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8486
4DB594A6FA49274F4506B10D /* Pods-LLDebugToolSwiftDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LLDebugToolSwiftDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LLDebugToolSwiftDemo/Pods-LLDebugToolSwiftDemo.debug.xcconfig"; sourceTree = "<group>"; };
8587
6CB7EDE77CABE52E9125F0D6 /* Pods-LLDebugToolSwiftDemoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LLDebugToolSwiftDemoTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-LLDebugToolSwiftDemoTests/Pods-LLDebugToolSwiftDemoTests.release.xcconfig"; sourceTree = "<group>"; };
@@ -203,6 +205,7 @@
203205
36762100214A6D9F00F433EE /* TestLogViewController.swift */,
204206
36762102214A6DA800F433EE /* TestNetworkViewController.swift */,
205207
36762104214A6DB300F433EE /* TestWindowStyleViewController.swift */,
208+
36FB8E6C23409F5C00ACB6CB /* TestHierarchyViewController.swift */,
206209
);
207210
path = DemoViewControllers;
208211
sourceTree = "<group>";
@@ -381,6 +384,7 @@
381384
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
382385
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
383386
"${BUILT_PRODUCTS_DIR}/LLDebugTool/LLDebugTool.framework",
387+
"${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework",
384388
"${BUILT_PRODUCTS_DIR}/Moya/Moya.framework",
385389
"${BUILT_PRODUCTS_DIR}/Result/Result.framework",
386390
);
@@ -389,6 +393,7 @@
389393
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
390394
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework",
391395
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LLDebugTool.framework",
396+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework",
392397
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Moya.framework",
393398
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Result.framework",
394399
);
@@ -463,6 +468,7 @@
463468
36762105214A6DB300F433EE /* TestWindowStyleViewController.swift in Sources */,
464469
367620FD214A6D8700F433EE /* TestColorStyleViewController.swift in Sources */,
465470
36762101214A6D9F00F433EE /* TestLogViewController.swift in Sources */,
471+
36FB8E6D23409F5C00ACB6CB /* TestHierarchyViewController.swift in Sources */,
466472
36762103214A6DA800F433EE /* TestNetworkViewController.swift in Sources */,
467473
364A05D2214922EF0056719F /* LLog.swift in Sources */,
468474
367620FB214A6D6400F433EE /* BaseTestViewController.swift in Sources */,
@@ -667,6 +673,7 @@
667673
INFOPLIST_FILE = LLDebugToolSwiftDemo/Info.plist;
668674
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
669675
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
676+
MARKETING_VERSION = 1.3.2;
670677
PRODUCT_BUNDLE_IDENTIFIER = myCompany.HDB.LLDebugToolSwiftDemo;
671678
PRODUCT_NAME = "$(TARGET_NAME)";
672679
SWIFT_VERSION = 4.0;
@@ -684,6 +691,7 @@
684691
INFOPLIST_FILE = LLDebugToolSwiftDemo/Info.plist;
685692
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
686693
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
694+
MARKETING_VERSION = 1.3.2;
687695
PRODUCT_BUNDLE_IDENTIFIER = myCompany.HDB.LLDebugToolSwiftDemo;
688696
PRODUCT_NAME = "$(TARGET_NAME)";
689697
SWIFT_VERSION = 4.0;

LLDebugToolSwiftDemo/DemoViewControllers/TestColorStyleViewController.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class TestColorStyleViewController: BaseTestViewController {
3333
cell.textLabel?.text = "Use \"LLConfigColorStyleSystem\""
3434
cell.accessoryType = LLConfig.shared().colorStyle == .system ? .checkmark : .none
3535
} else if (indexPath.row == 3) {
36-
cell.textLabel?.text = "Use \"[[LLConfig sharedConfig] configBackgroundColor:[UIColor orangeColor] textColor:[UIColor whiteColor] statusBarStyle:UIStatusBarStyleDefault]\""
36+
cell.textLabel?.text = "Use \"[[LLConfig sharedConfig] configBackgroundColor:[UIColor orangeColor] primaryColor:[UIColor whiteColor] statusBarStyle:UIStatusBarStyleDefault]\""
3737
cell.accessoryType = LLConfig.shared().colorStyle == .custom ? .checkmark : .none
3838
}
3939

@@ -56,22 +56,22 @@ class TestColorStyleViewController: BaseTestViewController {
5656
// MARK: - ACTIONS
5757
func testHackColorStyle() {
5858
LLConfig.shared().colorStyle = .hack
59-
LLDebugTool.shared().showDebugViewController(with: 0)
59+
LLDebugTool.shared().execute(.function)
6060
}
6161

6262
func testSimpleColorSytle() {
6363
LLConfig.shared().colorStyle = .simple
64-
LLDebugTool.shared().showDebugViewController(with: 0)
64+
LLDebugTool.shared().execute(.function)
6565
}
6666

6767
func testSystemColorStyle() {
6868
LLConfig.shared().colorStyle = .system
69-
LLDebugTool.shared().showDebugViewController(with: 0)
69+
LLDebugTool.shared().execute(.function)
7070
}
7171

7272
func testCustomColorConfig() {
73-
LLConfig.shared().configBackgroundColor(.orange, textColor: .white, statusBarStyle: .default)
74-
LLDebugTool.shared().showDebugViewController(with: 0)
73+
LLConfig.shared().configBackgroundColor(.orange, primaryColor: .white, statusBarStyle: .default)
74+
LLDebugTool.shared().execute(.function)
7575
}
7676

7777
}

LLDebugToolSwiftDemo/DemoViewControllers/TestCrashViewController.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ class TestCrashViewController: BaseTestViewController {
5858
footer.addSubview(tip2)
5959
footer.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 10 + imageViewHeight + tipHeight + 10 + imageViewHeight + tipHeight + 10)
6060

61-
self.tableView.tableHeaderView = header;
62-
self.tableView.tableFooterView = footer;
61+
self.tableView.tableHeaderView = header
62+
self.tableView.tableFooterView = footer
6363
}
6464

6565
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
@@ -71,14 +71,14 @@ class TestCrashViewController: BaseTestViewController {
7171
let cell = super.tableView(tableView, cellForRowAt: indexPath)
7272

7373
if (indexPath.row == 0) {
74-
cell.textLabel?.text = NSLocalizedString("try.array.crash", comment: "");
75-
cell.detailTextLabel?.text = NSLocalizedString("crash.info", comment: "");
74+
cell.textLabel?.text = NSLocalizedString("try.array.crash", comment: "")
75+
cell.detailTextLabel?.text = NSLocalizedString("crash.info", comment: "")
7676
} else if (indexPath.row == 1) {
77-
cell.textLabel?.text = NSLocalizedString("try.pointer.crash", comment: "");
78-
cell.detailTextLabel?.text = NSLocalizedString("crash.info", comment: "");
77+
cell.textLabel?.text = NSLocalizedString("try.pointer.crash", comment: "")
78+
cell.detailTextLabel?.text = NSLocalizedString("crash.info", comment: "")
7979
} else if (indexPath.row == 2) {
80-
cell.textLabel?.text = NSLocalizedString("try.signal", comment: "");
81-
cell.detailTextLabel?.text = NSLocalizedString("signal.info", comment: "");
80+
cell.textLabel?.text = NSLocalizedString("try.signal", comment: "")
81+
cell.detailTextLabel?.text = NSLocalizedString("signal.info", comment: "")
8282
}
8383

8484
return cell
@@ -117,7 +117,7 @@ class TestCrashViewController: BaseTestViewController {
117117
UserDefaults.standard.synchronize()
118118
kill(0, SIGTRAP)
119119
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1) {
120-
LLDebugTool.shared().showDebugViewController(with: 2)
120+
LLDebugTool.shared().execute(.crash)
121121
UserDefaults.standard.set(false, forKey: "openCrash")
122122
UserDefaults.standard.synchronize()
123123
}
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
//
2+
// TestHierarchyViewController.swift
3+
// LLDebugToolSwiftDemo
4+
//
5+
// Created by admin10000 on 2019/9/29.
6+
//
7+
8+
import UIKit
9+
10+
class TestHierarchyViewController: BaseTestViewController {
11+
12+
override func viewDidLoad() {
13+
super.viewDidLoad()
14+
15+
self.title = NSLocalizedString("hierarchy.info", comment: "")
16+
self.tableView.tableHeaderView = tableHeaderView
17+
18+
self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(testHierarchy))
19+
20+
testHierarchy()
21+
}
22+
23+
// MARK: - Table view data source
24+
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
25+
// #warning Incomplete implementation, return the number of rows
26+
return self.dataArray.count
27+
}
28+
29+
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
30+
let cell = super.tableView(tableView, cellForRowAt: indexPath)
31+
cell.textLabel?.text = self.dataArray[indexPath.row]
32+
var view = cell.viewWithTag(100)
33+
view?.removeFromSuperview()
34+
view = self.getCellView(indexPath.row)
35+
if let view = view {
36+
cell.contentView.addSubview(view)
37+
}
38+
return cell
39+
}
40+
41+
private func getCellView(_ index: Int) -> UIView? {
42+
var view : UIView?
43+
if (index == 0) {
44+
view = UIView()
45+
view?.backgroundColor = .groupTableViewBackground
46+
} else if (index == 1) {
47+
let label = UILabel()
48+
label.text = "Label"
49+
view = label
50+
} else if (index == 2) {
51+
let imageView = UIImageView()
52+
imageView.image = UIImage(named: "AppIcon")
53+
imageView.contentMode = .scaleAspectFit
54+
view = imageView
55+
} else if (index == 3) {
56+
let btn = UIButton(type: .system)
57+
btn.setTitle("Button", for: .normal)
58+
btn.addTarget(self, action: #selector(touchUpInside(_:)), for: .touchUpInside)
59+
view = btn
60+
} else if (index == 4) {
61+
let textField = UITextField()
62+
textField.placeholder = "Text Field"
63+
view = textField
64+
} else if (index == 5) {
65+
let control = UISegmentedControl(items: ["1", "2"])
66+
control.selectedSegmentIndex = 0
67+
view = control
68+
} else if (index == 6) {
69+
let slider = UISlider()
70+
view = slider
71+
} else if (index == 7) {
72+
let swit = UISwitch()
73+
view = swit
74+
} else if (index == 8) {
75+
let activity = UIActivityIndicatorView()
76+
activity.startAnimating()
77+
view = activity
78+
} else if (index == 9) {
79+
let progress = UIProgressView()
80+
view = progress
81+
} else if (index == 10) {
82+
let control = UIPageControl()
83+
control.numberOfPages = 3
84+
control.currentPage = 1
85+
view = control
86+
} else if (index == 11) {
87+
let stepper = UIStepper()
88+
view = stepper
89+
} else if (index == 12) {
90+
let scrollView = UIScrollView()
91+
view = scrollView
92+
} else if (index == 13) {
93+
let tableView = UITableView()
94+
view = tableView
95+
} else if (index == 14) {
96+
let cell = UITableViewCell()
97+
view = cell
98+
} else if (index == 15) {
99+
let collectionView = UICollectionView(frame: CGRect.zero, collectionViewLayout: UICollectionViewFlowLayout())
100+
view = collectionView
101+
} else if (index == 16) {
102+
let reusableView = UICollectionReusableView()
103+
view = reusableView
104+
} else if (index == 17) {
105+
let textView = UITextView()
106+
view = textView
107+
} else if (index == 18) {
108+
let picker = UIDatePicker()
109+
view = picker
110+
} else if (index == 19) {
111+
let picker = UIPickerView()
112+
view = picker
113+
} else if (index == 20) {
114+
let bar = UINavigationBar()
115+
view = bar
116+
} else if (index == 21) {
117+
let bar = UIToolbar()
118+
view = bar
119+
} else if (index == 22) {
120+
let bar = UITabBar()
121+
view = bar
122+
} else if (index == 23) {
123+
let bar = UISearchBar()
124+
view = bar
125+
}
126+
view?.frame = CGRect(x: 10 * 2 + UIScreen.main.bounds.size.width / 2.0, y: 5, width: UIScreen.main.bounds.size.width - 10 * 3 - UIScreen.main.bounds.size.width / 2.0, height: 44 - 5 * 2)
127+
view?.backgroundColor = .groupTableViewBackground
128+
view?.tag = 100
129+
return view
130+
}
131+
132+
private lazy var tableHeaderView : UIView = {
133+
let view = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 55))
134+
let btn = UIButton(type: .system)
135+
btn.frame = CGRect(x: 40, y: 10, width: view.frame.size.width - 40 * 2, height: view.frame.size.height - 10 * 2)
136+
btn.setTitle(NSLocalizedString("test.hierarchy", comment: "") , for: .normal)
137+
btn.addTarget(self, action: #selector(testHierarchy), for: .touchUpInside)
138+
btn.layer.borderWidth = 1
139+
btn.layer.borderColor = btn.tintColor.cgColor
140+
btn.layer.cornerRadius = 5
141+
btn.layer.masksToBounds = true
142+
view.addSubview(btn)
143+
return view
144+
}()
145+
146+
@objc private func testHierarchy() {
147+
148+
}
149+
150+
@objc private func touchUpInside(_ sender: UIButton) {
151+
152+
}
153+
154+
private lazy var dataArray : [String] = {
155+
return ["UIView", "UILabel", "UIImageView", "UIButton", "UITextField", "UISegmentedControl","UISlider", "UISwitch","UIActivityIndicatorView", "UIProgressView", "UIPageControl", "UIStepper", "UIScrollView", "UITableView", "UITableViewCell", "UICollectionView", "UICollectionReusableView", "UITextView", "UIDatePicker", "UIPickerView", "UINavigationBar", "UIToolbar", "UITabBar", "UISearchBar"]
156+
}()
157+
}

0 commit comments

Comments
 (0)