My program needs to stay on top of all programs so I use this code and have it updating every second.
view.window?.level = Int(CGShieldingWindowLevel()) + 1
Now whenever I put my mac to sleep the program goes over the sign in page. How can I avoid this problem?