swift - Which one is best in "self.view.window?.addSubview()" or "UIApplication.shared.keyWindow?.addSubview()" in iOS -
i need display loaderview in top of viewcontroller
let loaderview: uiview() self.view.window?.addsubview(loaderview)
other type:
let loaderview: uiview() uiapplication.shared.keywindow?.addsubview(loaderview)
both line working fine, code best adding subview... in advance....
well if adding view (not loader view) in view controller on appdelegate window it's better go with
uiapplication.shared.keywindow?.addsubview(loaderview)
otherwise
self.view.window?.addsubview(loaderview)
is fine.
Comments
Post a Comment