feat: add traitCollectionDidChange to controllers

This commit is contained in:
Vasil Chimev
2019-09-25 15:37:52 +03:00
parent 327adb7234
commit 7da835dfd4
6 changed files with 72 additions and 4 deletions

View File

@@ -190,6 +190,18 @@ class UIPageViewControllerImpl extends UIPageViewController {
scrollView.frame = CGRectMake(0, scrollViewTop, this.view.bounds.size.width, scrollViewHeight); //this.view.bounds;
}
}
public traitCollectionDidChange(previousTraitCollection: UITraitCollection): void {
super.traitCollectionDidChange(previousTraitCollection);
const owner = this._owner.get();
owner.notify({ eventName: "traitCollectionChanged", object: owner });
console.log("---> UIPageViewControllerImpl.traitCollectionDidChange()");
if (this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection(previousTraitCollection)) {
owner.notify({ eventName: "traitCollectionColorAppearanceChanged", object: owner });
}
}
}
class UIPageViewControllerDataSourceImpl extends NSObject implements UIPageViewControllerDataSource {