Recent Files Database #236
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I made recent files database using CoreData. When a file is opened, we check if it already exists in the database. If it does, that entry is deleted and a new one is saved.
The following attributes are stored:
A
getRecentFiles()function returns an array of recentFiles, where each element is a struct containing the attributes stored. AfileDisplayTextis also returned which is a calculated string that could be one of these: "Today", "Yesterday", "This Week", "This Month", "July 2019" (example), "2018" (example).Based on these strings, we will group the cells and divide them into sections. We could also divide them based on serverName. @Marton-Zeisler will make the
RecentFilesViewControllerand give it a nice UI.For now, I have added a button on the top left of the servers screen that presents a VC containing the recent files record. This is just a temporary screen to only view the files and test the working of the database. The database stores 50 recent files and deletes the older records as the new ones are added.
This is how it looks:-