{"id":20564065,"url":"https://github.com/clintjang/sample-swift-progressinfo","last_synced_at":"2026-05-29T12:03:56.965Z","repository":{"id":99120085,"uuid":"125347888","full_name":"ClintJang/sample-swift-progressinfo","owner":"ClintJang","description":"Let's take a look at the processInfo of swift. This is a sample source and description.","archived":false,"fork":false,"pushed_at":"2018-04-11T14:46:31.000Z","size":747,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-08T19:21:59.312Z","etag":null,"topics":["example","processinfo","sample","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ClintJang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-15T10:04:45.000Z","updated_at":"2022-05-05T05:38:03.000Z","dependencies_parsed_at":"2023-06-04T00:15:39.096Z","dependency_job_id":null,"html_url":"https://github.com/ClintJang/sample-swift-progressinfo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ClintJang/sample-swift-progressinfo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClintJang%2Fsample-swift-progressinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClintJang%2Fsample-swift-progressinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClintJang%2Fsample-swift-progressinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClintJang%2Fsample-swift-progressinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClintJang","download_url":"https://codeload.github.com/ClintJang/sample-swift-progressinfo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClintJang%2Fsample-swift-progressinfo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33650712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example","processinfo","sample","swift"],"created_at":"2024-11-16T04:23:44.136Z","updated_at":"2026-05-29T12:03:56.947Z","avatar_url":"https://github.com/ClintJang.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apple's ProcessInfo Class\n[![License](http://img.shields.io/badge/License-MIT-green.svg?style=flat)](https://github.com/clintjang/sample-swift-progressinfo/blob/master/LICENSE) [![Swift 4](https://img.shields.io/badge/swift-4.0-orange.svg?style=flat)](https://swift.org) \n- [ProcessInfo](https://developer.apple.com/documentation/foundation/processinfo) : The process information agent can return information such as arguments, environment variables, host name, and process name. The processInfo class method returns the shared agent for the current process—that is, the process whose object sent the message. For example, the following line returns the NSProcessInfo object, which then provides the name of the current process\n- How can you use it?\n- [Korean Description](https://github.com/ClintJang/sample-swift-progressinfo/blob/master/READMEKO.md) : Korean Description Link\n- iOS 2.0+\n\n# Information\nLet's take a look at the processInfo of swift. This is a sample source and description.\n\n\n# Samples \n\u003e Using the method of sending Arguments when running the app, try to test how to build the conditions in the build test, and check how to output the keys.\n\u003e\u003e It can be set in run, so it does not apply to archive. So it is useful for testing.\n\nsources\n- ViewController.swift\n```swift\n    @IBOutlet weak var testLabel: UILabel!\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \n        // Samples Case 01\n        useArgumentsPassedOnLaunch()\n        \n        // Samples Case 02\n        printProcessInfoEnvironmentKeyAndValue()\n        \n    }\n    \n    func useArgumentsPassedOnLaunch() {\n        // TEST Setting 1\n        if ProcessInfo.processInfo.arguments.contains(\"TEST_SELF_VIEW_BACKGROUND_COLOR\") {\n            self.view.backgroundColor = #colorLiteral(red: 0.4666666687, green: 0.7647058964, blue: 0.2666666806, alpha: 1)\n        }\n        \n        // TEST Setting 2\n        if ProcessInfo.processInfo.arguments.contains(\"TEST_SELF_LABEL_TEXT\") {\n            testLabel.text = \"TEST\"\n        }\n    }\n    \n    func printProcessInfoEnvironmentKeyAndValue() {\n        // View key and value log\n        for (key, value) in ProcessInfo.processInfo.environment {\n            print(\"\u003e\u003e\u003e\u003e \\(key): \\(value)\")\n        }\n    }\n```\n\n## Samples Case 01\n\u003e Use \"Arguments Passed On Launch\"\n\u003e\u003e 1. It seems to be a convenient way to actually use it. By modifying the checks of the Arguments of the schema without modifying the code, you can see the changes and options given in the development.\n\u003e\u003e 2. It is better to use it with the \"active compilation flag\".\n\nArguments Setting\n\u003ctable style=\"width:100%\"\u003e\n  \u003ctr\u003e\n\t\u003cth\u003eSetting (1/2)\u003c/th\u003e \n\t\u003cth\u003eSetting (2/2)\u003c/th\u003e \n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \t\u003ctd\u003e\u003cimg width=\"295\" height=\"138\" src=\"/Image/ArgumentsSetting01.png\"\u003e\u003c/img\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg width=\"582\" height=\"239\" src=\"/Image/ArgumentsSetting02.png\"\u003e\u003c/img\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Result\n- If nothing is set\n\u003ctable style=\"width:100%\"\u003e\n  \u003ctr\u003e\n\t\u003cth\u003eArguments Setting\u003c/th\u003e \n\t\u003cth\u003eViewing\u003c/th\u003e \n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \t\u003ctd\u003e\u003cimg width=\"350\" height=\"120\" src=\"/Image/ArgumentsCaseSetting01.png\"\u003e\u003c/img\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg width=\"250\" height=\"500\" src=\"/Image/ArgumentsCase01.png\"\u003e\u003c/img\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n- First set test\n\u003ctable style=\"width:100%\"\u003e\n  \u003ctr\u003e\n\t\u003cth\u003eArguments Setting\u003c/th\u003e \n\t\u003cth\u003eViewing\u003c/th\u003e \n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \t\u003ctd\u003e\u003cimg width=\"350\" height=\"120\" src=\"/Image/ArgumentsCaseSetting02.png\"\u003e\u003c/img\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg width=\"250\" height=\"500\" src=\"/Image/ArgumentsCase02.png\"\u003e\u003c/img\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n- second set test\n\u003ctable style=\"width:100%\"\u003e\n  \u003ctr\u003e\n\t\u003cth\u003eArguments Setting\u003c/th\u003e \n\t\u003cth\u003eViewing\u003c/th\u003e \n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \t\u003ctd\u003e\u003cimg width=\"350\" height=\"120\" src=\"/Image/ArgumentsCaseSetting03.png\"\u003e\u003c/img\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg width=\"250\" height=\"500\" src=\"/Image/ArgumentsCase03.png\"\u003e\u003c/img\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n- last set test\n\u003ctable style=\"width:100%\"\u003e\n  \u003ctr\u003e\n\t\u003cth\u003eArguments Setting\u003c/th\u003e \n\t\u003cth\u003eViewing\u003c/th\u003e \n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \t\u003ctd\u003e\u003cimg width=\"350\" height=\"120\" src=\"/Image/ArgumentsCaseSetting04.png\"\u003e\u003c/img\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg width=\"250\" height=\"500\" src=\"/Image/ArgumentsCase04.png\"\u003e\u003c/img\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Samples Case 02\n\u003e Let's see what information is output by key and value.\n- run function\n```swift\n    func printProcessInfoEnvironmentKeyAndValue() {\n        // View key and value log\n        for (key, value) in ProcessInfo.processInfo.environment {\n            print(\"\u003e\u003e\u003e\u003e \\(key): \\(value)\")\n        }\n    }\n```\n\n- print result (in simulator:iPhone 8 Plus)\n```\n\u003e\u003e\u003e\u003e __XPC_DYLD_FRAMEWORK_PATH: /Users/clintjang/Library/Developer/Xcode/DerivedData/JWSProcessInfoSample-evdzffmjhsdbdkdsqjhqkkphmnjc/Build/Products/Debug-iphonesimulator\n\u003e\u003e\u003e\u003e DYLD_ROOT_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot\n\u003e\u003e\u003e\u003e SIMULATOR_AUDIO_DEVICES_PLIST_PATH: /Users/clintjang/Library/Developer/CoreSimulator/Devices/6A2A94FC-74F0-47AC-847A-5F583E63430D/data/var/run/com.apple.coresimulator.audio.plist\n\u003e\u003e\u003e\u003e SIMULATOR_MAINSCREEN_WIDTH: 1242\n\u003e\u003e\u003e\u003e IPHONE_SHARED_RESOURCES_DIRECTORY: /Users/clintjang/Library/Developer/CoreSimulator/Devices/6A2A94FC-74F0-47AC-847A-5F583E63430D/data\n\u003e\u003e\u003e\u003e SIMULATOR_AUDIO_SETTINGS_PATH: /Users/clintjang/Library/Developer/CoreSimulator/Devices/6A2A94FC-74F0-47AC-847A-5F583E63430D/data/var/run/simulatoraudio/audiosettings.plist\n\u003e\u003e\u003e\u003e DYLD_LIBRARY_PATH: /Users/clintjang/Library/Developer/Xcode/DerivedData/JWSProcessInfoSample-evdzffmjhsdbdkdsqjhqkkphmnjc/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection\n\u003e\u003e\u003e\u003e SIMULATOR_MAINSCREEN_SCALE: 3.000000\n\u003e\u003e\u003e\u003e DYLD_FALLBACK_FRAMEWORK_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks\n\u003e\u003e\u003e\u003e SIMULATOR_MEMORY_WARNINGS: /Users/clintjang/Library/Developer/CoreSimulator/Devices/6A2A94FC-74F0-47AC-847A-5F583E63430D/data/var/run/memory_warning_simulation\n\u003e\u003e\u003e\u003e CLASSIC: 0\n\u003e\u003e\u003e\u003e SIMULATOR_MAINSCREEN_HEIGHT: 2208\n\u003e\u003e\u003e\u003e SIMULATOR_HID_SYSTEM_MANAGER: /Library/Developer/PrivateFrameworks/CoreSimulator.framework/Resources/Platforms/iphoneos/Library/Frameworks/SimulatorHID.framework\n\u003e\u003e\u003e\u003e IPHONE_SIMULATOR_ROOT: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot\n\u003e\u003e\u003e\u003e XPC_SIMULATOR_LAUNCHD_NAME: com.apple.CoreSimulator.SimDevice.6A2A94FC-74F0-47AC-847A-5F583E63430D\n\u003e\u003e\u003e\u003e XPC_FLAGS: 0x0\n\u003e\u003e\u003e\u003e SIMULATOR_DEVICE_NAME: iPhone 8 Plus\n\u003e\u003e\u003e\u003e XPC_SERVICE_NAME: UIKitApplication:kr.co.clintjang.JWSProcessInfoSample[0xd43f][19064]\n\u003e\u003e\u003e\u003e SIMULATOR_LEGACY_ASSET_SUFFIX: iphone\n\u003e\u003e\u003e\u003e SIMULATOR_RUNTIME_VERSION: 11.2\n\u003e\u003e\u003e\u003e SIMULATOR_LOG_ROOT: /Users/clintjang/Library/Logs/CoreSimulator/6A2A94FC-74F0-47AC-847A-5F583E63430D\n\u003e\u003e\u003e\u003e PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/sbin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/sbin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/local/bin\n\u003e\u003e\u003e\u003e TESTMANAGERD_SIM_SOCK: /private/tmp/com.apple.launchd.0kywxbpXsL/com.apple.testmanagerd.unix-domain.socket\n\u003e\u003e\u003e\u003e SIMULATOR_SHARED_RESOURCES_DIRECTORY: /Users/clintjang/Library/Developer/CoreSimulator/Devices/6A2A94FC-74F0-47AC-847A-5F583E63430D/data\n\u003e\u003e\u003e\u003e SIMULATOR_VERSION_INFO: CoreSimulator 494.33 - Device: iPhone 8 Plus - Runtime: iOS 11.2 (15C107) - DeviceType: iPhone 8 Plus\n\u003e\u003e\u003e\u003e SIMULATOR_RUNTIME_BUILD_VERSION: 15C107\n\u003e\u003e\u003e\u003e SIMULATOR_CAPABILITIES: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/DeviceTypes/iPhone 8 Plus.simdevicetype/Contents/Resources/capabilities.plist\n\u003e\u003e\u003e\u003e NSUnbufferedIO: YES\n\u003e\u003e\u003e\u003e SIMULATOR_MAINSCREEN_PITCH: 461.000000\n\u003e\u003e\u003e\u003e HOME: /Users/clintjang/Library/Developer/CoreSimulator/Devices/6A2A94FC-74F0-47AC-847A-5F583E63430D/data/Containers/Data/Application/132D6DCC-2A9F-4EC4-AD68-354B521C2207\n\u003e\u003e\u003e\u003e OS_ACTIVITY_DT_MODE: YES\n\u003e\u003e\u003e\u003e SIMULATOR_MODEL_IDENTIFIER: iPhone10,5\n\u003e\u003e\u003e\u003e IOS_SIMULATOR_SYSLOG_SOCKET: /private/tmp/com.apple.CoreSimulator.SimDevice.6A2A94FC-74F0-47AC-847A-5F583E63430D/syslogsock\n\u003e\u003e\u003e\u003e IPHONE_TVOUT_EXTENDED_PROPERTIES: /Users/clintjang/Library/Developer/CoreSimulator/Devices/6A2A94FC-74F0-47AC-847A-5F583E63430D/data/Library/Application Support/Simulator/extended_display.plist\n\u003e\u003e\u003e\u003e TMPDIR: /Users/clintjang/Library/Developer/CoreSimulator/Devices/6A2A94FC-74F0-47AC-847A-5F583E63430D/data/Containers/Data/Application/132D6DCC-2A9F-4EC4-AD68-354B521C2207/tmp\n\u003e\u003e\u003e\u003e CUPS_SERVER: /private/tmp/com.apple.launchd.Mi4ALE40dE/Listeners\n\u003e\u003e\u003e\u003e __XPC_DYLD_LIBRARY_PATH: /Users/clintjang/Library/Developer/Xcode/DerivedData/JWSProcessInfoSample-evdzffmjhsdbdkdsqjhqkkphmnjc/Build/Products/Debug-iphonesimulator\n\u003e\u003e\u003e\u003e SIMULATOR_HOST_HOME: /Users/clintjang\n\u003e\u003e\u003e\u003e SIMULATOR_BOOT_TIME: 1521107015\n\u003e\u003e\u003e\u003e SIMULATOR_PRODUCT_CLASS: D21\n\u003e\u003e\u003e\u003e SIMULATOR_EXTENDED_DISPLAY_PROPERTIES: /Users/clintjang/Library/Developer/CoreSimulator/Devices/6A2A94FC-74F0-47AC-847A-5F583E63430D/data/Library/Application Support/Simulator/extended_display.plist\n\u003e\u003e\u003e\u003e DYLD_FALLBACK_LIBRARY_PATH: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib\n\u003e\u003e\u003e\u003e SIMULATOR_UDID: 6A2A94FC-74F0-47AC-847A-5F583E63430D\n\u003e\u003e\u003e\u003e DYLD_FRAMEWORK_PATH: /Users/clintjang/Library/Developer/Xcode/DerivedData/JWSProcessInfoSample-evdzffmjhsdbdkdsqjhqkkphmnjc/Build/Products/Debug-iphonesimulator\n\u003e\u003e\u003e\u003e __XCODE_BUILT_PRODUCTS_DIR_PATHS: /Users/clintjang/Library/Developer/Xcode/DerivedData/JWSProcessInfoSample-evdzffmjhsdbdkdsqjhqkkphmnjc/Build/Products/Debug-iphonesimulator\n\u003e\u003e\u003e\u003e SIMULATOR_ROOT: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot\n\u003e\u003e\u003e\u003e CFFIXED_USER_HOME: /Users/clintjang/Library/Developer/CoreSimulator/Devices/6A2A94FC-74F0-47AC-847A-5F583E63430D/data/Containers/Data/Application/132D6DCC-2A9F-4EC4-AD68-354B521C2207\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclintjang%2Fsample-swift-progressinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclintjang%2Fsample-swift-progressinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclintjang%2Fsample-swift-progressinfo/lists"}