- Feb 27 Mon 2017 13:19
[iOS 10] [watchOS 3] 手錶手電筒App送審中
- Feb 20 Mon 2017 09:29
SourceTree commit的註解視窗不見
defaults delete com.torusknot.SourceTreeNotMAS "NSSplitView Subview Frames repowindow_LogViewDescSplitter"
- Feb 13 Mon 2017 02:18
[UWP] ValueTypes可能性測試
結論:
- Feb 12 Sun 2017 19:06
[Swift] 只在Debug Mode 輸出 Print
func print(_ items: Any...) 為主要的Function,需放置全域的位置 (外層不能有東西)
func print(_ items: Any...) { #if DEBUG for item in items { print(item, separator: " ", terminator: "\n") } #endif } public struct Utilities { public static func openSafari(_ urlString: String) { guard let urlEncoded = urlString.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed) else { print("無法URL Encode, \(#function): urlString") return } guard let url = URL(string: urlEncoded) else { print("無法轉換成URL, \(#function): urlString") return } UIApplication.shared.open(url) } }
接下來就能在其它地方照常使用print輸出,而Release Mode,print內的#if DEBUG包住的地方將不會被編譯而變成Empty Function,這時Swift Compiler將會把function call整個拿掉,似乎是完美的作法。
- Feb 11 Sat 2017 17:44
[UWP] 在App進入背景或進入前景時,觸發OnNavigatedTo, OnNavigatedFrom
[UWP] 在進入背景或進入前景時,觸發OnNavigatedTo, OnNavigatedFrom。
每個Page都會有自己的進入頁面跟離開頁面的邏輯,有時會希望App進入背景 or 進入前景時也能夠呼叫到目前頁面的 OnNavigatedTo, OnNavigatedFrom,但預設是不會被呼叫的,