Reputation: 51
I'm trying to create a custom login screen on OSX Yosemite so that users can login using a different mechanism (not just typing credentials via keyboard). Currently, I am trying to achieve this by subclassing the SFAuthorizationPluginView class as recommended on the Apple developer docs and then putting my custom logic by overriding the -(void)buttonPressed:
method. However, the documentation is fairly vague and outdated. Therefore, I've based my current implementation on a patched version of the NameAndPassword example.
This example works well and allows me to customize a single nib file and configure my own fields and buttons. My issue is that when the login screen loads my custom view, it looks like it's bound by a parent container which includes the default Yosemite login buttons. This would have been fine, except the buttons contain both a title and an image, resulting in pretty messed up UI. Now I have both my custom buttons and the Yosemite default buttons visible in my custom login screen. Here's the screenshot.
I've been looking for ways to get access to the Yosemite buttons so that I can delete/modify them. So far, the only way I found to interact with these buttons is by calling
[super setButton:SFButtonTypeLogin enabled:NO];
from my subclass which toggles the enabled flag of these buttons depending on the button type you pass in.
I'm looking for ideas to either get access to these default buttons, or cover them with my own view so that only my custom buttons are visible and enabled. Also, there is a possibility that this class doesn't play well with Yosemite since it's fairly outdated. Let me know if someone has found a way around this.
Upvotes: 5
Views: 645