Preview Interface Builder Layout on iPad and iPhone - xcode

Using Xcode 5, I've created a new xib that I want to use for both the iPad and iPhone versions of my app. Is there a way I can use the Assistant to preview the layout for both devices?
I created the xib file using New File > User Interface > View but it forces me to choose either iPad or iPhone. I don't see the option for "Universal"

Related

Missing WatchOS Xcode Glance Interface View

I am using Xcode 8.2.1. I have an existing project. I choose File -> New -> Target -> Watch OS -> WatchKit App
There are no options to add glances to the project. Nor are glances available in the side menu with various controllers and views.
Have glances been deprecated? If not, how can I get them available to a project. They also do not show up for new projects.
Yes, Glances have been removed in watchOS 3 (https://www.macworld.com/article/3083906/wearables/watchos-3-faq-glances-are-going-away-as-watch-apps-speed-up-and-move-to-a-dock.html)
Instead, apps are now expected to behave nicely in the Dock, which is a replacement of the Glances view. I suggest you watch the WWDC videos ('16 and '17) about what's new in the Apple Watch SDK.

Xcode 8.1 missing Object Library

I have an android background, but am just learning how to build iPhone apps using swift. I am using the book Beginning iPhone Development with Swift 2: Exploring the iOS SDK.
Problem is that it refers to Buttons and such being in the Object Library and I don't have anything in my object library. I have clicked on the View as instructed.
I have a newly installed MacBook and am running Xcode 8.1, which is newer than the book's directions. It refers to iOS UIkit, but I don't know how to install this.
I did Single View Application under iPhone to get where I am. Can anyone point me to what I need to do? I am brand new to the Apple world entirely.
Aha! In the main window, I clicked on the storyboard and that allowed the Object Library to contain the view items, including buttons.
So, click on the storyboard in the main window, then click on the view in the IB.

supporting view on different IOS devices.

My app is supposed to run only on Iphone but apple is testing it on Ipad too. Apparently, the apps can run in Iphone mode on Ipads. How do I know which Ipad will run which Iphone mode (ex: ipad mini air2 = iphone 5 view settings in iphone mode?)?
How can I change the size of my UI based on changing aspect ratio programmatically ? (My views are created through code).
The iPad Pro runs an iPhone 6. The iPad 2 and Air 2 run an iPhone 4s.
I don't know if there's official documentation for this, but what I did is create a sample app and set the Devices to iPhone only. Then I added
print(self.view.frame.size) //Swift
NSLog(#"width = %f, height = %f", self.view.frame.size.width,
self.view.frame.size.height); //Obj-C
in the default ViewController. This will print the screen size of the view only, and not the entire iPad's screen. I then compared the printed value to the printed value of the same app run in iPhone 6/4s. You can try it too.
In terms of changing the size of your UI to fit different screen sizes, your best bet is probably AutoLayout. There are many (free, open source) frameworks available that make creating AutoLayout constraints programatically much simpler.
A few are Stevia, Cartography, SnapKit (Swift) / Masonry (Obj-C), or PureLayout.
As you said your app is supposed to run on iPhone only, then do the following process.
Select your project target in Xcode and goto General in which there is one section Deployment Info
Change the Devices to iPhone from dropdown
this will open app on iPhone only.

Xcode Simulator For iPad app displays zoomed in like and iPhone app

I created a brand new Xcode project using the master detail template. Just running the project off the bat my Xcode simulator runs all iPad devices in the below format.
It looks like an iPhone app is being ran on an iPad. In the bottom right corner there is a 1x button. When clicked it turns into a 2x button.
I've reset all device and settings in the simulator and changed the project to run on on other iPad devices but still having the issue. Again this is an out of the box project with no adjustments made. Ive attached a screenshot of what it looks like.
Did you check this setting in the "general" tab in your project build settings is set to iPad instead of iPhone?

How do I add the iPad view option to Xcode preview?

In my main Swift iOS app I see in Xcode the preview pane and it lets me add various iPhone and iPad devices successfully and view the selected UI View Controller in my app storyboard.
In my Today extension preview I can only add iPhone devices, not the iPad.
Any ideas?
Works fine for the main app:
Devices appear fine in simulator:
Universal app:
How to preview Storyboard in Xcode using Non-Base localisation ----> check it and enable UseAutolayout Opention , and size Classes

Resources