[iOS]UIDocumentPickerViewController支援docx, pptx, xlsx格式

依據Apple Document說明,Microsoft文件的UTI如下
doc com.microsoft.word.doc
ppt com.microsoft.powerpoint.ppt
xls com.microsoft.excel.xls

但沒有提到docx, pptx, xlsx格式,後來翻到一篇實用的文章有列出此三款UTI如下
docx org.openxmlformats.wordprocessingml.document
pptx org.openxmlformats.presentationml.presentation
xlsx   org.openxmlformats.spreadsheetml.sheet

經實際測試,不需要設置info.plist,直接使用UTI即可
sample code如下:
NSArray *documentTypes = @[@"com.microsoft.word.doc", @"org.openxmlformats.wordprocessingml.document", @"com.microsoft.excel.xls", @"org.openxmlformats.spreadsheetml.sheet", @"com.microsoft.powerpoint.ppt", @"org.openxmlformats.presentationml.presentation"];
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:documentTypes inMode:UIDocumentPickerModeOpen];
documentPicker.delegate = self;
documentPicker.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:documentPicker animated:YES completion:nil];

[iOS]stringByAddingPercentEscapesUsingEncoding vs stringByAddingPercentEncodingWithAllowedCharacters

'stringByAddingPercentEscapesUsingEncoding:' is deprecated: first deprecated in iOS 9.0 - Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid.

如上述文字,不要再用過期的stringByAddingPercentEscapesUsingEncoding,請愛用stringByAddingPercentEncodingWithAllowedCharacters

但stringByAddingPercentEncodingWithAllowedCharacters還要指定你要用哪一款Character Sets,像我的網址如下
http://myhost/User/karen_chang@quantatw.com.png?ModifyDate=2018-06-14T15:30:33.819000
我不希望query string後面的string被解譯錯誤,那就要選用URLQueryAllowedCharacterSet

其他五款的選用時機,請參考Apple Document
不要看網路上都用URLHostAllowedCharacterSet就亂抄,請實際依你的網址選用適合的