how do I check if the device is iPad 3? [duplicate] - xcode

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Detecting iPad 3 vs iPad 2 device?
Programmatically detect an iPad 3 (HD)?
I am making an iPad app and want to know if the app is running in an iPad 2 or 3 so accordingly I can perform some action.
What would be the best way to find this?
I am currently using
NSString *platform = [[UIDevice currentDevice] platformString];
But it returns "Unknown iPad" when I run on iPad 3.

It's generally best to check for the device features you're interested in rather than looking for a specific model of device. Apple recommends this, and for good reason: if you design for features of the new iPad, your customers won't be happy if Apple releases another device with those features and your app doesn't support them.
If you need to determine whether you're on an iPad, check UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad. If you need to see if you have a Retina display, check [UIScreen mainScreen].scale. Combine the two and you can find out if you're on an iPad with Retina display.
If you need other features specific to the new iPad, look in the API for those features: AV Foundation can tell you about the capabilities of the built-in camera, for example. There's probably some way to check for LTE, too, but I'm not aware of it.

Related

Xamarin Forms: Prevent screenshot in ios [duplicate]

This question already has answers here:
Prevent screen capture in an iOS app
(9 answers)
Closed 5 years ago.
HI I am developing an app using Xamarin Forms PCL project. I want to restrict user from taking screenshot in my ios app . How can I prevent user from taking screenshot?
As far as I'm aware you can't prevent screenshots, using xamarin won't change anything about this. But you can detect them (like snapchat does) see.
It is impossible to prevent user from taking screenshots in iOS (as far as I know), currently. The operating system itself only can restrict users from taking screenshots, currently (also).
Still you can do something to make the process of taking screenshots harder. Users need to press the sleep/wake button and the home button in order to take screenshots and it needs both hands. So you can implement a way to show the data only when the user touches someplace in the screen. Such a mechanism would be great in this case.

Xcode 6.1.3 can't change simulated screen size

Using Xcode 6.3.1 I needed to simulate sizes to make the app compatible with older devices, I went to menu just to find that I can't select different screen sizes.
What am I missing?
EDIT
Another project, this time using size classes:
This option makes the entire storyboard use a specific screen size so I can see what is happening at design time
Maybe this is intended? To make people use size classes?
So, after some time (almost a year) I still haven't found a solution. The new preview is supposed to replace the old "Simulated Screen".
This is how you enable it:
And this is how you add any number of devices side-by-side:
The reason they added this is because you can now see many resolutions at the same time and see better what you build and how it will look in the various devices available.
I don't agree with that, I still miss the "Simulated Screen". I think it was a better solution, but they removed. We have to deal with it.
Before this turns into a race to see who gets the bounty I'm going to close this.
#mcatach : Thats not the point. Xcode before 6.3.1 allowed you to see your storyboard in the interface builder with the device size you wanted. So we could use size classes and see in a particular resolution how it should look.
#aman.sood : This wont do. Changing the development target will not do anything to the interface builder, only remove size classes on older targets. Preview helps, but could be better. Using actual device is required to publish but it's not a solution to see different resolutions, that would mean you need at least 6 devices (7 with iPad mini).
Couple of things you can do
Use Xcode by setting active schema for different devices like iPhone 4,iPhone 6s etc. But these drop down option will be available as per your deployment target settings selection
Second option is to use Preview in Xcode. That will provide you with different configuration without running your app. Check out this video for more details.
And last is to use actual device which only one uses when there is device specific issue.
When you're using size classes you will not see specific resolutions sizes. You need to design your screens based on global sizes (Compact/Regular/Any). You can use Any to fit any possible height/width.
So, my advice is to decide if you want to support iPhone and/or iPad, and then start to draw your screens.

Adding screenshot in iTunes Connect without real Device

I am about to submit my app in iTunes connect.
Now it is asking me for screenshots for a 3.5-inch, 4-inch, 4.7-inch and 5.5-inch.
Since I coded it in swift I guess I can skip the 3.5inch part?
But my question is: I only have an 4-inch device available. How can I add the screenshots of the 4.7 and 6inch? maybe with the simulator?
Thank you
In the iOS Simulator File > Screenshot
That saves a screenshot to your desktop.
Simulator should be fine. You can edit it using Sketch, I found it really helpful.
I tried a few different methods, and what worked best for me in a short amount of time was to capture screenshots in the iOS Simulator at 100% scale and then resize them using GIMP, which is free unlike Sketch.
If you're in the business of creating screenshots for many devices, across locales or with frequent screenshot update needs it's best to look into automation with tool like Snapshot.

Should i make apps for tablets and phones separately?

I am currently developing an android app for phones and for tablets.I need to know whether i should make a separate app for a phone and a tablet.Is there anyway of making a single app for both?
Thanks
You should create a single app for tablet and phone unless you have a very pressing reason not to.
Since 1.5/1.6, Android has given resources to manage several different screen sizes. All programming logic should be unaffected by the size of the screen. Everything should be defined in layout files.
That said, if you're programming an openGL game with drastically different phone and tablet behavior, you may want to consider it. Otherwise, stick with one app.

iPhone simulator for Windows

I would like an iPhone simulator for Windows. Something similar to this one here:
http://css-tricks.com/video-screencasts/38-basics-tips-on-designing-for-the-iphone/
Note, this is NOT to test iPhone Apps... but rather, to test websites. I know I could just use a browser, but I was hoping for something with a bit more functionality ( specific to the touch interface ) that I could test some web pages on.
I've seen the beta project here: http://labs.blackbaud.com/NetCommunity/article?artid=662
Is this the best option at the moment? The article was from last year, that's why I ask.
Just to add additional information to this post:
found another one for both iphone and ipad: http://code.google.com/p/ibbdemo2/downloads/detail?name=iBBDemo2.air&can=4&q=
Google Chrome now has the ability to "Toggle Device Mode" by clicking the Phone icon in Dev Tools. This gives you a more touch-specific interface than just using the browser, allows you to throttle data, etc...
From here, you can choose the device:
You can do it all online, without a simulator:
http://iphonetester.com/
Keep in mind, it's not a real test on an iPhone, but if you use it with Safari or Chrome for Windows, you'll come really close to how it'll look on an iPhone.
UPDATE: iphonetester.com no longer exists.
That's the best I found: http://iphone4simulator.com/
There is a commercial successor to iBBDemo2 that's available for $40 - http://www.electricplum.com/studio.aspx

Resources