where is the xcode preview simulator inheriting from? - ios

I used to have all my preview simulator device as iphone12 and I was fine with it. Not sure when, it all changed to I don't know iPhoneSE or iTouch with the thick bar. I did not want to change it back to iPhone12 by using the code .previewdevice() cuz I literally have like dozens of previews waiting for me to change, so I checked what decide the choice of the device. It shows as the screenshot below "inherited". There must be a source where I can the change the setting right? At least somewhere in the setting or I understand this "inherited" the wrong way? Can someone help give some more information about this? Can't believe xCode made this so inflexible...screenshot from my Xcode project,the mysterious inherited

Click on the run destination, which is something like iPhone SE. Just change it to the desired device type and the inherited device for previews will change accordingly.
If you want a special device type, as you said, just click on the top bar of the preview device and open the Inspect Selected Object menu (at the bottom of the Canvas), select the desired Preview Device. It will add the code .previewDevice("iPad (9th generation)") in the code preview section.

Related

Screen content is only shown in a part of screen in iOS Simulator

My iOS Simulator only show the content as a part of the screen. How can I fix it? I'm using XCode 6.3.1. Thanks
You just need to restart it. It can happen sometimes.
Force close simulator and start it again!
I am including this response for those, who like me, are seeking an solution for this problem after upgrading to Xcode 8.
The simulator began using only a portion of the display, as described in the question, when testing against iOS 8.x. The symptoms were that 1/4 of the display was showing if the window scale was set to 50%, 1/9 would show if the scale was set to 33%, etc. The entire display would show only if the scale was set to 100%, which is a real pain when using an iPad simulator.
The solution for me was to turn off "Optimize Rendering for Window Scale" under the "Debug" menu, which first seems to have appeared in Xcode 8. The 8.x simulators displayed properly after that.
Looking at the image..
I think it has something to do with the resolution/scale of the simulator.. I dont use Xcode 6.3.1 though...
since it's 5s the screen resolution/scale is x2.. so instead of 320x568 it must be 640x1136..
why dont you use the device frame rect to fill the screen? something like self.view.frame ?
its hard to guess what causing your problem,show us something that may help.. :)
Visit for more details:
iPhone Simulator Quarter or Top Left part of the screen[Fixed]
Watch the video from this link: iPhone Simulator - Quarter of the screen [Fix]
Step 1: “Force Quit” the iOS Simulator
Step 2: Open “Spotlight Search” and type “Chameleon Wizard” (if you installed Chameleon Bootloader)
Step 3: In that popup window, click on “org.chameleon.Boot”
Step 4: Uncheck display_0, Graphics Mode(Clear that Dropbox also), cpus=1, npci=0x3000, dart=0. Below shows an image with checked items those mentioned here. Just uncheck it all.
Step 5: Restart your Mac and try.

iOS Simulator appears half of desired size

Not sure what happened, but I recently updated Xcode 6, and now the iOS Simulator contents does not fill the whole screen. And yes, I checked window -> scale options.
Click iOS Simulator in the menu bar, then select Reset Content and Settings. I often find that when I update Xcode this is a good idea as problems like yours arise.

Can I customize where the iOS Simulator saves its screenshots to? (Instead of the Desktop)

I'm continually frustrated by the simulator saving all my screenshots (from command+s in the simulator) to my Desktop, just flooding it after a few weeks. Can I have it save them somewhere else?
I know I could just use Grab.app or cmd+shift+4, but it the simulator crops out the top bar, shadows, etc. which is nice, so I'd like to keep it.
Xcode 8.x & earlier:
No. It is always saved on the desktop. There is no option to change that.
Xcode 9.x:
Select File, Save Screenshot while holding down the Option key. We will prompt you for the location to save the screenshot. Check the box to make this location the default for all screenshots going forward.

Converted Universal App doesn't show the iPad Interface

At the moment I'm building an iPhone App.
Yesterday I tried to convert it to an Universal App.
It worked, but it just shows me the tab bar, but nothing else.
I've created some Web Views and a Table View, but the iPad Simulator didn't show anything, only the tab bar.
The iPhone Simulator works great, I can see all the labels, web views etc...
I've created one Storyboard for iPhone and one for iPad.
I don't know why the iPad Simulator doesn't display anything.
Hope you can help me.
Regards
Check that you have changed the storyboard name in you target general settings, as shown in the picture below.
Use the right name for you app. Check also that the info.plist file for your project has been correctly updated:
(the second entry is for the iPad).
If that is ok, try and make a clean and rebuild.

iOS XCode Storyboard controls moved and now look strange in simulator

I am following the course on iOS through iTunes university and working on the calculator project. I moved the controls on the storyboard to make room for another control at the top. Everything looks fine on the storyboard but when run in the simulator, controls are bunch up, on top of each other, and some are clearly off the top of the simulator screen. This leads to the following very related questions.
How does one move controls around on the storyboard? I went to the size inspector of each control (buttons in my case) and changed the 'Y' value (increased it by 10). I did this for each control. I didn't think about it as I was doing it because as I said, all looks fine on the storyboard. Is there a better way to move controls around? I could not figure out how to grab more than one control at a time and move them. Grabbing all and moving or all but one and moving would have been ideal.
I anticipate someone is going to say, "We need more info. " How do I show the storyboard? Is there a xml file somewhere? How is the storyboard saved? How should I show the results of the simulator?
In general, what the heck is going on? Why would things look so different in the simulator?
Is there a better forum/group to ask newbie questions about iOS programming?
My specs are these:
XCode 4.5.2
Ios simulator versions set to 6.0 and iPhone
Any other info needed? Thanks in advance,
Dave
Try setting your simulated device size to 'freeform' instead of 'inferred'. This screen is a bit smaller so the controls are no longer overlapping. The latest xcode sets it by default to ios6 (screen size of iPhone 5)
edit For a better insight in xcode IDE, please refer to the documentation provided by apple (includes screenshots for clarity)
https://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/000-About_Xcode/about.html#//apple_ref/doc/uid/TP40010215

Resources