Skip to content
stv-ekushida edited this page Jun 26, 2018 · 1 revision

extension Dictionary {

/// 出力用のJson文字列
var prettyPrintedJsonString: String {
    do {
        let jsonData = try JSONSerialization.data(withJSONObject: self, options: [.prettyPrinted])
        return String(bytes: jsonData, encoding: .utf8) ?? "変換失敗"
    } catch {
        return "変換失敗"
    }
}

}

extension UIControl { open override var isExclusiveTouch: Bool { get { return true } set { // overrideのため定義だけしているが、何もしない } } }

Clone this wiki locally