I am looking for ways to implement something that is exactly similar to the "Add to existing contact" option in the native dialer application on the iPhone.
That is, as soon as this option is selected, the PeoplePickerNavigationController is displayed, and once a contact is selected the number is added as a new phone number with an option to "Save" or "Cancel".
Any idea how to implement this?
I am not looking for methods with ABUnknownPersonViewController, because it gives the option to create a new contact and add to an existing one. What I am looking for is the direct jump to the behaviour of "Add to existing contact".
Related
I am trying to make a function so that I request a 'manager override' where it presents a screen for a manager to enter their password and press an approve button. How should I do this? Will it have to be in multiple functions? Is there a way that I can call one function and it present the information back? Would a completion work for what I need? I have no ideas where to start for this.
My set up is as follows:
A view controller asks for manager approval, then a screen slides up with text boxes and an approve button. I want the approve button to trigger authenticating and dismissing the screen
Assuming you don't want a Framework target (that sounds like overkill for what you want) simply mark the function as "public" and move it outside of any class. I just tried in a sample project and it works.
It looks important - remember to keep it in a file already in the project. (My sample project didn't work with menu option File|Add|New|File.)
Now, if you really want portability, check out how to create a Framework project.
I would like to be able to add accelerator keys for the buttons that are provided as a part of the Alert Dialog Controls included with JavaFX.
I am unsure if this is possible using the standard alert types ERROR, INFORMATION, CONFIRMATION, WARNING?
I created my own login window - which doesn't use an Alert structure and it works as follows:
When the stage opens up.
Then when the user hits the "ALT" key:
I would like the ability to "Hot Key" the buttons on the Alerts in the system. However, I am unsure if I can use the standard alerts, or if I need to create my own, and if so, how should I do that.
I really would like to use the Dialogs natively, if at all possible.
Thanks.
As far as I understood your question, I think it isn't possible without some extra code.
Looking at the code of OpenJFX the labels of the buttons are localized and fixed.
You might just want to create some buttons on your own by using the apropiate constructor which takes some buttons where you can override the existing ones.
EDIT: after rethinking everything, I tried to recreate your problem. You can see that project on GitHub..
This is the special code:
public void showCustomizedAlertWindow() {
Alert a = new Alert(AlertType.CONFIRMATION, "some content text", ButtonType.OK, ButtonType.CANCEL, ButtonType.FINISH);
((Button) a.getDialogPane().lookupButton(ButtonType.FINISH)).setText("_finished");
a.show();
}
But be aware, you are removing localization-support of that buttons.
To understand NSUserNotification better, I wrote a little test app playing with this class.
So far so good, except that no matter how hard I tried to feed the additionalActions property with array of NSUserNotificationAction objects, it never showed any difference but only one action button and a close one.
My expectation for this property is that the notification would show a pull-down menu containing the additional buttons I offer as it does in the Mac App Store update notifications.
Am I missing something? Or are you having the same problem, since it is a bug awaiting Apple to tackle?
Can you please try to click and hold down the action button in your notification? Does it show a drop-down menu of additionalActions?
Update
As it turns out, you can show the little chevron next to the action button by setting a true value for the private _alwaysShowAlternateActionMenu key on the notification. In Swift 3, it would look like this:
notification.setValue(true, forKey: "_alwaysShowAlternateActionMenu")
However, as I mentioned this is a private API and I strongly advise against using it if you want to distribute your App through the Mac App Store.
It is probably a bug. Setting up additionalActions will create the list, but not the little arrow icon. Holding down on actionButton will show the menu with the number of actions you set.
Besides setting additionalActions will cause several other problems. I will save this for another question.
Refer to another question.
show NSUserNotification additionalActions on click
P.S. I am using El Capitan APIs
Is it possible to use ABPersonViewController or ABUknownPersonViewController to display contact information within my app.
ie.) you click a button that says "contact info" -> which then loads a ABPersonViewController with static information such as address and phone number etc and would be pushed onto the NavigationController?
The reason i want to use this is the nice functionality which is built in already. -buttons that have address and phone numbers in them that are nicely formatted and when clicked perform phone calls or open the map.
Sure, you can use these. Set ABUnknownPersonViewController.allowsAddingToAddressbook to NO to prevent the user from adding the info to an existing or new contact.
Settings for Mail allows one to add items to a list (the list of accounts) by choosing the "Add Account..." entry at the bottom of the list; info gets entered on a separate screen, and now the list has a new entry.
Is there a way for someone other than Apple to accomplish this & still get into the App store?
Is there a way for someone other than Apple to accomplish this & still get into the App store?
No. There is no public API to do something like that.
If you're asking can someone modify the add new account list under mail settings programmatically, the answer is no. Even if there was a private API I doubt it would get through the apple review.
Yes, it is possible to create a similar UI-functionality in your app as the one described.
Simply add a list element in the end of your TableView to act as a list footer with desired functionality.
Once clicked, swap to a another view. In this view you change the data source of your TableView so it contains a new element. Once you go back to the TableView, the new element can be drawn into the list.