ObjecTips

Swift & Objective-C で iOS とか macOS とか

iOS 11 Foundation の変更点

Foundation | Apple Developer Documentation

Foundation 周りざっくり、網羅はしていない。

iOS 11 関連記事
iOS 11 UIKit の変更点 - ObjecTips
iOS 11 Messages Framework の変更点 - ObjecTips
iOS 11 PDFKit - ObjecTips
iOS 11 Core Image の変更点 - ObjecTips
Vision framework でテキスト検出 TextDetection - ObjecTips
Vision Framework で水平角検出(傾き) Horizon Detection - ObjecTips

NSLinguisticTagger

言語、品詞の判定周りのメソッドが色々と増えたっぽい。
Core MLのドキュメントによると NSLinguisticTagger クラスには Machine Learning が生かされているらしい。

NSFileManager
- (BOOL)trashItemAtURL:(NSURL *)url resultingItemURL:(NSURL * _Nullable * _Nullable)outResultingURL error:(NSError **)error API_AVAILABLE(macos(10.8), ios(11.0)) API_UNAVAILABLE(watchos, tvos);

macOS では昔からあったメソッド。iOS にもシステム共通のゴミ箱が登場?

    NSTrashDirectory API_AVAILABLE(macos(10.8), ios(11.0)) API_UNAVAILABLE(watchos, tvos) = 102             // location of Trash directory

証拠発見か?
NSSearchPathDirectoryNSTrashDirectory がiOSでも利用可能に

NSJSONSerialization
    NSJSONWritingSortedKeys API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0)) = (1UL << 1)

JSONの保存オプションでキーのソートが可能に

NSProcessInfo
typedef NS_ENUM(NSInteger, NSProcessInfoThermalState) {
    NSProcessInfoThermalStateNominal,
    NSProcessInfoThermalStateFair,
    NSProcessInfoThermalStateSerious,
    NSProcessInfoThermalStateCritical
} API_AVAILABLE(macosx(10.10.3), ios(11.0), watchos(4.0), tvos(11.0));

デバイスのパワー使い過ぎによる熱状態を取得出来る。

FOUNDATION_EXTERN NSNotificationName const NSProcessInfoThermalStateDidChangeNotification API_AVAILABLE(macosx(10.10.3), ios(11.0), watchos(4.0), tvos(11.0));

変更通知も受け取れる。

まとめ

他にも変更のあるクラスはいくつかあったけど、個人的におおっと思う大きな変化は無かったかも。
テキストからの言語判定はこれまでいまいち精度が出なかったので Machine Learning が生かされてる NSLinguisticTagger の言語判定は是非とも試してみたい。