I have formulated all cells in my Google Sheet, but since they are not counted as edits (since it is formualated update and not manual edit), I am not receiving notifications when there are updates in the value of the cell. Is there a way to set up notifications for updates in a Google Sheet, regardless of whether the cells are edited or not?
In Addition, Can I send the notification of these update in Discord/Whatsapp/Telegram?
Thanks.
I tried set up with zapier, iftt, etc. But it doesnt work since it is not edited.
That can only be done with a programmatic solution. It is probably easiest to do with Apps Script.
If the value in the formula cell depends on some other cells that are manually edited, use an installable trigger to monitor the manually edited cells rather than the formula cell.
If you need to monitor the value in a formula cell, use a time-driven trigger to check the value periodically, and compare the value to the cell's previous value that you store in the Properties service.
Related
In our iOS application, we are using core data and tied it with a table view using NSFetchedResultsController. The app is about "Chat" feature.
UI is same as that of iPhone "Messages" app. When we tap on a message, it displays the history and all the history grouped with time. The logic behind it is, if previous message and current message are received with a gap of 1 hr, then date & time stamp will be displayed over recent message.
My question is, how can I group the messages and fetch them so that I can show the date & time stamp as well as sender and receiver messages.
There are four types of message cells type - regular, group-start, group-middle, group-end. A group-start message is more than a hour after the last one but less than an hour to the next one. group-middle is less than an hour from the one before and after. group-end is close to the one before it, but more than hour to the one after it. regular is more than a hour before and after it.
There are two parts of this project. One is to display each type of cell correctly. The other is figure-out which type each message is. I assume you can figure out the UI stuff yourself (different padding, for each one, regular and group-start show the time, not rounding some corners, etc).
For each message to figure out its type, is not that hard - just look at the message before it and after it. It can be done in a single run through of the results - O(n). It could also be done lazily with a cache (ie each time a cell load check the message before and after it - save the answer in the cache for next time). If the cell sizes are different for different types then it make cause some weird jumping with estimatedRowHeight. You could also store the results of the type into core-data after you calculate it.
Be careful when a message is inserted to invalidate and recalculate the message cell type for the one above and below it. Also when calculating the message cell type account for situations where there isn't a next or previous cell.
I think you were hoping for some core-data magic - like some cleaver trick with sectionIndexKey. But it is really much more straight forward of just running through the array and calculating it.
Update:
Just to make it clear: don't use sections. Keep all the cells in one section. Just add the time to the top of the cell for the cell type group-start. It is a lot easier than dealing with sections especially when there are inserts that can cause and earlier cell to change from normal to group-start.
I'm using Voice Over in my application. I'm having hard time to figure out which table cell is currently selected when voice over is on. How can I know whenever user initiates single tap or navigate through any tableviewcell?
These are the things you can try:
use the UIAccessibilityFocusedElement global function
override accessibilityElementDidBecomeFocused and accessibilityElementDidLoseFocus on the cell
observe the UIAccessibilityElementFocused notification in NotificationCenter in situations where you need it (e.g. when the view controller for the table in question is showing)
Also what element will report focus will most probably depend on whether your UITableViewCell has isAccessibilityElement set to true or false.
While the above will probably help you with literally what you asked, it is also possible that your overall approach to accessibility in this situation might be wrong if you need the above information. If you share more info on the bigger picture / motivation what you are trying to achieve, it might turn out that the information about focused element might not be needed at all and that another solution is more proper.
If what you need is to add a hint for swiping, you can simply set accessibilityHint on the proper element (if you set isAccessibilityElement = true on the whole cell, then set that on the whole cell, otherwise try setting it on the label that VoiceOver reads in the cell), e.g. when you configure the cell for display (usually in tableView(_:cellForRowAt:)). In such case, you will not need to observe which element is focused, and simply let VoiceOver read hint available on that particular element/cell.
(My issue is with WKInterfacePicker, but ideas for standard UIPickerView might also be applicable.)
I'm wondering if anyone has any suggestions on how I can limit the range of selectable values on a WKInterfacePicker?
To explain: Let's say I have two pickers, A and B. Each has a unique array of values. If the user moves picker A up or down, I make picker B move the opposite direction, by the same index change. The issue is if that movement of picker A is going to exceed the array of B's values (<0 or >array.count). I need to keep the range of selectable values on picker A within the limits of picker B, even though A may have index values higher or lower in its own array.
I have tried creating a 'slice' of picker A's values to match the range of picker B's limits, however this then alters the index numbering on picker A (i.e. index x no longer pertains to the same value).
I am ideally looking for a way to stop the user taking picker A past a given index range. Any ideas/thoughts greatly welcomed. Thanks in advance!
No answers received, but thought I would post how I worked this out in case anyone else has this issue.
First, some bugs seem to exist with the wkinterfacepicker in its current form, mainly around it not 'settling' correctly on a value under certain circumstances (bug raised with Apple). This means I had to work around this, using a number of the other methods available. Here is the approach I used:
(Assumes initial/previously selected values for both PickerA and
PickerB have been stored in variables.)
Use the pickerDidFocusmethod to trigger a calculation of the
current position of PickerB(from value stored above), and its
upper/lower limits. Calculate acceptable upper/lower values for PickerA based on this range.
When PickerA is changed, use the default #IBAction from the picker
change to store the selected value in another variable.
Use pickerDidSettleto wait for the PickerA movement to stop before
doing anything. Calculate change between old and new value of
PickerA, compare against limits calculated earlier. If within range,
make change to PickerB.
If outside of range for PickerB, pop alert message, and set a flag.
In willActivate for original InterfaceController, check for flag
and, if active, setSelectedItemIndex back to within acceptable
range.
This may seem a little overly complicated. The last step in particular may seem over the top, however sporadic/unreliable behaviour of the pickers I experienced, even when using pickerDidSettle, meant that I had to use this approach to guarantee that there was a pause before resetting the pickers.
Maybe this will help someone else!
Is it possible to tell the iOS system not to set some property's value to default value when the cell scrolls of the screen? It does that automatically at random times. At runtime I set the property, than the cell goes of the screen, system sets the property to default, and I can't use it anymore.. What needs to be done to avoid this behaviour?
Don't even try.
Cells are objects that are only used to display things on the screen. They are not supposed to store any permanent information, they are supposed to be used for different rows of your table at any time.
Find a different place to store your information.
As a general rule, work with the rules of iOS. If you try to work against them, you will never succeed and just waste your time.
I am trying to figure out the best way to implement the blue dot like the Mail app for unread cells. I have the blue dot but I am just trying to figure out the logic behind it. The table is populated by an xml file. Right now I have it set as so, when the parsing method is called, it sets a boolean to NO within the data object. Then when the tableview populates itself, if the boolean is NO, the image is displayed, and then during didSelectRowAtIndex, I then set the boolean to YES and the image disappears. The problem lies here, every time I refresh the table, the xml is re-parsed and the instance variable is reset to NO and the user is informed that the cell hasn't been clicked. How do I fix that? What's the best logic around it?
Instead of re-parsing the XML each time you refresh the table, parse it once and then save the data (or an array of dictionaries, or whatever) it parsed out into as a variable within the object.
That way, the state of the "read" blue dot or "unread" will persist between table reloads.
Michael Dautermann is making a good point in his answer. For your situation, where the feed is often refreshed, you can keep a set where you keep track of the read elements by storing their ID's there (whatever they are). Then, in your tableView:cellForRowAtIndexPath: method, you just check if the current element's id exists in the set, and don't show the "new" image if it does.