[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f4J5XamdtMuUjAt5TtnxSJ8qEQGVfZouuKR0KP_Xzzcg":3},{"code":4,"message":5,"data":6},200,"成功",{"id":7,"createdAt":8,"title":9,"content":10,"summary":11,"image":12,"uid":13,"user":14,"categoryId":21,"category":22,"subCategoryId":24,"subCategory":25,"comments":27,"status":17,"reason":12,"notice":12,"visitCount":28,"commentCount":29,"keywords":30},72,"2024-02-02T11:04:31.568Z","iOS中当适配iPad的时候使用UIAlertController注意的点","\n使用`UIAlertController`时，要设置其`popoverPresentationController.sourceView`和`popoverPresentationController.sourceRec`这2个属性t，否则会导致适配iOS和iPad的app发生crash。\n\n例如：\n```\nlet alertController = UIAlertController(title: \"My first app\", message: \"Hello World\", preferredStyle: .ActionSheet)\n        //ipad使用，不加ipad上会崩溃\n        if let popoverController = alertController.popoverPresentationController {\n            popoverController.sourceView = sender\n            popoverController.sourceRect = sender.bounds\n        }\n```\n\nsourceView可以是UIButton、self.view等，也可以是barButtonItem;\n\n例如：\n```\nif let popoverController = alertController.popoverPresentationController {\n    popoverController.barButtonItem = sender\n}\nself.presentViewController(alertController, animated: true, completion: nil)\n```","开发的iOS应用，有时候要同时适配iPad版本，当在使用UIAlertController时，需要注意一个点，否则会导致crash。","",499668042977349,{"phone":15,"userId":13,"nickName":16,"vipType":17,"avatar":18,"sign":19,"createdAt":20},"13121171998","全栈老韩",1,"https://image.xinwei.ltd/images/IMG_5430.JPG","全栈工程师，擅长iOS App开发、前端（vue、react、nuxt、小程序&Taro）开发、Flutter、React Native、后端（midwayjs、golang、express、koa）开发、docker容器、seo优化等。","2024-01-01T16:14:30.305Z",2,{"id":21,"name":23},"IT技术",3,{"id":24,"name":26,"parentId":21},"iOS",[],46,0,"ios,ios app,ios ipad,ios开发"]