Skip to content

Commit

Permalink
Merge from 'swift 2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pluto-Y committed Sep 29, 2017
1 parent 770a8b9 commit e0fd21d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion SwiftyEcharts.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SwiftyEcharts"
s.version = "0.0.1"
s.version = "0.0.2"
s.summary = "A custom component for the ecomfe's echarts 3."
s.homepage = "https://github.com/Pluto-Y/SwiftyEcharts"
s.license = { :type => "MIT", :file => 'LICENSE' }
Expand Down
11 changes: 6 additions & 5 deletions SwiftyEcharts/Views/EchartsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,16 @@ open class EchartsView: WKWebView, WKNavigationDelegate, WKUIDelegate, WKScriptM
bundle = frameworkBundle
}

let urlPath = bundle.path(forResource: "echarts", ofType: "html")
guard let path = urlPath else {
if let urlPath = bundle.path(forResource: "echarts", ofType: "html") {
bundlePath = urlPath
} else if let urlPath = bundle.path(forResource: "echarts", ofType: "html", inDirectory: "SwiftyEcharts.bundle") {
bundlePath = urlPath
} else {
printError("ERROR: Can not find the echarts.html, please contact the developer")
return
}

bundlePath = path

guard let htmlStr = try? String(contentsOfFile: path) else {
guard let htmlStr = try? String(contentsOfFile: bundlePath) else {
return
}
printInfo("Info: the content of the echcart.html: \(htmlStr)")
Expand Down

0 comments on commit e0fd21d

Please sign in to comment.