2
I have a problem/doubts. Until today due to some needs I developed only for iPhone or iPad separately, but today I’m starting in the development of universal application, iPhone and iPad.
I’m using Xcode 6 and developing directly for iOS 8. I was able to adapt the screens for both devices, it was cool except for the fact that: when I built the screens using the storyboard, added a UITabBar
and I referenced it as Outlet
on my controller. When I adapted to the iPad screen, I had to add another UITabBar
(I actually had to add all the components because it was empty). When trying to reference how Outlet
in class, I could not, because she "overwrites", losing my outlet of iPhone screen and vice versa.
My doubts are as follows:
- What’s the best way to do that?
- Every time I create a screen for iPhone and adapt the screen for iPad, I have to add all components again?
- In case of overwriting, what is the correct alternative to do this?
- Will I need to have two controllers? One for iPad and one for iPhone?
IMPORTANT: To know how I create the layout and codes: I have not written any code, I am still in the stage of creating the screens and create the layout in the same way as in this video: https://www.youtube.com/watch?v=p5wD8dvSDbM
If you designed your layout for iPhone and iPad, it’s really not possible to refer to it
IBOutlet
, unless you draw the same layout with Any|Any and using the constraints correctly. TheUITabBar
for example, it’s one of the things I can’t imagine because you couldn’t do it universally without needing 2IBOutlet
.– Paulo Rodrigues
@Paulorodrigues the problem really was in Any|Any. After seeing your comment I noticed that the problem was where I inserted the components on the iPhone screen and not on the Any|Any screen, thus not being able to duplicate to the iPad. Could you please put as an answer?
– Gian