-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathStyleKit.swift
More file actions
30 lines (24 loc) · 899 Bytes
/
StyleKit.swift
File metadata and controls
30 lines (24 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import Foundation
public class StyleKit {
let stylist: Stylist
public init?(fileUrl: URL, styleParser: StyleParsable? = nil, moduleName: String? = nil, logLevel: SKLogLevel = .error) {
let log = SKLogger.defaultInstance()
log.setup(logLevel,
showLogIdentifier: false,
showFunctionName: true,
showThreadName: true,
showSKLogLevel: true,
showFileNames: true,
showLineNumbers: true,
showDate: false)
let fileLoader = FileLoader.init(fileUrl: fileUrl)
if let data = fileLoader.load() {
self.stylist = Stylist.init(data: data, styleParser: styleParser, moduleName: moduleName)
} else {
return nil
}
}
public func apply() {
self.stylist.apply()
}
}