Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
terminate app after closing window
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce committed Apr 27, 2019
1 parent 6316ae1 commit 24a0b36
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Safari/BlockerExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>4</string>
<string>6</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSExtension</key>
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions Safari/HelloGoodbye/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
// Insert code here to tear down your application
}

func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
// more reference: https://stackoverflow.com/a/2926356/8126260
return true
}
}
2 changes: 1 addition & 1 deletion Safari/HelloGoodbye/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<scene sceneID="R2V-B0-nI4">
<objects>
<windowController showSeguePresentationStyle="single" id="B8D-0N-5wS" sceneMemberID="viewController">
<window key="window" title="Hello, Goodbye" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" titlebarAppearsTransparent="YES" id="IQv-IB-iLA">
<window key="window" title="Hello, Goodbye" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="IQv-IB-iLA">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<windowCollectionBehavior key="collectionBehavior" fullScreenNone="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
Expand Down
2 changes: 1 addition & 1 deletion Safari/HelloGoodbye/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>4</string>
<string>6</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand Down

0 comments on commit 24a0b36

Please sign in to comment.