OSX App: Get max resolution of the user's display (Swift) -


i'm trying max resolution of user's display-- not current resolution, maximum display supports. know can current resolution this need maximum (ie: on mbp 13inch resolution 2560x1600).

i know can in terminal using this, avoid trying hack-y in terminal, , instead swift. suggestions on how can this? thanks.

you need use quartz display services. first, list of displays, cggetactivedisplaylist. then, each display, use cgdisplaycopyalldisplaymodes. iterate on array of modes, using cgdisplaymodegetwidth , cgdisplaymodegetheight figure out highest resolution.


Comments

Post a Comment

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -