Advertisement
mechanicker

Coffee

Jun 29th, 2024
911
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.32 KB | None | 0 0
  1. import Foundation
  2. import IOKit.pwr_mgt
  3.  
  4. var assertionID : IOPMAssertionID = IOPMAssertionID(0)
  5. var description : CFString = "Cup of coffee" as CFString
  6.  
  7. let success = IOPMAssertionDeclareUserActivity(description, kIOPMUserActiveLocal, &assertionID)
  8. if success == kIOReturnSuccess {
  9.     // IOPMAssertionRelease(assertionID)
  10. }
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement