UIVideoEditorControllerの右側のボタンが「保存」となっていたので変更したくて調査。
ラッパークラスを作成して、表示前に強引にボタンのタイトルを変更することで実装できたのでメモ。
UINavigationButton
っていうクラスだったが、
調べるとUIButton
を継承しているので、キャストしてタイトル変更。
ただ、もしかすると審査が通らないかもしれないので、審査通らなかったら諦めよう。
///
/// CstmVideoEditorController
///
class CstmVideoEditorController: UIVideoEditorController {
///
/// will appear
///
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
for v in self.navigationBar.subviews {
if v is UIButton {
///
/// 右側のボタンか判定
///
if v.frame.origin.x > self.view.w * 0.5 {
(v as! UIButton).setTitle("Done", for: UIControlState.normal)
(v as! UIButton).setTitle("Done", for: UIControlState.disabled)
(v as! UIButton).setTitle("Done", for: UIControlState.selected)
(v as! UIButton).setTitle("Done", for: UIControlState.highlighted)
}
}
}
}
}
もっといい方法あればコメント頂きたく。。。
m( _ _ )m