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
Related
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?
I want to know either all sheets name or ID number in a specific spreadsheet, but I cannot find anything that will help me. There are many people who have done this in other languages other than swift, but swift is unique in the way it uses and handles the google sheets API. I do not even know how to get started. Is there anything anyone has that can help?
I don't know where to start, and I am having a lot of trouble with this. I want to be able to use a dropdown menu (from iOSDropDown) to select one of the existing sheets, but I need a way to find the sheets name or ID. People have done it in JavaScript, but there is literally almost no support for swift on the internet. I have already been through the sheets API's hundreds of times, and I have searched through stack overflow and other places as well.
I do not have any results.
To get the names, I ended up having a number on the sheet that I add one to every time and I put the name of that sheet right below the last sheet.
Context:
I teach at a university with mostly monolingual, English-speaking teachers, and students with mostly Russian and Kazakh names.
I want to create a simple form (like this https://docs.google.com/forms/d/1zo0vSfrH-xIosENy1wVjOd_VvPL5LL6UX6g4VqIPFn0/viewform ) that would keep track of reports of plagiarism on a Google Sheet (like this https://docs.google.com/spreadsheets/d/1h2nAvCq31xumi4SvjMvWWp8RR7ppJ_NtLCiuvrLqVkc/edit?usp=sharing )
Having the English speaking teachers type in Russian and Kazakh names would likely lead to mistakes. There are too many students at the university to choose them from a drop-down menu, and would be too many teachers and courses to create separate Google Forms for all of them, or to use Google's branching page choices (it would require creating hundreds of pages). So I would like instructors to be able to type in the Student ID # and their own Instructor ID #, and then have some way to verify that they have typed that information in correctly (so we don't have the wrong students being penalized, or penalties that don't get assigned to any student at all).
Questions:
1. Is there any possible way (via scripting, an add-on, etc.) to have Google Forms take the Student ID from Page 1, then look up the student's name on the Student Info tab of the Google Sheet and insert it into the text field on the second page of the Google form, so the instructor can verify it's the correct student? (Or any other technique anyone can think of that would allow a Google Form user to verify that they had entered the correct data, or help manage the massive number of choices of students in a university of several thousand students.)
If (as I'm afraid), there is no way to do it with Google Forms, can anyone suggest a Form creation platform that would do something like this, and that would integrate with Google Sheets or something similar?
Any help would be appreciated. Thanks in advance.
If you are open to doing it differently I'd go this route...
1) Use a short answer box and allow edits to answers.
2) Put the onSubmit() trigger into the sheet. When a submission comes in, send a follow up email to the person with the ID that they typed and the student name that it corresponds to. Let them know that no action is required if that is correct. If it isn't correct, they should edit their response with the edit response link which you can get using getEditResponseUrl(). I'd call it done right here and only worry about additional features if they are needed. It isn't as ideal as verifying at the time but would get the same thing done for people that can't keep their IDs straight. :-)
3) But... if you have people that keep messing up and they don't fix their issues or whatever, add a link in the email to confirm that the entry is accurate. If it isn't then a weekly/daily task runs that deletes any entries that haven't been confirmed and are older than Y days.
4) Alternately, instead of verifying what they type, give them drop down lists made up of a combination of student ID and name. I'd have multiple lists, depending on the number of active students. One or many though, make a script in the sheet that updates the dropdowns in the form either on edit or by manually running the script, either from a menu item or by attaching it to an icon on the page where the IDs/names are at. They should see 12345 - Joe Smith as the option and can find the right one if that student name doesn't match the ID they thought they should use.
I have a script like #4 that I use to populate a form with updated products whenever the list changes. I tied it to a big red button JPG to help the end users remember to run it when they change something, as a menu option didn't work and running every time there was an edit was too much.
If you list of students/IDs also includes the teachers/classes/etc you could even do custom forms for each staff member that uses the form that only populates their students. Not sure how many staff you have so that might not be practical. Though again, once you have the script and the data is accurate, updates are a single click.
I am using the module kksou Google Weather Module. It displays the weather of a particular city (for US and UK only using zip code and displays the weather of city). If i want to display the Weather for the cities in Australia using zip code only don't want to type the city name.What i have to do?.
Please check the demo
I just installed and tried it without a problem with these steps for a city:
From administrator, edit the module and set Default City to Sydney, and set Hide Input Field to yes.
It only supports the ZipCodes you mentioned, so you'll need to map them somehow on your own if you want to accomplish that.
I am looking for a control, class or nib file looks like "SMS or Email writing window".
In order to do my job, it should have these particular functions.
Has to look for the people in Addressbook.
When person is selected, it should return person's name and placed in the UITextField.
Has to be searched by person's surname or firstname.
If you see this screen capture, you will understand more easily.
But I am a new user in this web site, and I cannot upload the picture that I wanna show you guys.
Can anyone give me some clue how to solve this out?
Thanks in advance.
You're never going to get something that perfectly fits your very specific needs like that. To get the user info you'll want to look into Address Book Framework. To get the SMS view, here are two classes to get you started:
SSMessagesViewController
AcaniChat
You will probably have to interact with the Address Book UI Framework.