简体   繁体   English

iPhone和iPad项目分开

[英]iPhone and iPad projects separated

I''ve been developing an iPhone app in swift 4 and I'm about to start a new version for iPad too 我一直在开发Swift 4的iPhone应用程序,我也将为iPad启动新版本

My client has specially requested that the app's GUI is built in code and not using storyboard, so I was wondering what's the best approach in this case. 我的客户特别要求该应用程序的GUI用代码构建而不使用情节提要,因此我想知道在这种情况下最好的方法是什么。 Adaptive layout works well when working with storyboard, also gui designs are way too different for both versions, it's not just a matter of resizing 自适应布局与情节提要一起使用时效果很好,而且两个版本的GUI设计也有很大不同,这不仅仅是调整大小的问题

Please any suggestions ? 请任何建议?

Get UIScreen.current.traitCollection.userInterfaceIdiom . 获取UIScreen.current.traitCollection.userInterfaceIdiom It will be .phone or .pad . 这将是.phone.pad Use if to proceed accordingly with the construction of the interface. 使用if地进行接口的构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM