1. Determine if the current controller is displayed:
// determines whether the current controller is displayed Func iscurrentviewcontrollervisible (), Bool { return (self.isviewloaded) && (( Self.view.window = nil) }
2. Solve the white screen problem:
In fact, white screen problem is the controller's jump problem.
ifLet Tempnav = window?. Rootviewcontroller as?basenavigationcontroller{ forVcinchtempNav.childViewControllers.reversed () {if(VC = = TempNav.childViewControllers.last && vc.iskind (of:HomeViewController.self)) | |(VC= = TempNav.childViewControllers.last &&Vc.iskind (of:SumPayViewController.self)) { Break } Else ifVc.iskind (of:WaiterHomeViewController.self) {ifHHTSwitchGlobalData.shared.isBusinessModel {UIApplication.shared.pop2Business () }Else{UIApplication.shared.gotoRootViewController ()}} } }
3. Data transfer model:
Note the type of the data model, otherwise it cannot be converted correctly.
4.NSNumber and NSString Conversion accuracy issues:
Https://www.aliyun.com/jiaocheng/400490.html
" %.2f " , Model.money.doubleValue) = ["code": Model.code,"ID": Model.id," Money" as [String:any]
5.Xib Set Uistackview, note that the child controls are set to an equal width, otherwise the layout is out of control.
Swift Code Summary 8