3
2

More than 3 years have passed since last update.

iOS 14 対応

Last updated at Posted at 2020-09-25

とあるアプリをiOS14に対応した際に起こった問題を書いていきたいと思います。

DatePickerが配置された画面に遷移するとアプリがクラッシュする...

原因

DatePickerの罫線を表示させたくないため、subviewsを巡り非表示にしているコードがあり、
UIDatePickerのStyleにautomaticが設定されている。

対処

Styleにautomaticが設定されている時の外観が変更されており、wheelsを設定するとクラッシュしなくなった。
根本的には、subviewsを巡り非表示にしているコードを対処する必要がある。いつか...

PickerViewでselection indicatorが表示される

原因

iOS14ではPickerViewの選択した行がハイライトされるようである。

対処

デザイン上、やはり表示させたくないとの事で次のコードを追加して対応した。

- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    if (@available(iOS 14.0, *)) {
        self.picker.subviews[1].hidden = YES;
   }
}
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2