iOS simulator gesture with mouse/ trackpad - ios

Is there is any way to add mouse and trackpad's gesture like scrolling in simulator screen.

Yes, but you would have to create a Mac app that got these events and then translated them to what the simulator was expecting
This project:
https://code.google.com/archive/p/accelerometer-simulator/
Tries to do something similar but with the accelerometer (since MacBooks have one).
This answer links to some tutorials that show you how to do what that project is doing: https://stackoverflow.com/a/16558215/3937

Related

Xcode SwiftUI how to scroll the Preview Canvas?

I have started working with SwiftUI Demo.
But I am not able to scroll the Preview canvas in Xcode.
Yes there is button for zooming like - 100 + .
I have seen a video where person is scrolling this canvas during the tutorial
is there any option in Xcode to enable scrolling in preview canvas ?
Seems to be a trackpad vs mouse wheel issue. Try scrolling with the trackpad, it should work until Apple gets this bug patched. Haven't tried with a bluetooth trackpad, might be worth looking into.
On my MacBook Pro (Big Sur, 11.2.3), I place two fingers on the trackpad and move them up and down to scroll between previews in the canvas of Xcode 12.5 beta 3.
Hope that helps. I'm new to Mac to perhaps this was just obvious to everyone else.

keyboard displays in simulator on one machine, and not on another

So I just switched the keyboard type for the three textViews I have on one of my viewControllers to use the Number Pad keyboard. I also added a library (not a cocoapod) for a custom ScrollView object that I added to the view; the Scrollview makes all subviews scroll up/down to respond to instances of the keyboard being displayed onscreen.
It displays fine when I run the code on my machine's simulators (simulators for iPhones 5s and 6.) But when the other guy on the project tries it, the keyboard shows up briefly on the 5s simulator before hiding. On his simulator for the 6, the keyboard doesn't appear at all.
Could it be the custom Scrollview screwing with the UI? I'll post a link to the repo..I'd post some code but aside from this object, I can't think of anything else that could be responsible.
https://github.com/michaeltyson/TPKeyboardAvoiding
If you tap into a textfield and the keyboard does not appear, hit command+k on your physical keyboard to bring up the simulator one. You will still be able to type with your physical keyboard but the simulator one will come up as well.
Try command+shift+k. That turns on and off the simulated hardware keyboard. I have had it fix this kind of issue before, even when I didn't realize I had it turned on.

Testing gestures on openGL ES using the iPhone simulator

I have an openGL ES app i'm working on, and i added some gestures:
Pan - 1 & 2 fingers, for moving the object
Pinch - Zoom in and out on the object
Rotation - Just to rotate the object
I can't test these gestures on an iPhone since mine is currently out of use, and i wanted to know is there any way to test these gestures using Xcode's iPhone simulator and the Mac's touch pad?
Currently i could only test the pan gesture since i can click on the Mac touch pad and drag my finger around, so pan does work, but only for 1 finger.
How can i test all the other gestures? is there a way to define that on the iPhone simulator?
Hold down the Option key.
Developer Doc
As Peter says, hold down the option key (alt key on a Windows keyboard) while hovering the mouse over the simulator's screen. That causes 2 points to show on the screen. It's not perfect, but it's better than nothing.
Apple has had multi-touch trackpads and mice for Mac for what, 3 years now, but they still have not added multi-touch support to the simulator. If this was an end-user feature it would have been added years ago. Us developers are not a priority for Apple it seems. :(
You can hold down alt key while pressing left mouse button.

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

Simulating Pinch on Ipad ( ios simulator 4.3 )

I am testing multi touch support on Safari mobile. So far, i realized i can simulate a pinch gesture on iphone simulator (just holding option key), however i cannot do the same when i change the device to be the ipad.
Any idea: is that a bug, any settings or it changes the simulation process depending on the device.
I have the same problem with the simulator of Xcode 4.3.2: Multi-touch-gestures with the ALT-key work in iPhone-mode, but not in iPad-mode. It cannot be a mistake in my source code, because this is even the case when going to the home-screen in the simulator by pressing Cmd+Shift+H.
I found the following work-around: Use Cmd+2 or Cmd+3 to reduce size of the iPad-window, then multi-touch-gestures with ALT-key will also work in the iPad-simulator. By pressing Cmd+1 you can return to the original size of the iPad-simulator.

Resources