日々精進

新しく学んだことを書き留めていきます

iOSのバージョンを判定して実装を切り替える方法

appleのサンプルコードを見ていたら下記コードがあった。
こういうマクロあったんだなぁ。

#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Ensure that the view controller supports rotation and that the split view can therefore show in
    // both portrait and landscape.
    //
    return YES;
}
#endif

参考:PageControl