Skip to content

Conversation

@iswiftshek
Copy link
Contributor

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:

  • day, month, year
  • fileName, fileURL, fileSize
  • mimeType, mtime
  • serverName
  • authToken

A getRecentFiles() function returns an array of recentFiles, where each element is a struct containing the attributes stored. A fileDisplayText is 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 RecentFilesViewController and 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:-

Simulator Screen Shot iPhone X 2019 08 14 at 04 32 38 000 Simulator Screen Shot iPhone X 2019 08 14 at 04 32 51

@csoni111 csoni111 changed the base branch from beta to feature/recent-files August 24, 2019 11:03
@csoni111 csoni111 merged commit b90c316 into amahi:feature/recent-files Aug 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants