-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectFilesManager.swift
More file actions
executable file
·36 lines (31 loc) · 1.12 KB
/
ProjectFilesManager.swift
File metadata and controls
executable file
·36 lines (31 loc) · 1.12 KB
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
31
32
33
34
35
36
//
// ProjectFilesManager.swift
// backendtest
//
// Created by Asif Mayilli on 3/29/19.
// Copyright © 2019 Test. All rights reserved.
//
import Foundation
import SwiftyJSON
class ProjectFilesManager{
var projectFile:String = "myproj"
var projectFileJson:JSON?
func openJson(){
if let jsonPath = Bundle.main.path(forResource: projectFile, ofType: "json") {
print(jsonPath)
do {
let data = try Data(contentsOf: URL(fileURLWithPath: jsonPath), options: .mappedIfSafe)
self.projectFileJson = try JSON(data:data)
print("hey")
// let jsonResult = try JSONSerialization.jsonObject(with: data, options: .mutableLeaves)
// if let jsonResult = jsonResult as? Dictionary<String, AnyObject> {
// self.projectFileJson = jsonResult
// // print(self.projectFileJson["PT-127.99.88"])
// //print(self.projectFileJson["PT-118.122.125"])
// }
} catch {
// print("heuhdnsx")
}
}
}
}