File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
AAInfographicsDemo/Demo/AAChartModel/ViewController
AAInfographics/AAChartCreator Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,10 @@ public class AAChartView: WKWebView {
176176
177177 private var optionsJson : String ?
178178
179+ #if DEBUG
180+ public var shouldPrintOptionsJSON : Bool = true
181+ #endif
182+
179183 // MARK: - Initialization
180184 override private init ( frame: CGRect , configuration: WKWebViewConfiguration ) {
181185 super. init ( frame: frame, configuration: configuration)
@@ -295,16 +299,18 @@ public class AAChartView: WKWebView {
295299 }
296300
297301 #if DEBUG
298- let modelJsonDic = aaOptions. toDic ( )
299- let data = try ? JSONSerialization . data ( withJSONObject: modelJsonDic, options: . prettyPrinted)
300- if data != nil {
301- let prettyPrintedModelJson = String ( data: data!, encoding: String . Encoding. utf8)
302- print ( """
302+ if shouldPrintOptionsJSON {
303+ let modelJsonDic = aaOptions. toDic ( )
304+ let data = try ? JSONSerialization . data ( withJSONObject: modelJsonDic, options: . prettyPrinted)
305+ if data != nil {
306+ let prettyPrintedModelJson = String ( data: data!, encoding: String . Encoding. utf8)
307+ print ( """
303308
304309 -----------🖨🖨🖨 console log AAOptions JSON information of AAChartView 🖨🖨🖨-----------:
305310 \( prettyPrintedModelJson!)
306311
307312 """ )
313+ }
308314 }
309315 #endif
310316
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ class BasicChartVC: UIViewController {
5050 chartView. isScrollEnabled = false //Disable chart content scrolling
5151 chartView. isClearBackgroundColor = true
5252 chartView. delegate = self as AAChartViewDelegate
53+ #if DEBUG
54+ chartView. shouldPrintOptionsJSON = false
55+ #endif
5356 view. addSubview ( chartView)
5457 // Chart view constraints
5558 NSLayoutConstraint . activate ( [
You can’t perform that action at this time.
0 commit comments