i tried a much, but it doesn't work :-(
I have written a class with a part is this:
if useKeychain {
let server : String = "smb://cloud.amrhein.info"
let user : String = "gerald"
let pwd : String = "password"
let keychain = Keychain(server: server, protocolType: .SMB)
if let output : String = try! keychain.get(user) {
print("Password (if): \(output)")
} else {
print("start Ask4pwd")
var pWindowController : NSWindowController?
if let storyboard : NSStoryboard = NSStoryboard(name: "Main",bundle: nil) as NSStoryboard
{
if let vc = storyboard.instantiateControllerWithIdentifier("passwordViewController") as? passwordViewController
{
let myWindow = NSWindow(contentViewController: vc)
myWindow.makeKeyAndOrderFront(self)
pWindowController = NSWindowController(window: myWindow)
pWindowController!.showWindow(self)
}
}
do {
try keychain
.accessibility(.Always)
.label("\(server) (\(user))")
.comment("Use for Mount Volumes")
.set(pwd, key: user)
} catch let error {
print(error)
}
}
} else {
password = passwordsArray[index!]
}
if password == "" {
print("No password set - break!")
break
}
....
i have settled my environment that no password is found. i see the "start Ask4pwd" print in console!
the class itself is running, but the window for asking the password do not open when no password is fount in keychain!
in the Mainstoryboard i have created a new view controller "passwordViewController" and gave it also the Storyboard ID: passwordViewController
This view controller has no sequel to the Main Window controller!
I do not want that the gui comes up when app starts, i have disabled "is initial controller" on Mainwindowcontroller
i gogoled and viewed youtube videos a lot - i do not reach my goal...
Who can help me?