SwiftUI keyboard - specify suggestions - swift

I'm trying to work out if there is a way to specify what suggestions should be shown on an iOS keyboard.
I have an app which has a postcode search field. When a successful search is made I am storing the postcode to core data. What I want to be able to do is populate the suggestions on the iOS keyboard with the list of stored postcodes. I've searched high and low and seem unable to find a way to specify suggestions. Is this something that is just not possible?

Related

A way to access list of city names (OpenWeatherMap)

Wondering if anyone knows a solution to this -
I’m building a (semi) simple weather app with OpenWeatherMap using swiftUI. Basically finishing up and adding some last touches. Would like to be able let users choose between cities if there is more than one city with the same name, but as far as I can tell the only access to a full list of city names OpenWeatherMap offer is a zipped JSON, there’s no api call. And its way too large to include in the bundle.
heres the link to the list - http://bulk.openweathermap.org/sample/
As far as I can tell, without being able to check a list of cities - it seems the only way to specify the right city is to add a comma and then country code in the search. e.g "rome" returns a location in the US, "rome, it" returns Rome, Italy. Which isn't a very good user experience.
Am I being stupid and missing something?
Perhaps the OpenWeather Geocoding API was not available in 2021 but it is now. You can use this API to search for cities around the world from their weather database.
https://openweathermap.org/api/geocoding-api
If you query only the city name (without state and/or country) it returns a list of matches. For example if you search for "Dublin" and limit to 5 results, it returns Dublin, Ireland and 4 cities named Dublin in the USA. Then the user can select from a list to confirm the correct city.
http://api.openweathermap.org/geo/1.0/direct?q={city name},{state code},{country code}&limit={limit}&appid={API key}
This seems to be their recommended way to get the latitude and longitude of a city by name to then query the its forecast.
Hey in order to get that list , You have to programmatically create a tableview which will be the half of height of that main view(set it initially to be hidden) and it should be visible when someone interacts with the searchBar or TextField (you'll need to make it visible in one of the delegate methods of tableview or searchBar , whatever you are using)
and render the city names in that tableview , that's it , it will be easy if you know a bit of Programmatic UI if not watch some YouTube videos by Sean Allen on programmatic UI and you should be good to Go !! Best of luck

UWP RichEditBox Text with Inline Rich Objects

I am working on a UWP app and I'm basically trying to do exactly what Facebook does with their app when composing a post.
Basically I want to be able to type text and At Mention someone in the RichEditBox. The person's name should be highlighted and when I tap on it I should be able to invoke a Command in my view model. Also once I hit send, I need to parse out what is text and what's a link to a person's account. I've played around a lot with the RichEditBox but can't quite figure this out.
Does anyone have any hints or ideas? I'm thinking I'll have to keep track of my object's position on every keystroke, just wondering if there's a cleaner way to do it.
You could use the RichTextBox.Document.Selection.Link property to store a custom link to your entity (ex: "mention://JohnDoe")
https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.text.itextrange.link.aspx

How to modify EKEventEditViewController?

I have integrated the eventKit framework and am using the EKEventEditViewController to organize the events, but I want to change its UI. See here:
I want to add the two more fields to that view. One would be like the Title (Text Field) and other would be a drop down which would allow users to select the Type.
I googled a lot for this but I didn't find any reliable solution. Any help is appreciated.

Settings bundle, want to show dynamic data from web-service

Hi I am stuck please help me...
Is it possible to load dynamic data in the settings bundle, exactly what i need is when user sets a value for a preference, i need to display a list for the next preference, this list should be drawn from an online database. I have seen some thing similar in iPhone's default settings. Can anybody please give a solution for this as i am really screwed now. If it is not possible then i will include the settings in the app itself.
Thanks in advance
It is not possible to have dynamic values in Apple's settings application; they need to be specified in Settings.bundle before compilation. I recommend you implement a custom settings screen.

Add new field in existing built in Application of iPhone

Hope you all are fine and are in your best of moods.
I herewith one doubt to ask you, kindly help me by giving its solution.
I need to add one custom field in existing built in Contact Application of iPhone.
I mean i need to allow user to set different icon or Logo for different contact.
so i need to add one field namely icon or Logo in existing application.
But I don't know how to do this, weather it is possible or not or is there any alternate solution for that or not???
kindly post your Answers.
Thanks in Advance.
You cannot add fields to the built in Address Book datastore. You could perhaps achieve your goals by one of two solutions:
make a copy of the data and add your data to that. You will hit sync problems
Use some property (perhaps ABPropertyID) of the AB information to key a local database referencing your icons.
I'm assuming what you actually want to do is add an icon to the address book app - there is certainly no way to do that.