├── SwiftMonitor.xcodeproj
├── xcuserdata
│ └── nash.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── SwiftMonitor.xcscheme
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── project.pbxproj
├── SwiftMonitor
├── AppDelegate.swift
├── ViewController.swift
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
└── Base.lproj
│ └── Main.storyboard
├── readme.md
├── .gitignore
├── SwiftMonitorTests
├── Info.plist
└── SwiftMonitorTests.swift
└── FolderMonitor.swift
/SwiftMonitor.xcodeproj/xcuserdata/nash.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/SwiftMonitor.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SwiftMonitor/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // SwiftMonitor
4 | //
5 | // Created by Martin Nash on 2/27/15.
6 | // Copyright (c) 2015 Martin Nash. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate {
13 |
14 |
15 |
16 | func applicationDidFinishLaunching(aNotification: NSNotification) {
17 | // Insert code here to initialize your application
18 | }
19 |
20 | func applicationWillTerminate(aNotification: NSNotification) {
21 | // Insert code here to tear down your application
22 | }
23 |
24 |
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | ## Swift File Monitor
2 |
3 | Monitor a directory in your filesystem for changes.
4 |
5 | ```swift
6 | let url = NSURL(fileURLWithPath: "~/Desktop".stringByExpandingTildeInPath)!
7 | let monitor = FolderMonitor(url: url, handler: {
8 | println("Found change")
9 | })
10 | ```
11 |
12 | You can also pause and resume getting callbacks. Don't worry about balancing calls to start and stop. I took care of that for you. ;)
13 |
14 | ```swift
15 | monitor.start()
16 | monitor.stop()
17 | ```
18 |
19 |
20 |
21 | ## Inspiration
22 |
23 | - [Cocoanetics -- Monitoring a Folder With GCD](http://www.cocoanetics.com/2013/08/monitoring-a-folder-with-gcd/)
--------------------------------------------------------------------------------
/SwiftMonitor.xcodeproj/xcuserdata/nash.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | SwiftMonitor.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | C6C50F991AA11BE600218EC4
16 |
17 | primary
18 |
19 |
20 | C6C50FAB1AA11BE600218EC4
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | build/
4 | *.pbxuser
5 | !default.pbxuser
6 | *.mode1v3
7 | !default.mode1v3
8 | *.mode2v3
9 | !default.mode2v3
10 | *.perspectivev3
11 | !default.perspectivev3
12 | xcuserdata
13 | *.xccheckout
14 | *.moved-aside
15 | DerivedData
16 | *.hmap
17 | *.ipa
18 | *.xcuserstate
19 |
20 | # CocoaPods
21 | #
22 | # We recommend against adding the Pods directory to your .gitignore. However
23 | # you should judge for yourself, the pros and cons are mentioned at:
24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
25 | #
26 | # Pods/
27 |
28 | # Carthage
29 | #
30 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
31 | # Carthage/Checkouts
32 |
33 | Carthage/Build
34 |
--------------------------------------------------------------------------------
/SwiftMonitorTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.martinjnash.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/SwiftMonitor/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // SwiftMonitor
4 | //
5 | // Created by Martin Nash on 2/27/15.
6 | // Copyright (c) 2015 Martin Nash. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class ViewController: NSViewController {
12 |
13 | private var monitor: FolderMonitor!
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 | createMonitorIfNot()
18 | }
19 |
20 | func createMonitorIfNot() {
21 | let url = NSURL(fileURLWithPath: "~/Desktop".stringByExpandingTildeInPath)!
22 | monitor = monitor ?? FolderMonitor(url: url, handler: {
23 | println("Found change")
24 | })
25 | println("Monitoring '\(url)'")
26 | }
27 |
28 | @IBAction func startMonitor(sender: AnyObject?) {
29 | createMonitorIfNot()
30 | }
31 |
32 | @IBAction func stopMonitor(sender: AnyObject?) {
33 | monitor = nil
34 | }
35 |
36 |
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/SwiftMonitorTests/SwiftMonitorTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftMonitorTests.swift
3 | // SwiftMonitorTests
4 | //
5 | // Created by Martin Nash on 2/27/15.
6 | // Copyright (c) 2015 Martin Nash. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 | import XCTest
11 |
12 | class SwiftMonitorTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | XCTAssert(true, "Pass")
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measureBlock() {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/SwiftMonitor/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "mac",
5 | "size" : "16x16",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "mac",
10 | "size" : "16x16",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "mac",
15 | "size" : "32x32",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "mac",
20 | "size" : "32x32",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "mac",
25 | "size" : "128x128",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "mac",
30 | "size" : "128x128",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "mac",
35 | "size" : "256x256",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "mac",
40 | "size" : "256x256",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "mac",
45 | "size" : "512x512",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "mac",
50 | "size" : "512x512",
51 | "scale" : "2x"
52 | }
53 | ],
54 | "info" : {
55 | "version" : 1,
56 | "author" : "xcode"
57 | }
58 | }
--------------------------------------------------------------------------------
/SwiftMonitor/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | com.martinjnash.$(PRODUCT_NAME:rfc1034identifier)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHumanReadableCopyright
28 | Copyright © 2015 Martin Nash. All rights reserved.
29 | NSMainStoryboardFile
30 | Main
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/FolderMonitor.swift:
--------------------------------------------------------------------------------
1 |
2 | import Foundation
3 |
4 | open class FolderMonitor {
5 |
6 | enum State {
7 | case on, off
8 | }
9 |
10 | fileprivate let source: DispatchSource
11 | fileprivate let descriptor: CInt
12 | fileprivate let qq: DispatchQueue = DispatchQueue.main
13 | fileprivate var state: State = .off
14 |
15 | /// Creates a folder monitor object with monitoring enabled.
16 | public init(url: URL, handler: @escaping ()->Void) {
17 |
18 | state = .off
19 | descriptor = open((url as NSURL).fileSystemRepresentation, O_EVTONLY)
20 |
21 | source = DispatchSource.makeFileSystemObjectSource(fileDescriptor: descriptor, eventMask: DispatchSource.FileSystemEvent.write, queue: qq) /*Migrator FIXME: Use DispatchSourceFileSystemObject to avoid the cast*/ as! DispatchSource
22 |
23 | source.setEventHandler {
24 | handler()
25 | }
26 | start()
27 | }
28 |
29 | /// Starts sending notifications if currently stopped
30 | open func start() {
31 | if state == .off {
32 | state = .on
33 | source.resume()
34 | }
35 | }
36 |
37 | /// Stops sending notifications if currently enabled
38 | open func stop() {
39 | if state == .on {
40 | state = .off
41 | source.suspend()
42 | }
43 | }
44 |
45 | deinit {
46 | close(descriptor)
47 | source.cancel()
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/SwiftMonitor.xcodeproj/xcuserdata/nash.xcuserdatad/xcschemes/SwiftMonitor.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
77 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
96 |
102 |
103 |
104 |
105 |
107 |
108 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/SwiftMonitor.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | C6C50FA01AA11BE600218EC4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C50F9F1AA11BE600218EC4 /* AppDelegate.swift */; };
11 | C6C50FA21AA11BE600218EC4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C50FA11AA11BE600218EC4 /* ViewController.swift */; };
12 | C6C50FA41AA11BE600218EC4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C6C50FA31AA11BE600218EC4 /* Images.xcassets */; };
13 | C6C50FA71AA11BE600218EC4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C6C50FA51AA11BE600218EC4 /* Main.storyboard */; };
14 | C6C50FB31AA11BE600218EC4 /* SwiftMonitorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C50FB21AA11BE600218EC4 /* SwiftMonitorTests.swift */; };
15 | C6C510121AA12B6800218EC4 /* FolderMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C510111AA12B6800218EC4 /* FolderMonitor.swift */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXContainerItemProxy section */
19 | C6C50FAD1AA11BE600218EC4 /* PBXContainerItemProxy */ = {
20 | isa = PBXContainerItemProxy;
21 | containerPortal = C6C50F921AA11BE600218EC4 /* Project object */;
22 | proxyType = 1;
23 | remoteGlobalIDString = C6C50F991AA11BE600218EC4;
24 | remoteInfo = SwiftMonitor;
25 | };
26 | /* End PBXContainerItemProxy section */
27 |
28 | /* Begin PBXFileReference section */
29 | C6C50F9A1AA11BE600218EC4 /* SwiftMonitor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftMonitor.app; sourceTree = BUILT_PRODUCTS_DIR; };
30 | C6C50F9E1AA11BE600218EC4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
31 | C6C50F9F1AA11BE600218EC4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
32 | C6C50FA11AA11BE600218EC4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
33 | C6C50FA31AA11BE600218EC4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
34 | C6C50FA61AA11BE600218EC4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
35 | C6C50FAC1AA11BE600218EC4 /* SwiftMonitorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftMonitorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
36 | C6C50FB11AA11BE600218EC4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
37 | C6C50FB21AA11BE600218EC4 /* SwiftMonitorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftMonitorTests.swift; sourceTree = ""; };
38 | C6C510111AA12B6800218EC4 /* FolderMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FolderMonitor.swift; sourceTree = SOURCE_ROOT; };
39 | /* End PBXFileReference section */
40 |
41 | /* Begin PBXFrameworksBuildPhase section */
42 | C6C50F971AA11BE600218EC4 /* Frameworks */ = {
43 | isa = PBXFrameworksBuildPhase;
44 | buildActionMask = 2147483647;
45 | files = (
46 | );
47 | runOnlyForDeploymentPostprocessing = 0;
48 | };
49 | C6C50FA91AA11BE600218EC4 /* Frameworks */ = {
50 | isa = PBXFrameworksBuildPhase;
51 | buildActionMask = 2147483647;
52 | files = (
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | /* End PBXFrameworksBuildPhase section */
57 |
58 | /* Begin PBXGroup section */
59 | C6C50F911AA11BE600218EC4 = {
60 | isa = PBXGroup;
61 | children = (
62 | C6C50F9C1AA11BE600218EC4 /* SwiftMonitor */,
63 | C6C50FAF1AA11BE600218EC4 /* SwiftMonitorTests */,
64 | C6C50F9B1AA11BE600218EC4 /* Products */,
65 | );
66 | sourceTree = "";
67 | };
68 | C6C50F9B1AA11BE600218EC4 /* Products */ = {
69 | isa = PBXGroup;
70 | children = (
71 | C6C50F9A1AA11BE600218EC4 /* SwiftMonitor.app */,
72 | C6C50FAC1AA11BE600218EC4 /* SwiftMonitorTests.xctest */,
73 | );
74 | name = Products;
75 | sourceTree = "";
76 | };
77 | C6C50F9C1AA11BE600218EC4 /* SwiftMonitor */ = {
78 | isa = PBXGroup;
79 | children = (
80 | C6C50F9F1AA11BE600218EC4 /* AppDelegate.swift */,
81 | C6C50FA11AA11BE600218EC4 /* ViewController.swift */,
82 | C6C510111AA12B6800218EC4 /* FolderMonitor.swift */,
83 | C6C50FA31AA11BE600218EC4 /* Images.xcassets */,
84 | C6C50FA51AA11BE600218EC4 /* Main.storyboard */,
85 | C6C50F9D1AA11BE600218EC4 /* Supporting Files */,
86 | );
87 | path = SwiftMonitor;
88 | sourceTree = "";
89 | };
90 | C6C50F9D1AA11BE600218EC4 /* Supporting Files */ = {
91 | isa = PBXGroup;
92 | children = (
93 | C6C50F9E1AA11BE600218EC4 /* Info.plist */,
94 | );
95 | name = "Supporting Files";
96 | sourceTree = "";
97 | };
98 | C6C50FAF1AA11BE600218EC4 /* SwiftMonitorTests */ = {
99 | isa = PBXGroup;
100 | children = (
101 | C6C50FB21AA11BE600218EC4 /* SwiftMonitorTests.swift */,
102 | C6C50FB01AA11BE600218EC4 /* Supporting Files */,
103 | );
104 | path = SwiftMonitorTests;
105 | sourceTree = "";
106 | };
107 | C6C50FB01AA11BE600218EC4 /* Supporting Files */ = {
108 | isa = PBXGroup;
109 | children = (
110 | C6C50FB11AA11BE600218EC4 /* Info.plist */,
111 | );
112 | name = "Supporting Files";
113 | sourceTree = "";
114 | };
115 | /* End PBXGroup section */
116 |
117 | /* Begin PBXNativeTarget section */
118 | C6C50F991AA11BE600218EC4 /* SwiftMonitor */ = {
119 | isa = PBXNativeTarget;
120 | buildConfigurationList = C6C50FB61AA11BE600218EC4 /* Build configuration list for PBXNativeTarget "SwiftMonitor" */;
121 | buildPhases = (
122 | C6C50F961AA11BE600218EC4 /* Sources */,
123 | C6C50F971AA11BE600218EC4 /* Frameworks */,
124 | C6C50F981AA11BE600218EC4 /* Resources */,
125 | );
126 | buildRules = (
127 | );
128 | dependencies = (
129 | );
130 | name = SwiftMonitor;
131 | productName = SwiftMonitor;
132 | productReference = C6C50F9A1AA11BE600218EC4 /* SwiftMonitor.app */;
133 | productType = "com.apple.product-type.application";
134 | };
135 | C6C50FAB1AA11BE600218EC4 /* SwiftMonitorTests */ = {
136 | isa = PBXNativeTarget;
137 | buildConfigurationList = C6C50FB91AA11BE600218EC4 /* Build configuration list for PBXNativeTarget "SwiftMonitorTests" */;
138 | buildPhases = (
139 | C6C50FA81AA11BE600218EC4 /* Sources */,
140 | C6C50FA91AA11BE600218EC4 /* Frameworks */,
141 | C6C50FAA1AA11BE600218EC4 /* Resources */,
142 | );
143 | buildRules = (
144 | );
145 | dependencies = (
146 | C6C50FAE1AA11BE600218EC4 /* PBXTargetDependency */,
147 | );
148 | name = SwiftMonitorTests;
149 | productName = SwiftMonitorTests;
150 | productReference = C6C50FAC1AA11BE600218EC4 /* SwiftMonitorTests.xctest */;
151 | productType = "com.apple.product-type.bundle.unit-test";
152 | };
153 | /* End PBXNativeTarget section */
154 |
155 | /* Begin PBXProject section */
156 | C6C50F921AA11BE600218EC4 /* Project object */ = {
157 | isa = PBXProject;
158 | attributes = {
159 | LastUpgradeCheck = 0630;
160 | ORGANIZATIONNAME = "Martin Nash";
161 | TargetAttributes = {
162 | C6C50F991AA11BE600218EC4 = {
163 | CreatedOnToolsVersion = 6.3;
164 | };
165 | C6C50FAB1AA11BE600218EC4 = {
166 | CreatedOnToolsVersion = 6.3;
167 | TestTargetID = C6C50F991AA11BE600218EC4;
168 | };
169 | };
170 | };
171 | buildConfigurationList = C6C50F951AA11BE600218EC4 /* Build configuration list for PBXProject "SwiftMonitor" */;
172 | compatibilityVersion = "Xcode 3.2";
173 | developmentRegion = English;
174 | hasScannedForEncodings = 0;
175 | knownRegions = (
176 | en,
177 | Base,
178 | );
179 | mainGroup = C6C50F911AA11BE600218EC4;
180 | productRefGroup = C6C50F9B1AA11BE600218EC4 /* Products */;
181 | projectDirPath = "";
182 | projectRoot = "";
183 | targets = (
184 | C6C50F991AA11BE600218EC4 /* SwiftMonitor */,
185 | C6C50FAB1AA11BE600218EC4 /* SwiftMonitorTests */,
186 | );
187 | };
188 | /* End PBXProject section */
189 |
190 | /* Begin PBXResourcesBuildPhase section */
191 | C6C50F981AA11BE600218EC4 /* Resources */ = {
192 | isa = PBXResourcesBuildPhase;
193 | buildActionMask = 2147483647;
194 | files = (
195 | C6C50FA41AA11BE600218EC4 /* Images.xcassets in Resources */,
196 | C6C50FA71AA11BE600218EC4 /* Main.storyboard in Resources */,
197 | );
198 | runOnlyForDeploymentPostprocessing = 0;
199 | };
200 | C6C50FAA1AA11BE600218EC4 /* Resources */ = {
201 | isa = PBXResourcesBuildPhase;
202 | buildActionMask = 2147483647;
203 | files = (
204 | );
205 | runOnlyForDeploymentPostprocessing = 0;
206 | };
207 | /* End PBXResourcesBuildPhase section */
208 |
209 | /* Begin PBXSourcesBuildPhase section */
210 | C6C50F961AA11BE600218EC4 /* Sources */ = {
211 | isa = PBXSourcesBuildPhase;
212 | buildActionMask = 2147483647;
213 | files = (
214 | C6C50FA21AA11BE600218EC4 /* ViewController.swift in Sources */,
215 | C6C510121AA12B6800218EC4 /* FolderMonitor.swift in Sources */,
216 | C6C50FA01AA11BE600218EC4 /* AppDelegate.swift in Sources */,
217 | );
218 | runOnlyForDeploymentPostprocessing = 0;
219 | };
220 | C6C50FA81AA11BE600218EC4 /* Sources */ = {
221 | isa = PBXSourcesBuildPhase;
222 | buildActionMask = 2147483647;
223 | files = (
224 | C6C50FB31AA11BE600218EC4 /* SwiftMonitorTests.swift in Sources */,
225 | );
226 | runOnlyForDeploymentPostprocessing = 0;
227 | };
228 | /* End PBXSourcesBuildPhase section */
229 |
230 | /* Begin PBXTargetDependency section */
231 | C6C50FAE1AA11BE600218EC4 /* PBXTargetDependency */ = {
232 | isa = PBXTargetDependency;
233 | target = C6C50F991AA11BE600218EC4 /* SwiftMonitor */;
234 | targetProxy = C6C50FAD1AA11BE600218EC4 /* PBXContainerItemProxy */;
235 | };
236 | /* End PBXTargetDependency section */
237 |
238 | /* Begin PBXVariantGroup section */
239 | C6C50FA51AA11BE600218EC4 /* Main.storyboard */ = {
240 | isa = PBXVariantGroup;
241 | children = (
242 | C6C50FA61AA11BE600218EC4 /* Base */,
243 | );
244 | name = Main.storyboard;
245 | sourceTree = "";
246 | };
247 | /* End PBXVariantGroup section */
248 |
249 | /* Begin XCBuildConfiguration section */
250 | C6C50FB41AA11BE600218EC4 /* Debug */ = {
251 | isa = XCBuildConfiguration;
252 | buildSettings = {
253 | ALWAYS_SEARCH_USER_PATHS = NO;
254 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
255 | CLANG_CXX_LIBRARY = "libc++";
256 | CLANG_ENABLE_MODULES = YES;
257 | CLANG_ENABLE_OBJC_ARC = YES;
258 | CLANG_WARN_BOOL_CONVERSION = YES;
259 | CLANG_WARN_CONSTANT_CONVERSION = YES;
260 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
261 | CLANG_WARN_EMPTY_BODY = YES;
262 | CLANG_WARN_ENUM_CONVERSION = YES;
263 | CLANG_WARN_INT_CONVERSION = YES;
264 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
265 | CLANG_WARN_UNREACHABLE_CODE = YES;
266 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
267 | CODE_SIGN_IDENTITY = "-";
268 | COPY_PHASE_STRIP = NO;
269 | DEBUG_INFORMATION_FORMAT = dwarf;
270 | ENABLE_STRICT_OBJC_MSGSEND = YES;
271 | GCC_C_LANGUAGE_STANDARD = gnu99;
272 | GCC_DYNAMIC_NO_PIC = NO;
273 | GCC_NO_COMMON_BLOCKS = YES;
274 | GCC_OPTIMIZATION_LEVEL = 0;
275 | GCC_PREPROCESSOR_DEFINITIONS = (
276 | "DEBUG=1",
277 | "$(inherited)",
278 | );
279 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
280 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
281 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
282 | GCC_WARN_UNDECLARED_SELECTOR = YES;
283 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
284 | GCC_WARN_UNUSED_FUNCTION = YES;
285 | GCC_WARN_UNUSED_VARIABLE = YES;
286 | MACOSX_DEPLOYMENT_TARGET = 10.10;
287 | MTL_ENABLE_DEBUG_INFO = YES;
288 | ONLY_ACTIVE_ARCH = YES;
289 | SDKROOT = macosx;
290 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
291 | };
292 | name = Debug;
293 | };
294 | C6C50FB51AA11BE600218EC4 /* Release */ = {
295 | isa = XCBuildConfiguration;
296 | buildSettings = {
297 | ALWAYS_SEARCH_USER_PATHS = NO;
298 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
299 | CLANG_CXX_LIBRARY = "libc++";
300 | CLANG_ENABLE_MODULES = YES;
301 | CLANG_ENABLE_OBJC_ARC = YES;
302 | CLANG_WARN_BOOL_CONVERSION = YES;
303 | CLANG_WARN_CONSTANT_CONVERSION = YES;
304 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
305 | CLANG_WARN_EMPTY_BODY = YES;
306 | CLANG_WARN_ENUM_CONVERSION = YES;
307 | CLANG_WARN_INT_CONVERSION = YES;
308 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
309 | CLANG_WARN_UNREACHABLE_CODE = YES;
310 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
311 | CODE_SIGN_IDENTITY = "-";
312 | COPY_PHASE_STRIP = NO;
313 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
314 | ENABLE_NS_ASSERTIONS = NO;
315 | ENABLE_STRICT_OBJC_MSGSEND = YES;
316 | GCC_C_LANGUAGE_STANDARD = gnu99;
317 | GCC_NO_COMMON_BLOCKS = YES;
318 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
319 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
320 | GCC_WARN_UNDECLARED_SELECTOR = YES;
321 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
322 | GCC_WARN_UNUSED_FUNCTION = YES;
323 | GCC_WARN_UNUSED_VARIABLE = YES;
324 | MACOSX_DEPLOYMENT_TARGET = 10.10;
325 | MTL_ENABLE_DEBUG_INFO = NO;
326 | SDKROOT = macosx;
327 | };
328 | name = Release;
329 | };
330 | C6C50FB71AA11BE600218EC4 /* Debug */ = {
331 | isa = XCBuildConfiguration;
332 | buildSettings = {
333 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
334 | COMBINE_HIDPI_IMAGES = YES;
335 | INFOPLIST_FILE = SwiftMonitor/Info.plist;
336 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
337 | PRODUCT_NAME = "$(TARGET_NAME)";
338 | };
339 | name = Debug;
340 | };
341 | C6C50FB81AA11BE600218EC4 /* Release */ = {
342 | isa = XCBuildConfiguration;
343 | buildSettings = {
344 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
345 | COMBINE_HIDPI_IMAGES = YES;
346 | INFOPLIST_FILE = SwiftMonitor/Info.plist;
347 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
348 | PRODUCT_NAME = "$(TARGET_NAME)";
349 | };
350 | name = Release;
351 | };
352 | C6C50FBA1AA11BE600218EC4 /* Debug */ = {
353 | isa = XCBuildConfiguration;
354 | buildSettings = {
355 | BUNDLE_LOADER = "$(TEST_HOST)";
356 | COMBINE_HIDPI_IMAGES = YES;
357 | FRAMEWORK_SEARCH_PATHS = (
358 | "$(DEVELOPER_FRAMEWORKS_DIR)",
359 | "$(inherited)",
360 | );
361 | GCC_PREPROCESSOR_DEFINITIONS = (
362 | "DEBUG=1",
363 | "$(inherited)",
364 | );
365 | INFOPLIST_FILE = SwiftMonitorTests/Info.plist;
366 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
367 | PRODUCT_NAME = "$(TARGET_NAME)";
368 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftMonitor.app/Contents/MacOS/SwiftMonitor";
369 | };
370 | name = Debug;
371 | };
372 | C6C50FBB1AA11BE600218EC4 /* Release */ = {
373 | isa = XCBuildConfiguration;
374 | buildSettings = {
375 | BUNDLE_LOADER = "$(TEST_HOST)";
376 | COMBINE_HIDPI_IMAGES = YES;
377 | FRAMEWORK_SEARCH_PATHS = (
378 | "$(DEVELOPER_FRAMEWORKS_DIR)",
379 | "$(inherited)",
380 | );
381 | INFOPLIST_FILE = SwiftMonitorTests/Info.plist;
382 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
383 | PRODUCT_NAME = "$(TARGET_NAME)";
384 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftMonitor.app/Contents/MacOS/SwiftMonitor";
385 | };
386 | name = Release;
387 | };
388 | /* End XCBuildConfiguration section */
389 |
390 | /* Begin XCConfigurationList section */
391 | C6C50F951AA11BE600218EC4 /* Build configuration list for PBXProject "SwiftMonitor" */ = {
392 | isa = XCConfigurationList;
393 | buildConfigurations = (
394 | C6C50FB41AA11BE600218EC4 /* Debug */,
395 | C6C50FB51AA11BE600218EC4 /* Release */,
396 | );
397 | defaultConfigurationIsVisible = 0;
398 | defaultConfigurationName = Release;
399 | };
400 | C6C50FB61AA11BE600218EC4 /* Build configuration list for PBXNativeTarget "SwiftMonitor" */ = {
401 | isa = XCConfigurationList;
402 | buildConfigurations = (
403 | C6C50FB71AA11BE600218EC4 /* Debug */,
404 | C6C50FB81AA11BE600218EC4 /* Release */,
405 | );
406 | defaultConfigurationIsVisible = 0;
407 | defaultConfigurationName = Release;
408 | };
409 | C6C50FB91AA11BE600218EC4 /* Build configuration list for PBXNativeTarget "SwiftMonitorTests" */ = {
410 | isa = XCConfigurationList;
411 | buildConfigurations = (
412 | C6C50FBA1AA11BE600218EC4 /* Debug */,
413 | C6C50FBB1AA11BE600218EC4 /* Release */,
414 | );
415 | defaultConfigurationIsVisible = 0;
416 | defaultConfigurationName = Release;
417 | };
418 | /* End XCConfigurationList section */
419 | };
420 | rootObject = C6C50F921AA11BE600218EC4 /* Project object */;
421 | }
422 |
--------------------------------------------------------------------------------
/SwiftMonitor/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
685 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
--------------------------------------------------------------------------------