{"id":10441,"date":"2015-01-12T16:22:06","date_gmt":"2015-01-12T21:22:06","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=10441"},"modified":"2015-01-14T10:36:49","modified_gmt":"2015-01-14T15:36:49","slug":"swiftfilepath","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/01\/12\/swiftfilepath\/","title":{"rendered":"SwiftFilePath"},"content":{"rendered":"<p>Norihiro Sakamoto&rsquo;s <a href=\"https:\/\/github.com\/nori0620\/SwiftFilePath\">SwiftFilePath<\/a> provides <code>Path<\/code> objects with methods for functionality from <code>NSFileManager<\/code> (via <a href=\"https:\/\/twitter.com\/swifttoolbox\/status\/554276166732095488\">Swift Toolbox<\/a>). I&rsquo;ve long used a similar pattern, creating Objective-C categories on <code>NSString<\/code> and then <code>NSURL<\/code>. The idea potentially works even better in Swift, although Sakamoto&rsquo;s code regrettably converts all the <code>NSError<\/code> objects to strings.<\/p>","protected":false},"excerpt":{"rendered":"<p>Norihiro Sakamoto&rsquo;s SwiftFilePath provides Path objects with methods for functionality from NSFileManager (via Swift Toolbox). I&rsquo;ve long used a similar pattern, creating Objective-C categories on NSString and then NSURL. The idea potentially works even better in Swift, although Sakamoto&rsquo;s code regrettably converts all the NSError objects to strings.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[69,31,30,857,74,71,901],"class_list":["post-10441","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-ios","tag-mac","tag-nserror","tag-opensource","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=10441"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10441\/revisions"}],"predecessor-version":[{"id":10484,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10441\/revisions\/10484"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=10441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=10441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=10441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}