This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
os_signpost(type: .begin, log: networkLog, name: "Parse Article from File", | |
signpostID: signpostID,"%{public}s", file.path) | |
let data = try file.read() | |
os_signpost(type: .end, log: networkLog, name: "Parse Article from File", | |
signpostID: signpostID,"%{public}s", file.path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.log | |
import os.signpost | |
let networkLog = OSLog(subsystem: "com.example.app.reader", category: "Articles") | |
let signpostID = OSSignpostID(log: networkLog) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func loadArticles() throws -> [Article] { | |
let decoder = JSONDecoder() | |
return try files.map { file in | |
let data = try file.read() | |
let article = try decoder.decode(Article.self, from: data) | |
return article | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let userLogin = "12345" | |
os_log("User login: %s", userLogin) | |
// In log | |
// User login: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let userLogin = "12345" | |
os_log("User login: %{public}s", userLogin) | |
// In log | |
// User login: 12345 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
os_log("Some message to log") | |
let errorMessage: StaticString = "404 - NOT FOUND" | |
os_log(errorMessage) | |
let responseCode = "404 - NOT FOUND" | |
os_log("HTTP response: %@", responseCode) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.log | |
let networkLog = OSLog(subsystem: "com.example.app.network", category: "Backend") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
echo "Module cache was deleted" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
echo "Derived data has been deleted" | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
echo "Xcode cache has been deleted" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol HTTPClientService { | |
/** | |
Sends a 'get' request to a specified URL | |
- Parameter url: String of URL | |
- Returns: Optional observable Data type | |
*/ | |
func get(url: String) -> Observable<Data?> | |
/** |
NewerOlder