본문 바로가기
반응형

#컴퓨터 과학 [Computer Science]/운영체제 (Operating System)49

[OS - 🍎 macOS] macOS 유효한 URL 확인하기 (How to check validity of URL in Swift) 👓 NSPredicate A definition of logical conditions used to constrain a search either for a fetch or for in-memory filtering. 📔 Check validity of URL Source Code by Swift func checkValidWebURL(url: String) -> Bool { let urlRegEx = "^(https?://)?(www\\.)?([-a-z0-9]{1,63}\\.)*?[a-z0-9][-a-z0-9]{0,61}[a-z0-9]\\.[a-z]{2,6}(/[-\\w@\\+\\.~#\\?&/=%]*)?$" let urlTest = NSPredicate(format:"SELF MATCHES %@",.. 2019. 11. 25.
[OS - 🍎 macOS] macOS 현재 사용자 이름 구하기 (Getting the currently logged in user on macOS) 👓 001. SCDynamicStoreCopyConsoleUser(_:_:_:) // MARK: - Returns information about the user currently logged into the system. func SCDynamicStoreCopyConsoleUser(_ store: SCDynamicStore?, _ uid: UnsafeMutablePointer?, _ gid: UnsafeMutablePointer?) -> CFString? 👓 002. SCDynamicStoreKeyCreateConsoleUser(_:) // MARK: - Creates a key that can be used to receive notifications when the current console u.. 2019. 11. 20.
[OS - 🍎 macOS] macOS 앱 실행하기 (Launching apps programmatically) 👓 001. launchApplication // MARK: - Launches the specified app. func launchApplication(_ appName: String) -> Bool 📔 Launching apps programmatically Source Code by Swift NSWorkspace.shared.launchApplication('APP NAME') // EXAMPLE NSWorkspace.shared.launchApplication("Safari") 🚀 REFERENCE ChangYeop-Yang/Study-macOS macOS는 기업 애플이 제작한 운영 체제이다. 2002년 4월부터 모든 매킨토시 컴퓨터에 적용되고 있다. - ChangYeop-Yang/Study-.. 2019. 11. 1.
[OS - 🍎 macOS] macOS 일련 번호 가져오기 (Find macOS serial number) 📄 Find macOS serial number by Swift /* * Copyright (c) 2019 양창엽. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or s.. 2019. 10. 12.
반응형