Taking a screenshot of user defined area in swift macOS - swift

I am developing a macOS app which requires the user to select an area of the screen and then the area(screenshot) is converted to an image.
Right now I can’t seem to find a way to let the user draw the rectangle which allows the user to select the region of which to take the screenshot.
Although there are a lot of sources stating how to take screenshot on iOS, the same can’t be said for macOS.

Related

Swift Google Maps not going under Safe Area

I am using Google Maps SDK on iOS using Swift, and have tried to get the map to go under the safe area, but it always respects the safe area.
I have attached the storyboard setup in the images.
How would I stop respecting the safe area and fill it?

How can I set the image for app introduction's background in Apple TV app store

I have developed and published one TVOS app. In my app project, I put icon images, launch image and top shelf image. I also put two screenshots in the app configuration part on the developer.apple.com.
Now the app is online. The top shelf image is fine when the app is in focus. But the top shelf image is not used as the background image in the App introduction part in the App Store. I want to get the full background like the game app. Where shall I configure that image and what is the dimension of the image? Thanks in advance! I attach images to make my questions more clear.
My app looks like this when it is focused on the Apple TV. I want to use this topshelf image for the app introduction background.
But it looks like this in the app store. I don't want to see the screenshot on the right side of the screen. There is no background image at the introduction part.
I want to get the full-background for the introduction page like this app.
You have no control over that. Only apps selected by Apple's App Store editors are given the privilege to have a customized App Store page.
Note, the standard background on the Apple TV App Store, is created automatically based on your app's icon. It's a large, blurred out version of your icon. So in your case, you see that red line, and a lot of white, which is exactly what you have in your icon.

margins for ios app icons

I have an icon for my iOS app that seems to be missing some margins that other icons have. This creates an irregular, unwanted border around the icon when it is selected in Springboard (as the darkened selection overlay is smaller than the actual icon), as visible in this image:
When another app is selected (Safari, for example), there is no extra border:
I've tried this out with "Prerendered" setting (in the Xcode Target Summary page) on and off with no visible difference. I've also noticed other apps icons that have this issue. When I look at the icon for an app that doesn't have this issue, I do notice margins of a few pixels on every side.
I couldn't find any values listed online for the margins of different icon sizes. Does someone happen to know the values for the margins, or a program that can create the images with the correct margins? Or is there something else I may be missing?
(Note that the icons are not parallel due to the wiggling icons do in the app-deletion mode of Springboard. The 72#2x visible on the icon is--I assume--a separate issue.)
UPDATE: I myself have verified this on both a iPod Touch 4 (iOS 5) and iPhone 4 (iOS 6). (If it matters, both devices are jailbroken.) The project contains the following icons: Icon (57x57), Icon#2x (114x114), Icon-72 (72x72) and Icon-72#2x (144x144).
UPDATE 2: Since I'm developing an app for Cydia, the automatic icon rounding done by Springboard for regular App Store apps doesn't seem to be a possibility (see comments in #Vojtech Vrbka's answer).
UPDATE 3: Posted my solution to this problem (also removed the linked question in the last paragraph before the updates).
If you are making round corners manually, don't. Use square icon and the round corners will be added automatically.
Here is list of all sizes, that you should include in your app: Custom Icon and Image Creation Guidelines
It turns out the main problem I had was not knowing what margins to use, but that my app did not get the automatic rounded corners (and margins) from Springboard which regularly installed apps would get (as my app is for Cydia, meaning it's basically a System App, and I was installing it manually to /Applications).
I found a similar question here, which had two useful answers, one which provides a potential way to prepare the icons manually, and another which names a useful app in Cydia which can create the icons correctly: http://cydia.saurik.com/package/org.thebigboss.iconmaker (most likely using the method from the other answer).

Icon design and jagged edges

I thought I had my ios app icon all settled. I designed in Photoshop and tested in the prescribed sizes and it looks great (resizing in photoshop and saving to .png). I also tested via the "add to home screen" to see how it would look and looks nice and crisp (via a cool little webpage that lets you upload icon and bookmark on your device).
However, when I upload it as the large 1024 x 1024 icon (png) you do via iTunes Connect my shapes look all jagged. At least in the preview you get when initially getting ready to submit a new application.
Wondering what causes this and what I need to take into account as it pertains to how Apple resizes icons for delivery. Any help in pointing me in the right direction would be great.
What resolution did you design it in? If you designed it in Photoshop, it is a raster image and I would suggest you design in illustrator as a vector, but at the very minimum make sure your designed resolution is higher than the proportions required for the icon by Itunes.

"Instant alpha" function in iPhone app

Is there anything in the SDK which would allow you to replicate the instant alpha functionality found in some mac apps (Pages, Keynote, Preview) on the iPhone?
Basically my objective is to take a picture which contains a main object against a fairly even background, and eliminate the background leaving only the main object. The user could select the areas that represent the background. As an example, from this original: http://i.stack.imgur.com/vOgvn.jpg
We would get this image after applying the effect (white background is transparent): http://i.stack.imgur.com/McGwA.png
In the SDK, no. You'd have to loop through every pixel and check it's color and see if it is within some threshold you have specified.