Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Oct 3, 2024. It is now read-only.
/TrapPublic archive

It’s a trap! Catch OS signals in Swift. Swift Signal Handler.

License

NotificationsYou must be signed in to change notification settings

alexito4/Trap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Giphy

Trap is a small Swift framework to handle operating system signals.

Usage

import Traplet task = NSTask...Trap.handle(.interrupt) {    task.terminate()    exit(EXIT_FAILURE)}task.launch()

It can also handle multiple signals at the same time.

Trap.handle(Trap.Signal.all) {    print("Signal: \($0)")    ...}

Requirements

Trap is build using the stable version ofSwift 3.0.


[8]ページ先頭

©2009-2025 Movatter.jp