How do I get device platform type in Swift? - swift2

I want to have a section in my app that shows the device type so I can make it noticeable to show that the device is supported. How do I get this? I tried
UIDevice.currentDevice().
and there was no platform type.

Why cant you use:
UIDevice.current.systemName
That worked for me.

You should check this Question here.
I didn't get why you want to show the user if the device is supported.
The user shoudn't be able to download your app if the device is not compatible, and you can limit what device can download your app by doing this.
This link can also help you decide what UIRequiredDeviceCapabilities key you should use

Related

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.

how to create Kindle fire device in geny motion?

Hi I want to create device for kindle fire tab using 'Genymotion' but can't see any device for that so can any one help me.
Currently i know, there is no Amazon device available on Genymotion pre-configured device list. You need use a Generic Device to test :(
I believe that, further informations or requests can submitted right at https://cloud.genymotion.com/page/support/

Detecting Full screen applications on mac

I am developing a simple application in Cocoa, and I want to detect whether any application is running in full screen mode. Is this possible?
Through runningApplications API, I can get various informations but there is no specific property related to full screen mode. Does any one know how to detect it? Is there any carbon event or API for this?
I ran into this in the spring and spent forever trying to get it to work. I ended up packaging my code up into a little GitHub project, but I completely forgot to share it here.
https://github.com/shinypb/FullScreenDetector
Hope this is useful for someone.
Anyways after trying out so many options and digging into the NSWorkspace i have found way through which we can achieve this their is notification
"NSWorkspaceActiveSpaceDidChangeNotification"
Apple doc says "Posted when a Spaces change has occurred." so by using we can register for it. along with this we need to use the NSWindow's property "isOnActiveSpace" , so by this we can detect when application enters full screen mode and exits from it.
You want to key-value observe -[NSApplication currentSystemPresentationOptions]. When the active app is in full-screen mode, that property will include NSApplicationPresentationFullScreen.

Only support iPad2

I am making a app involve the use of camera. However, ipad1 does not support and crash when press the camera.
How can I choose that app only support ipad2 but not ipad1?
Is there anything i can set in the setting or any code i can type in?
Thank you all.
You can specify device requirements in the info.plist You would just specify that it needs a camera

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