├── Bridge
├── AppDelegate.swift
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Base.lproj
│ └── MainMenu.xib
├── CommunicationClient.swift
├── CommunicationServer.swift
├── Info.plist
├── Message+AttributedString.swift
├── Message.swift
├── Ping.swift
├── PingService.swift
├── Server.swift
└── main.swift
├── ClientDemo
├── AppDelegate.swift
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Base.lproj
│ └── Main.storyboard
├── Info.plist
└── ViewController.swift
├── InterprocessCommunication.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── xcuserdata
│ └── ghansard.xcuserdatad
│ └── xcschemes
│ ├── Bridge.xcscheme
│ ├── ClientDemo.xcscheme
│ ├── InterprocessCommunication.xcscheme
│ └── xcschememanagement.plist
├── InterprocessCommunication
├── AppDelegate.swift
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Base.lproj
│ └── Main.storyboard
├── Client.swift
├── Info.plist
└── ViewController.swift
├── LICENSE
└── README.md
/Bridge/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Bridge
4 | //
5 | // Created by Grayson Hansard on 12/9/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class AppDelegate: NSObject, NSApplicationDelegate {
12 |
13 | @IBOutlet weak var window: NSWindow!
14 |
15 |
16 | func applicationDidFinishLaunching(_ aNotification: Notification) {
17 | // Insert code here to initialize your application
18 | }
19 |
20 | func applicationWillTerminate(_ aNotification: Notification) {
21 | // Insert code here to tear down your application
22 | }
23 |
24 |
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/Bridge/Assets.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 | }
--------------------------------------------------------------------------------
/Bridge/Base.lproj/MainMenu.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
--------------------------------------------------------------------------------
/Bridge/CommunicationClient.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CommunicationClient.swift
3 | // InterprocessCommunication
4 | //
5 | // Created by Grayson Hansard on 12/9/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | @objc protocol CommunicationClient {
12 | func receive(message: Message)
13 | }
14 |
--------------------------------------------------------------------------------
/Bridge/CommunicationServer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CommunicationServer.swift
3 | // InterprocessCommunication
4 | //
5 | // Created by Grayson Hansard on 12/9/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | @objc protocol CommunicationServer {
12 | func register(client: NSXPCListenerEndpoint)
13 | func broadcast(message: Message)
14 | }
15 |
--------------------------------------------------------------------------------
/Bridge/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSBackgroundOnly
24 |
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHumanReadableCopyright
28 | Copyright © 2016 From Concentrate Software. All rights reserved.
29 | NSMainNibFile
30 | MainMenu
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Bridge/Message+AttributedString.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Message+AttributedString.swift
3 | // InterprocessCommunication
4 | //
5 | // Created by Grayson Hansard on 12/10/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | extension Message {
12 | func convertToAttributedString(ownClientName: String) -> NSAttributedString {
13 | let textColor: NSColor
14 | let paragraphStyle: NSMutableParagraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
15 | if self.sender.hasPrefix("_") { // server message
16 | textColor = NSColor.lightGray
17 | paragraphStyle.alignment = NSTextAlignment.center;
18 | }
19 | else if self.sender == ownClientName {
20 | textColor = NSColor.darkGray
21 | }
22 | else {
23 | textColor = NSColor.textColor
24 | paragraphStyle.alignment = NSTextAlignment.right;
25 | }
26 |
27 | let attributes = [
28 | NSAttributedString.Key.paragraphStyle: paragraphStyle,
29 | NSAttributedString.Key.foregroundColor: textColor,
30 | ]
31 | return NSAttributedString(string: self.value + "\n", attributes: attributes)
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Bridge/Message.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Message.swift
3 | // InterprocessCommunication
4 | //
5 | // Created by Grayson Hansard on 12/10/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | @objc(Message) class Message: NSObject, NSSecureCoding {
12 | static var supportsSecureCoding: Bool { return true }
13 |
14 | let sender: String
15 | let value: String
16 |
17 | func encode(with aCoder: NSCoder){
18 | aCoder.encode(sender as NSString, forKey: "sender")
19 | aCoder.encode(value as NSString, forKey:"value")
20 | }
21 |
22 | required init?(coder aDecoder: NSCoder) {
23 | guard
24 | let sender = aDecoder.decodeObject(of: NSString.self, forKey: "sender") as String?,
25 | let value = aDecoder.decodeObject(of: NSString.self, forKey: "value") as String?
26 | else { return nil }
27 |
28 | self.sender = sender
29 | self.value = value
30 | }
31 |
32 | init(sender: String, value: String) {
33 | self.sender = sender
34 | self.value = value
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Bridge/Ping.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Ping.swift
3 | // InterprocessCommunicator
4 | //
5 | // Created by Grayson Hansard on 12/9/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | class Ping: PingService {
10 | func ping(_ pong: () -> ()) {
11 | print("ping")
12 | pong()
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Bridge/PingService.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Ping.swift
3 | // InterprocessCommunicator
4 | //
5 | // Created by Grayson Hansard on 12/9/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | @objc protocol PingService {
12 | func ping(_ pong: () -> ())
13 | }
14 |
--------------------------------------------------------------------------------
/Bridge/Server.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Server.swift
3 | // InterprocessCommunication
4 | //
5 | // Created by Grayson Hansard on 12/9/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | class Server: CommunicationServer {
12 | private var clientConnections = [NSXPCConnection]()
13 |
14 | func register(client endpoint: NSXPCListenerEndpoint) {
15 | let connection = NSXPCConnection(listenerEndpoint: endpoint)
16 | let interface = NSXPCInterface(with: CommunicationClient.self)
17 | interface.setClasses([Message.self as AnyObject as! NSObject], for: #selector(CommunicationClient.receive(message:)), argumentIndex: 0, ofReply: false)
18 | connection.remoteObjectInterface = interface
19 | connection.resume()
20 | if connection.remoteObjectProxy is CommunicationClient {
21 | clientConnections.append(connection)
22 | let message = Message(sender: "_server", value: "Registered \(clientConnections.count) connections")
23 | broadcast(message: message)
24 | }
25 | }
26 |
27 | func broadcast(message: Message) {
28 | clientConnections.forEach {
29 | ($0.remoteObjectProxy as? CommunicationClient)?.receive(message: message)
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Bridge/main.swift:
--------------------------------------------------------------------------------
1 | //
2 | // main.swift
3 | // InterprocessCommunication
4 | //
5 | // Created by Grayson Hansard on 12/9/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | class XPCDelegate: NSObject, NSXPCListenerDelegate {
12 | private let server = Server()
13 |
14 | func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool {
15 | newConnection.exportedInterface = NSXPCInterface(with: CommunicationServer.self)
16 | newConnection.exportedObject = server
17 | newConnection.resume()
18 | return true
19 | }
20 | }
21 |
22 | let delegate = XPCDelegate()
23 | let listener = NSXPCListener(machServiceName: "com.fromconcentratesoftware.Bridge")
24 | listener.delegate = delegate
25 | listener.resume()
26 | RunLoop.current.run()
27 |
--------------------------------------------------------------------------------
/ClientDemo/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // ClientDemo
4 | //
5 | // Created by Grayson Hansard on 12/10/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 | import ServiceManagement
11 |
12 | @NSApplicationMain
13 | class AppDelegate: NSObject, NSApplicationDelegate {
14 |
15 | let xpcConnection = NSXPCConnection(machServiceName: "com.fromconcentratesoftware.Bridge", options: [])
16 | let listener = NSXPCListener.anonymous()
17 | let listenerDelegate: ClientListenerDelegate
18 |
19 | override init() {
20 | let client = Client()
21 | listenerDelegate = ClientListenerDelegate(client: client)
22 | listener.delegate = listenerDelegate
23 | }
24 |
25 | func applicationDidFinishLaunching(_ aNotification: Notification) {
26 | listener.resume()
27 |
28 | xpcConnection.remoteObjectInterface = NSXPCInterface(with: CommunicationServer.self)
29 | xpcConnection.resume()
30 | (xpcConnection.remoteObjectProxy as? CommunicationServer)?.register(client: listener.endpoint)
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/ClientDemo/Assets.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 | }
--------------------------------------------------------------------------------
/ClientDemo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 | Default
511 |
512 |
513 |
514 |
515 |
516 |
517 | Left to Right
518 |
519 |
520 |
521 |
522 |
523 |
524 | Right to Left
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 | Default
536 |
537 |
538 |
539 |
540 |
541 |
542 | Left to Right
543 |
544 |
545 |
546 |
547 |
548 |
549 | Right to Left
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
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 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
--------------------------------------------------------------------------------
/ClientDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | Copyright © 2016 From Concentrate Software. All rights reserved.
27 | NSMainStoryboardFile
28 | Main
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/ClientDemo/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // ClientDemo
4 | //
5 | // Created by Grayson Hansard on 12/10/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class ViewController: NSViewController {
12 |
13 | @IBOutlet weak var textView: NSTextView?
14 | @IBOutlet weak var textField: NSTextField?
15 |
16 | private var server: CommunicationServer { return (NSApp.delegate as! AppDelegate).xpcConnection.remoteObjectProxy as! CommunicationServer }
17 | private lazy var name: String = { return ProcessInfo().processName }()
18 |
19 | override func viewDidLoad() {
20 | super.viewDidLoad()
21 |
22 | let ownClientName = name
23 | (NSApp.delegate as! AppDelegate).listenerDelegate.client.onMessageReceived = { [textView] msg in
24 | let attributedString = msg.convertToAttributedString(ownClientName: ownClientName)
25 |
26 | DispatchQueue.main.async {
27 | textView?.textStorage?.append(attributedString)
28 | textView?.scrollToEndOfDocument(nil)
29 | }
30 | }
31 | }
32 |
33 | @IBAction func send(_ sender: Any) {
34 | guard let msg = textField?.stringValue else { return }
35 | server.broadcast(message: Message(sender: name, value: msg))
36 | }
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/InterprocessCommunication.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1D7D37E01DFAE4F600970074 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D37DF1DFAE4F600970074 /* AppDelegate.swift */; };
11 | 1D7D37E21DFAE4F600970074 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D37E11DFAE4F600970074 /* ViewController.swift */; };
12 | 1D7D37E41DFAE4F600970074 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1D7D37E31DFAE4F600970074 /* Assets.xcassets */; };
13 | 1D7D37E71DFAE4F600970074 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1D7D37E51DFAE4F600970074 /* Main.storyboard */; };
14 | 1D7D37F51DFAE53B00970074 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D37F41DFAE53B00970074 /* AppDelegate.swift */; };
15 | 1D7D37F71DFAE53B00970074 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1D7D37F61DFAE53B00970074 /* Assets.xcassets */; };
16 | 1D7D37FA1DFAE53B00970074 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1D7D37F81DFAE53B00970074 /* MainMenu.xib */; };
17 | 1D7D38001DFAE63900970074 /* Bridge.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1D7D37F21DFAE53B00970074 /* Bridge.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
18 | 1D7D38021DFAE73000970074 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38011DFAE73000970074 /* main.swift */; };
19 | 1D7D380B1DFAE92D00970074 /* Ping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38091DFAE92D00970074 /* Ping.swift */; };
20 | 1D7D380C1DFAE92D00970074 /* PingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D380A1DFAE92D00970074 /* PingService.swift */; };
21 | 1D7D380D1DFAE93000970074 /* PingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D380A1DFAE92D00970074 /* PingService.swift */; };
22 | 1D7D380F1DFAF0AF00970074 /* CommunicationServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D380E1DFAF0AF00970074 /* CommunicationServer.swift */; };
23 | 1D7D38111DFAF0BD00970074 /* CommunicationClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38101DFAF0BD00970074 /* CommunicationClient.swift */; };
24 | 1D7D38131DFAF11200970074 /* Server.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38121DFAF11200970074 /* Server.swift */; };
25 | 1D7D38141DFAF11700970074 /* CommunicationServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D380E1DFAF0AF00970074 /* CommunicationServer.swift */; };
26 | 1D7D38151DFAF11700970074 /* CommunicationClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38101DFAF0BD00970074 /* CommunicationClient.swift */; };
27 | 1D7D38171DFAF34700970074 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38161DFAF34700970074 /* Client.swift */; };
28 | 1D7D381F1DFC2AC600970074 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D381E1DFC2AC600970074 /* AppDelegate.swift */; };
29 | 1D7D38211DFC2AC600970074 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38201DFC2AC600970074 /* ViewController.swift */; };
30 | 1D7D38231DFC2AC600970074 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1D7D38221DFC2AC600970074 /* Assets.xcassets */; };
31 | 1D7D38261DFC2AC700970074 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1D7D38241DFC2AC700970074 /* Main.storyboard */; };
32 | 1D7D382B1DFC2AE900970074 /* CommunicationClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38101DFAF0BD00970074 /* CommunicationClient.swift */; };
33 | 1D7D382C1DFC2AF100970074 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38161DFAF34700970074 /* Client.swift */; };
34 | 1D7D382D1DFC2B2900970074 /* CommunicationServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D380E1DFAF0AF00970074 /* CommunicationServer.swift */; };
35 | 1D7D382F1DFC6BF300970074 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D382E1DFC6BF300970074 /* Message.swift */; };
36 | 1D7D38301DFC75BD00970074 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D382E1DFC6BF300970074 /* Message.swift */; };
37 | 1D7D38311DFC75BE00970074 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D382E1DFC6BF300970074 /* Message.swift */; };
38 | 1D7D38341DFC7ABE00970074 /* Message+AttributedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38321DFC7AAB00970074 /* Message+AttributedString.swift */; };
39 | 1D7D38351DFC7ABF00970074 /* Message+AttributedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7D38321DFC7AAB00970074 /* Message+AttributedString.swift */; };
40 | /* End PBXBuildFile section */
41 |
42 | /* Begin PBXCopyFilesBuildPhase section */
43 | 1D7D37FF1DFAE61300970074 /* CopyFiles */ = {
44 | isa = PBXCopyFilesBuildPhase;
45 | buildActionMask = 2147483647;
46 | dstPath = Contents/Library/LoginItems;
47 | dstSubfolderSpec = 1;
48 | files = (
49 | 1D7D38001DFAE63900970074 /* Bridge.app in CopyFiles */,
50 | );
51 | runOnlyForDeploymentPostprocessing = 0;
52 | };
53 | /* End PBXCopyFilesBuildPhase section */
54 |
55 | /* Begin PBXFileReference section */
56 | 1D7D37DC1DFAE4F600970074 /* InterprocessCommunication.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = InterprocessCommunication.app; sourceTree = BUILT_PRODUCTS_DIR; };
57 | 1D7D37DF1DFAE4F600970074 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
58 | 1D7D37E11DFAE4F600970074 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
59 | 1D7D37E31DFAE4F600970074 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
60 | 1D7D37E61DFAE4F600970074 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
61 | 1D7D37E81DFAE4F600970074 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
62 | 1D7D37F21DFAE53B00970074 /* Bridge.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Bridge.app; sourceTree = BUILT_PRODUCTS_DIR; };
63 | 1D7D37F41DFAE53B00970074 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
64 | 1D7D37F61DFAE53B00970074 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
65 | 1D7D37F91DFAE53B00970074 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
66 | 1D7D37FB1DFAE53B00970074 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
67 | 1D7D38011DFAE73000970074 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; };
68 | 1D7D38091DFAE92D00970074 /* Ping.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Ping.swift; sourceTree = ""; };
69 | 1D7D380A1DFAE92D00970074 /* PingService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PingService.swift; sourceTree = ""; };
70 | 1D7D380E1DFAF0AF00970074 /* CommunicationServer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommunicationServer.swift; sourceTree = ""; };
71 | 1D7D38101DFAF0BD00970074 /* CommunicationClient.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommunicationClient.swift; sourceTree = ""; };
72 | 1D7D38121DFAF11200970074 /* Server.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Server.swift; sourceTree = ""; };
73 | 1D7D38161DFAF34700970074 /* Client.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; };
74 | 1D7D381C1DFC2AC600970074 /* ClientDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ClientDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
75 | 1D7D381E1DFC2AC600970074 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
76 | 1D7D38201DFC2AC600970074 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
77 | 1D7D38221DFC2AC600970074 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
78 | 1D7D38251DFC2AC700970074 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
79 | 1D7D38271DFC2AC700970074 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
80 | 1D7D382E1DFC6BF300970074 /* Message.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = ""; };
81 | 1D7D38321DFC7AAB00970074 /* Message+AttributedString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Message+AttributedString.swift"; sourceTree = ""; };
82 | /* End PBXFileReference section */
83 |
84 | /* Begin PBXFrameworksBuildPhase section */
85 | 1D7D37D91DFAE4F600970074 /* Frameworks */ = {
86 | isa = PBXFrameworksBuildPhase;
87 | buildActionMask = 2147483647;
88 | files = (
89 | );
90 | runOnlyForDeploymentPostprocessing = 0;
91 | };
92 | 1D7D37EF1DFAE53B00970074 /* Frameworks */ = {
93 | isa = PBXFrameworksBuildPhase;
94 | buildActionMask = 2147483647;
95 | files = (
96 | );
97 | runOnlyForDeploymentPostprocessing = 0;
98 | };
99 | 1D7D38191DFC2AC600970074 /* Frameworks */ = {
100 | isa = PBXFrameworksBuildPhase;
101 | buildActionMask = 2147483647;
102 | files = (
103 | );
104 | runOnlyForDeploymentPostprocessing = 0;
105 | };
106 | /* End PBXFrameworksBuildPhase section */
107 |
108 | /* Begin PBXGroup section */
109 | 1D7D37D31DFAE4F600970074 = {
110 | isa = PBXGroup;
111 | children = (
112 | 1D7D37DE1DFAE4F600970074 /* InterprocessCommunication */,
113 | 1D7D37F31DFAE53B00970074 /* Bridge */,
114 | 1D7D381D1DFC2AC600970074 /* ClientDemo */,
115 | 1D7D37DD1DFAE4F600970074 /* Products */,
116 | );
117 | sourceTree = "";
118 | };
119 | 1D7D37DD1DFAE4F600970074 /* Products */ = {
120 | isa = PBXGroup;
121 | children = (
122 | 1D7D37DC1DFAE4F600970074 /* InterprocessCommunication.app */,
123 | 1D7D37F21DFAE53B00970074 /* Bridge.app */,
124 | 1D7D381C1DFC2AC600970074 /* ClientDemo.app */,
125 | );
126 | name = Products;
127 | sourceTree = "";
128 | };
129 | 1D7D37DE1DFAE4F600970074 /* InterprocessCommunication */ = {
130 | isa = PBXGroup;
131 | children = (
132 | 1D7D37DF1DFAE4F600970074 /* AppDelegate.swift */,
133 | 1D7D37E11DFAE4F600970074 /* ViewController.swift */,
134 | 1D7D37E31DFAE4F600970074 /* Assets.xcassets */,
135 | 1D7D37E51DFAE4F600970074 /* Main.storyboard */,
136 | 1D7D37E81DFAE4F600970074 /* Info.plist */,
137 | 1D7D38161DFAF34700970074 /* Client.swift */,
138 | );
139 | path = InterprocessCommunication;
140 | sourceTree = "";
141 | };
142 | 1D7D37F31DFAE53B00970074 /* Bridge */ = {
143 | isa = PBXGroup;
144 | children = (
145 | 1D7D38091DFAE92D00970074 /* Ping.swift */,
146 | 1D7D380A1DFAE92D00970074 /* PingService.swift */,
147 | 1D7D37F41DFAE53B00970074 /* AppDelegate.swift */,
148 | 1D7D37F61DFAE53B00970074 /* Assets.xcassets */,
149 | 1D7D37F81DFAE53B00970074 /* MainMenu.xib */,
150 | 1D7D37FB1DFAE53B00970074 /* Info.plist */,
151 | 1D7D38011DFAE73000970074 /* main.swift */,
152 | 1D7D380E1DFAF0AF00970074 /* CommunicationServer.swift */,
153 | 1D7D38101DFAF0BD00970074 /* CommunicationClient.swift */,
154 | 1D7D38121DFAF11200970074 /* Server.swift */,
155 | 1D7D382E1DFC6BF300970074 /* Message.swift */,
156 | 1D7D38321DFC7AAB00970074 /* Message+AttributedString.swift */,
157 | );
158 | path = Bridge;
159 | sourceTree = "";
160 | };
161 | 1D7D381D1DFC2AC600970074 /* ClientDemo */ = {
162 | isa = PBXGroup;
163 | children = (
164 | 1D7D381E1DFC2AC600970074 /* AppDelegate.swift */,
165 | 1D7D38201DFC2AC600970074 /* ViewController.swift */,
166 | 1D7D38221DFC2AC600970074 /* Assets.xcassets */,
167 | 1D7D38241DFC2AC700970074 /* Main.storyboard */,
168 | 1D7D38271DFC2AC700970074 /* Info.plist */,
169 | );
170 | path = ClientDemo;
171 | sourceTree = "";
172 | };
173 | /* End PBXGroup section */
174 |
175 | /* Begin PBXNativeTarget section */
176 | 1D7D37DB1DFAE4F600970074 /* InterprocessCommunication */ = {
177 | isa = PBXNativeTarget;
178 | buildConfigurationList = 1D7D37EB1DFAE4F600970074 /* Build configuration list for PBXNativeTarget "InterprocessCommunication" */;
179 | buildPhases = (
180 | 1D7D37D81DFAE4F600970074 /* Sources */,
181 | 1D7D37D91DFAE4F600970074 /* Frameworks */,
182 | 1D7D37DA1DFAE4F600970074 /* Resources */,
183 | 1D7D37FF1DFAE61300970074 /* CopyFiles */,
184 | );
185 | buildRules = (
186 | );
187 | dependencies = (
188 | );
189 | name = InterprocessCommunication;
190 | productName = InterprocessCommunication;
191 | productReference = 1D7D37DC1DFAE4F600970074 /* InterprocessCommunication.app */;
192 | productType = "com.apple.product-type.application";
193 | };
194 | 1D7D37F11DFAE53B00970074 /* Bridge */ = {
195 | isa = PBXNativeTarget;
196 | buildConfigurationList = 1D7D37FC1DFAE53B00970074 /* Build configuration list for PBXNativeTarget "Bridge" */;
197 | buildPhases = (
198 | 1D7D37EE1DFAE53B00970074 /* Sources */,
199 | 1D7D37EF1DFAE53B00970074 /* Frameworks */,
200 | 1D7D37F01DFAE53B00970074 /* Resources */,
201 | );
202 | buildRules = (
203 | );
204 | dependencies = (
205 | );
206 | name = Bridge;
207 | productName = Bridge;
208 | productReference = 1D7D37F21DFAE53B00970074 /* Bridge.app */;
209 | productType = "com.apple.product-type.application";
210 | };
211 | 1D7D381B1DFC2AC600970074 /* ClientDemo */ = {
212 | isa = PBXNativeTarget;
213 | buildConfigurationList = 1D7D38281DFC2AC700970074 /* Build configuration list for PBXNativeTarget "ClientDemo" */;
214 | buildPhases = (
215 | 1D7D38181DFC2AC600970074 /* Sources */,
216 | 1D7D38191DFC2AC600970074 /* Frameworks */,
217 | 1D7D381A1DFC2AC600970074 /* Resources */,
218 | );
219 | buildRules = (
220 | );
221 | dependencies = (
222 | );
223 | name = ClientDemo;
224 | productName = ClientDemo;
225 | productReference = 1D7D381C1DFC2AC600970074 /* ClientDemo.app */;
226 | productType = "com.apple.product-type.application";
227 | };
228 | /* End PBXNativeTarget section */
229 |
230 | /* Begin PBXProject section */
231 | 1D7D37D41DFAE4F600970074 /* Project object */ = {
232 | isa = PBXProject;
233 | attributes = {
234 | LastSwiftUpdateCheck = 0810;
235 | LastUpgradeCheck = 1000;
236 | ORGANIZATIONNAME = "From Concentrate Software";
237 | TargetAttributes = {
238 | 1D7D37DB1DFAE4F600970074 = {
239 | CreatedOnToolsVersion = 8.1;
240 | DevelopmentTeam = S8Z8N96C99;
241 | ProvisioningStyle = Automatic;
242 | };
243 | 1D7D37F11DFAE53B00970074 = {
244 | CreatedOnToolsVersion = 8.1;
245 | DevelopmentTeam = S8Z8N96C99;
246 | ProvisioningStyle = Automatic;
247 | };
248 | 1D7D381B1DFC2AC600970074 = {
249 | CreatedOnToolsVersion = 8.1;
250 | DevelopmentTeam = S8Z8N96C99;
251 | LastSwiftMigration = 1000;
252 | ProvisioningStyle = Automatic;
253 | };
254 | };
255 | };
256 | buildConfigurationList = 1D7D37D71DFAE4F600970074 /* Build configuration list for PBXProject "InterprocessCommunication" */;
257 | compatibilityVersion = "Xcode 3.2";
258 | developmentRegion = English;
259 | hasScannedForEncodings = 0;
260 | knownRegions = (
261 | en,
262 | Base,
263 | );
264 | mainGroup = 1D7D37D31DFAE4F600970074;
265 | productRefGroup = 1D7D37DD1DFAE4F600970074 /* Products */;
266 | projectDirPath = "";
267 | projectRoot = "";
268 | targets = (
269 | 1D7D37DB1DFAE4F600970074 /* InterprocessCommunication */,
270 | 1D7D37F11DFAE53B00970074 /* Bridge */,
271 | 1D7D381B1DFC2AC600970074 /* ClientDemo */,
272 | );
273 | };
274 | /* End PBXProject section */
275 |
276 | /* Begin PBXResourcesBuildPhase section */
277 | 1D7D37DA1DFAE4F600970074 /* Resources */ = {
278 | isa = PBXResourcesBuildPhase;
279 | buildActionMask = 2147483647;
280 | files = (
281 | 1D7D37E41DFAE4F600970074 /* Assets.xcassets in Resources */,
282 | 1D7D37E71DFAE4F600970074 /* Main.storyboard in Resources */,
283 | );
284 | runOnlyForDeploymentPostprocessing = 0;
285 | };
286 | 1D7D37F01DFAE53B00970074 /* Resources */ = {
287 | isa = PBXResourcesBuildPhase;
288 | buildActionMask = 2147483647;
289 | files = (
290 | 1D7D37F71DFAE53B00970074 /* Assets.xcassets in Resources */,
291 | 1D7D37FA1DFAE53B00970074 /* MainMenu.xib in Resources */,
292 | );
293 | runOnlyForDeploymentPostprocessing = 0;
294 | };
295 | 1D7D381A1DFC2AC600970074 /* Resources */ = {
296 | isa = PBXResourcesBuildPhase;
297 | buildActionMask = 2147483647;
298 | files = (
299 | 1D7D38231DFC2AC600970074 /* Assets.xcassets in Resources */,
300 | 1D7D38261DFC2AC700970074 /* Main.storyboard in Resources */,
301 | );
302 | runOnlyForDeploymentPostprocessing = 0;
303 | };
304 | /* End PBXResourcesBuildPhase section */
305 |
306 | /* Begin PBXSourcesBuildPhase section */
307 | 1D7D37D81DFAE4F600970074 /* Sources */ = {
308 | isa = PBXSourcesBuildPhase;
309 | buildActionMask = 2147483647;
310 | files = (
311 | 1D7D38341DFC7ABE00970074 /* Message+AttributedString.swift in Sources */,
312 | 1D7D37E21DFAE4F600970074 /* ViewController.swift in Sources */,
313 | 1D7D38141DFAF11700970074 /* CommunicationServer.swift in Sources */,
314 | 1D7D38171DFAF34700970074 /* Client.swift in Sources */,
315 | 1D7D37E01DFAE4F600970074 /* AppDelegate.swift in Sources */,
316 | 1D7D38151DFAF11700970074 /* CommunicationClient.swift in Sources */,
317 | 1D7D380D1DFAE93000970074 /* PingService.swift in Sources */,
318 | 1D7D38311DFC75BE00970074 /* Message.swift in Sources */,
319 | );
320 | runOnlyForDeploymentPostprocessing = 0;
321 | };
322 | 1D7D37EE1DFAE53B00970074 /* Sources */ = {
323 | isa = PBXSourcesBuildPhase;
324 | buildActionMask = 2147483647;
325 | files = (
326 | 1D7D38131DFAF11200970074 /* Server.swift in Sources */,
327 | 1D7D380B1DFAE92D00970074 /* Ping.swift in Sources */,
328 | 1D7D38111DFAF0BD00970074 /* CommunicationClient.swift in Sources */,
329 | 1D7D38021DFAE73000970074 /* main.swift in Sources */,
330 | 1D7D37F51DFAE53B00970074 /* AppDelegate.swift in Sources */,
331 | 1D7D382F1DFC6BF300970074 /* Message.swift in Sources */,
332 | 1D7D380C1DFAE92D00970074 /* PingService.swift in Sources */,
333 | 1D7D380F1DFAF0AF00970074 /* CommunicationServer.swift in Sources */,
334 | );
335 | runOnlyForDeploymentPostprocessing = 0;
336 | };
337 | 1D7D38181DFC2AC600970074 /* Sources */ = {
338 | isa = PBXSourcesBuildPhase;
339 | buildActionMask = 2147483647;
340 | files = (
341 | 1D7D38351DFC7ABF00970074 /* Message+AttributedString.swift in Sources */,
342 | 1D7D38211DFC2AC600970074 /* ViewController.swift in Sources */,
343 | 1D7D382B1DFC2AE900970074 /* CommunicationClient.swift in Sources */,
344 | 1D7D382C1DFC2AF100970074 /* Client.swift in Sources */,
345 | 1D7D38301DFC75BD00970074 /* Message.swift in Sources */,
346 | 1D7D381F1DFC2AC600970074 /* AppDelegate.swift in Sources */,
347 | 1D7D382D1DFC2B2900970074 /* CommunicationServer.swift in Sources */,
348 | );
349 | runOnlyForDeploymentPostprocessing = 0;
350 | };
351 | /* End PBXSourcesBuildPhase section */
352 |
353 | /* Begin PBXVariantGroup section */
354 | 1D7D37E51DFAE4F600970074 /* Main.storyboard */ = {
355 | isa = PBXVariantGroup;
356 | children = (
357 | 1D7D37E61DFAE4F600970074 /* Base */,
358 | );
359 | name = Main.storyboard;
360 | sourceTree = "";
361 | };
362 | 1D7D37F81DFAE53B00970074 /* MainMenu.xib */ = {
363 | isa = PBXVariantGroup;
364 | children = (
365 | 1D7D37F91DFAE53B00970074 /* Base */,
366 | );
367 | name = MainMenu.xib;
368 | sourceTree = "";
369 | };
370 | 1D7D38241DFC2AC700970074 /* Main.storyboard */ = {
371 | isa = PBXVariantGroup;
372 | children = (
373 | 1D7D38251DFC2AC700970074 /* Base */,
374 | );
375 | name = Main.storyboard;
376 | sourceTree = "";
377 | };
378 | /* End PBXVariantGroup section */
379 |
380 | /* Begin XCBuildConfiguration section */
381 | 1D7D37E91DFAE4F600970074 /* Debug */ = {
382 | isa = XCBuildConfiguration;
383 | buildSettings = {
384 | ALWAYS_SEARCH_USER_PATHS = NO;
385 | CLANG_ANALYZER_NONNULL = YES;
386 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
387 | CLANG_CXX_LIBRARY = "libc++";
388 | CLANG_ENABLE_MODULES = YES;
389 | CLANG_ENABLE_OBJC_ARC = YES;
390 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
391 | CLANG_WARN_BOOL_CONVERSION = YES;
392 | CLANG_WARN_COMMA = YES;
393 | CLANG_WARN_CONSTANT_CONVERSION = YES;
394 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
395 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
396 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
397 | CLANG_WARN_EMPTY_BODY = YES;
398 | CLANG_WARN_ENUM_CONVERSION = YES;
399 | CLANG_WARN_INFINITE_RECURSION = YES;
400 | CLANG_WARN_INT_CONVERSION = YES;
401 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
402 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
403 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
404 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
405 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
406 | CLANG_WARN_STRICT_PROTOTYPES = YES;
407 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
408 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
409 | CLANG_WARN_UNREACHABLE_CODE = YES;
410 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
411 | CODE_SIGN_IDENTITY = "-";
412 | COPY_PHASE_STRIP = NO;
413 | DEBUG_INFORMATION_FORMAT = dwarf;
414 | ENABLE_STRICT_OBJC_MSGSEND = YES;
415 | ENABLE_TESTABILITY = YES;
416 | GCC_C_LANGUAGE_STANDARD = gnu99;
417 | GCC_DYNAMIC_NO_PIC = NO;
418 | GCC_NO_COMMON_BLOCKS = YES;
419 | GCC_OPTIMIZATION_LEVEL = 0;
420 | GCC_PREPROCESSOR_DEFINITIONS = (
421 | "DEBUG=1",
422 | "$(inherited)",
423 | );
424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
426 | GCC_WARN_UNDECLARED_SELECTOR = YES;
427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
428 | GCC_WARN_UNUSED_FUNCTION = YES;
429 | GCC_WARN_UNUSED_VARIABLE = YES;
430 | MACOSX_DEPLOYMENT_TARGET = 10.12;
431 | MTL_ENABLE_DEBUG_INFO = YES;
432 | ONLY_ACTIVE_ARCH = YES;
433 | SDKROOT = macosx;
434 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
435 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
436 | };
437 | name = Debug;
438 | };
439 | 1D7D37EA1DFAE4F600970074 /* Release */ = {
440 | isa = XCBuildConfiguration;
441 | buildSettings = {
442 | ALWAYS_SEARCH_USER_PATHS = NO;
443 | CLANG_ANALYZER_NONNULL = YES;
444 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
445 | CLANG_CXX_LIBRARY = "libc++";
446 | CLANG_ENABLE_MODULES = YES;
447 | CLANG_ENABLE_OBJC_ARC = YES;
448 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
449 | CLANG_WARN_BOOL_CONVERSION = YES;
450 | CLANG_WARN_COMMA = YES;
451 | CLANG_WARN_CONSTANT_CONVERSION = YES;
452 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
453 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
454 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
455 | CLANG_WARN_EMPTY_BODY = YES;
456 | CLANG_WARN_ENUM_CONVERSION = YES;
457 | CLANG_WARN_INFINITE_RECURSION = YES;
458 | CLANG_WARN_INT_CONVERSION = YES;
459 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
460 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
461 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
462 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
463 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
464 | CLANG_WARN_STRICT_PROTOTYPES = YES;
465 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
466 | CLANG_WARN_SUSPICIOUS_MOVES = YES;
467 | CLANG_WARN_UNREACHABLE_CODE = YES;
468 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
469 | CODE_SIGN_IDENTITY = "-";
470 | COPY_PHASE_STRIP = NO;
471 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
472 | ENABLE_NS_ASSERTIONS = NO;
473 | ENABLE_STRICT_OBJC_MSGSEND = YES;
474 | GCC_C_LANGUAGE_STANDARD = gnu99;
475 | GCC_NO_COMMON_BLOCKS = YES;
476 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
477 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
478 | GCC_WARN_UNDECLARED_SELECTOR = YES;
479 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
480 | GCC_WARN_UNUSED_FUNCTION = YES;
481 | GCC_WARN_UNUSED_VARIABLE = YES;
482 | MACOSX_DEPLOYMENT_TARGET = 10.12;
483 | MTL_ENABLE_DEBUG_INFO = NO;
484 | SDKROOT = macosx;
485 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
486 | };
487 | name = Release;
488 | };
489 | 1D7D37EC1DFAE4F600970074 /* Debug */ = {
490 | isa = XCBuildConfiguration;
491 | buildSettings = {
492 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
493 | COMBINE_HIDPI_IMAGES = YES;
494 | DEVELOPMENT_TEAM = S8Z8N96C99;
495 | INFOPLIST_FILE = InterprocessCommunication/Info.plist;
496 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
497 | PRODUCT_BUNDLE_IDENTIFIER = com.fromconcentratesoftware.InterprocessCommunication;
498 | PRODUCT_NAME = "$(TARGET_NAME)";
499 | SWIFT_VERSION = 4.2;
500 | };
501 | name = Debug;
502 | };
503 | 1D7D37ED1DFAE4F600970074 /* Release */ = {
504 | isa = XCBuildConfiguration;
505 | buildSettings = {
506 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
507 | COMBINE_HIDPI_IMAGES = YES;
508 | DEVELOPMENT_TEAM = S8Z8N96C99;
509 | INFOPLIST_FILE = InterprocessCommunication/Info.plist;
510 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
511 | PRODUCT_BUNDLE_IDENTIFIER = com.fromconcentratesoftware.InterprocessCommunication;
512 | PRODUCT_NAME = "$(TARGET_NAME)";
513 | SWIFT_VERSION = 4.2;
514 | };
515 | name = Release;
516 | };
517 | 1D7D37FD1DFAE53B00970074 /* Debug */ = {
518 | isa = XCBuildConfiguration;
519 | buildSettings = {
520 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
521 | COMBINE_HIDPI_IMAGES = YES;
522 | DEVELOPMENT_TEAM = S8Z8N96C99;
523 | INFOPLIST_FILE = Bridge/Info.plist;
524 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
525 | PRODUCT_BUNDLE_IDENTIFIER = com.fromconcentratesoftware.Bridge;
526 | PRODUCT_NAME = "$(TARGET_NAME)";
527 | SWIFT_VERSION = 4.2;
528 | };
529 | name = Debug;
530 | };
531 | 1D7D37FE1DFAE53B00970074 /* Release */ = {
532 | isa = XCBuildConfiguration;
533 | buildSettings = {
534 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
535 | COMBINE_HIDPI_IMAGES = YES;
536 | DEVELOPMENT_TEAM = S8Z8N96C99;
537 | INFOPLIST_FILE = Bridge/Info.plist;
538 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
539 | PRODUCT_BUNDLE_IDENTIFIER = com.fromconcentratesoftware.Bridge;
540 | PRODUCT_NAME = "$(TARGET_NAME)";
541 | SWIFT_VERSION = 4.2;
542 | };
543 | name = Release;
544 | };
545 | 1D7D38291DFC2AC700970074 /* Debug */ = {
546 | isa = XCBuildConfiguration;
547 | buildSettings = {
548 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
549 | COMBINE_HIDPI_IMAGES = YES;
550 | DEVELOPMENT_TEAM = S8Z8N96C99;
551 | INFOPLIST_FILE = ClientDemo/Info.plist;
552 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
553 | PRODUCT_BUNDLE_IDENTIFIER = com.fromconcentratesoftware.ClientDemo;
554 | PRODUCT_NAME = "$(TARGET_NAME)";
555 | SWIFT_SWIFT3_OBJC_INFERENCE = Default;
556 | SWIFT_VERSION = 4.2;
557 | };
558 | name = Debug;
559 | };
560 | 1D7D382A1DFC2AC700970074 /* Release */ = {
561 | isa = XCBuildConfiguration;
562 | buildSettings = {
563 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
564 | COMBINE_HIDPI_IMAGES = YES;
565 | DEVELOPMENT_TEAM = S8Z8N96C99;
566 | INFOPLIST_FILE = ClientDemo/Info.plist;
567 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
568 | PRODUCT_BUNDLE_IDENTIFIER = com.fromconcentratesoftware.ClientDemo;
569 | PRODUCT_NAME = "$(TARGET_NAME)";
570 | SWIFT_SWIFT3_OBJC_INFERENCE = Default;
571 | SWIFT_VERSION = 4.2;
572 | };
573 | name = Release;
574 | };
575 | /* End XCBuildConfiguration section */
576 |
577 | /* Begin XCConfigurationList section */
578 | 1D7D37D71DFAE4F600970074 /* Build configuration list for PBXProject "InterprocessCommunication" */ = {
579 | isa = XCConfigurationList;
580 | buildConfigurations = (
581 | 1D7D37E91DFAE4F600970074 /* Debug */,
582 | 1D7D37EA1DFAE4F600970074 /* Release */,
583 | );
584 | defaultConfigurationIsVisible = 0;
585 | defaultConfigurationName = Release;
586 | };
587 | 1D7D37EB1DFAE4F600970074 /* Build configuration list for PBXNativeTarget "InterprocessCommunication" */ = {
588 | isa = XCConfigurationList;
589 | buildConfigurations = (
590 | 1D7D37EC1DFAE4F600970074 /* Debug */,
591 | 1D7D37ED1DFAE4F600970074 /* Release */,
592 | );
593 | defaultConfigurationIsVisible = 0;
594 | defaultConfigurationName = Release;
595 | };
596 | 1D7D37FC1DFAE53B00970074 /* Build configuration list for PBXNativeTarget "Bridge" */ = {
597 | isa = XCConfigurationList;
598 | buildConfigurations = (
599 | 1D7D37FD1DFAE53B00970074 /* Debug */,
600 | 1D7D37FE1DFAE53B00970074 /* Release */,
601 | );
602 | defaultConfigurationIsVisible = 0;
603 | defaultConfigurationName = Release;
604 | };
605 | 1D7D38281DFC2AC700970074 /* Build configuration list for PBXNativeTarget "ClientDemo" */ = {
606 | isa = XCConfigurationList;
607 | buildConfigurations = (
608 | 1D7D38291DFC2AC700970074 /* Debug */,
609 | 1D7D382A1DFC2AC700970074 /* Release */,
610 | );
611 | defaultConfigurationIsVisible = 0;
612 | defaultConfigurationName = Release;
613 | };
614 | /* End XCConfigurationList section */
615 | };
616 | rootObject = 1D7D37D41DFAE4F600970074 /* Project object */;
617 | }
618 |
--------------------------------------------------------------------------------
/InterprocessCommunication.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/InterprocessCommunication.xcodeproj/xcuserdata/ghansard.xcuserdatad/xcschemes/Bridge.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/InterprocessCommunication.xcodeproj/xcuserdata/ghansard.xcuserdatad/xcschemes/ClientDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/InterprocessCommunication.xcodeproj/xcuserdata/ghansard.xcuserdatad/xcschemes/InterprocessCommunication.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
46 |
47 |
53 |
54 |
55 |
56 |
57 |
58 |
68 |
70 |
76 |
77 |
78 |
79 |
80 |
81 |
87 |
89 |
95 |
96 |
97 |
98 |
100 |
101 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/InterprocessCommunication.xcodeproj/xcuserdata/ghansard.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Bridge.xcscheme
8 |
9 | orderHint
10 | 1
11 |
12 | ClientDemo.xcscheme
13 |
14 | orderHint
15 | 2
16 |
17 | InterprocessCommunication.xcscheme
18 |
19 | orderHint
20 | 0
21 |
22 |
23 | SuppressBuildableAutocreation
24 |
25 | 1D7D37DB1DFAE4F600970074
26 |
27 | primary
28 |
29 |
30 | 1D7D37F11DFAE53B00970074
31 |
32 | primary
33 |
34 |
35 | 1D7D381B1DFC2AC600970074
36 |
37 | primary
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/InterprocessCommunication/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // InterprocessCommunication
4 | //
5 | // Created by Grayson Hansard on 12/9/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 | import ServiceManagement
11 |
12 | private func activateLoginItems(from bundle: Bundle, using fileManager: FileManager) {
13 | let loginItemsFolder = bundle.bundleURL.appendingPathComponent("Contents").appendingPathComponent("Library").appendingPathComponent("LoginItems")
14 | let items = try! fileManager.contentsOfDirectory(atPath: loginItemsFolder.path)
15 |
16 | for item in items {
17 | guard
18 | let bundle = Bundle(path: item),
19 | let bundleIdentifier = bundle.bundleIdentifier
20 | else { continue }
21 | if !SMLoginItemSetEnabled(bundleIdentifier as CFString, true) {
22 | print("Unable to enable \(bundleIdentifier)")
23 | }
24 | }
25 | }
26 |
27 | @NSApplicationMain
28 | class AppDelegate: NSObject, NSApplicationDelegate {
29 |
30 | let xpcConnection = NSXPCConnection(machServiceName: "com.fromconcentratesoftware.Bridge", options: [])
31 | let listener = NSXPCListener.anonymous()
32 | let listenerDelegate: ClientListenerDelegate
33 |
34 | override init() {
35 | let client = Client()
36 | listenerDelegate = ClientListenerDelegate(client: client)
37 | listener.delegate = listenerDelegate
38 | }
39 |
40 | func applicationDidFinishLaunching(_ aNotification: Notification) {
41 | activateLoginItems(from: Bundle.main, using: FileManager.default)
42 |
43 | listener.resume()
44 |
45 | xpcConnection.remoteObjectInterface = NSXPCInterface(with: CommunicationServer.self)
46 | xpcConnection.resume()
47 | (xpcConnection.remoteObjectProxy as? CommunicationServer)?.register(client: listener.endpoint)
48 | }
49 |
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/InterprocessCommunication/Assets.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 | }
--------------------------------------------------------------------------------
/InterprocessCommunication/Client.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Client.swift
3 | // InterprocessCommunication
4 | //
5 | // Created by Grayson Hansard on 12/9/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | class Client: CommunicationClient {
12 | typealias MessageReceivedCallback = (Message) -> ()
13 | var onMessageReceived: MessageReceivedCallback = { _ in }
14 |
15 | func receive(message: Message) {
16 | onMessageReceived(message)
17 | }
18 | }
19 |
20 | class ClientListenerDelegate: NSObject, NSXPCListenerDelegate {
21 | let client: Client
22 |
23 | init(client: Client) {
24 | self.client = client
25 | }
26 |
27 | func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool {
28 | let interface = NSXPCInterface(with: CommunicationClient.self)
29 | interface.setClasses([Message.self as AnyObject as! NSObject], for: #selector(CommunicationClient.receive(message:)), argumentIndex: 0, ofReply: false)
30 | newConnection.exportedInterface = interface
31 | newConnection.exportedObject = client
32 | newConnection.resume()
33 | return true
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/InterprocessCommunication/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | Copyright © 2016 From Concentrate Software. All rights reserved.
27 | NSMainStoryboardFile
28 | Main
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/InterprocessCommunication/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // InterprocessCommunication
4 | //
5 | // Created by Grayson Hansard on 12/9/16.
6 | // Copyright © 2016 From Concentrate Software. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class ViewController: NSViewController {
12 |
13 | @IBOutlet var textView: NSTextView?
14 | @IBOutlet weak var textField: NSTextField?
15 |
16 | private var server: CommunicationServer { return (NSApp.delegate as! AppDelegate).xpcConnection.remoteObjectProxy as! CommunicationServer }
17 | private lazy var name: String = { return ProcessInfo().processName }()
18 |
19 | override func viewDidLoad() {
20 | super.viewDidLoad()
21 | let ownClientName = name
22 | (NSApp.delegate as! AppDelegate).listenerDelegate.client.onMessageReceived = { [textView] msg in
23 | let attributedString = msg.convertToAttributedString(ownClientName: ownClientName)
24 | DispatchQueue.main.async {
25 | textView?.textStorage?.append(attributedString)
26 | textView?.scrollToEndOfDocument(nil)
27 | }
28 | }
29 | }
30 |
31 | @IBAction func send(_ sender: Any) {
32 | guard let msg = textField?.stringValue else { return }
33 | server.broadcast(message: Message(sender: name, value: msg))
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Grayson Hansard
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # InterprocessCommunication
2 | Simple demonstration of using XPC to send messages between macOS apps
3 |
--------------------------------------------------------------------------------