This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-libzt/integrations/apple/example_app/Example_OSX_App/ViewController.swift

44 lines
1.1 KiB
Swift
Raw Normal View History

//
// ViewController.swift
// Example_OSX_App
//
// Created by Joseph Henry on 6/22/16.
// Copyright © 2016 ZeroTier Inc. All rights reserved.
//
import Cocoa
class ViewController: NSViewController {
2016-06-22 13:19:01 -07:00
var service_thread : NSThread!
func ztnc_start_service() {
let path = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true)
print("start_service()\n")
// e5cd7a9e1c3511dd
2016-07-05 14:47:14 -05:00
start_service("/Users/Joseph/utest3")
//start_service(path[0])
2016-06-22 13:19:01 -07:00
}
override func viewDidLoad() {
super.viewDidLoad()
2016-06-22 13:19:01 -07:00
// ZeroTier Service thread
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), {
self.service_thread = NSThread(target:self, selector:"ztnc_start_service", object:nil)
self.service_thread.start()
});
// Do any additional setup after loading the view.
}
override var representedObject: AnyObject? {
didSet {
// Update the view, if already loaded.
}
}
}