What is a data type?

Overview

A data type is a whole series of logic and assets in The Shelf that determines how a piece of data is imported, stored, displayed, and exported. As an example, the Image data type:

  • imports the image data
  • Checks if there is a URL of the image available too
  • Stores the image in an appropriate manner
  • Displays the image in the cell with the orange photos style badge on it
  • Allows the image to be previewed
  • Enables the image and available URL to be exported.

How it works?

When something is dropped into The Shelf, iOS tells The Shelf what type of data is available form the drop. For example, when an text extract is dropped from Safari, the following representations are available:

  1. Apple Web Archive Type
  2. Attributed String
  3. Rich Text
  4. Plain Text

These are ordered in degrading fidelity, where the top one is the most representative. From this, The Shelf decides which data type is most suitable to store this data for later. The Shelf, then stores the data as that data type and displays it on screen.

Adding new data types

As more apps support drag and drop, The Shelf will need to be updated to add support for these new types. For example, if a contact card is dropped into The Shelf today, it will just store the text representation of it, as that is all The Shelf knows how to handle. However, with a day or two of work The Shelf can be updated to support contact cards, this will involve:

  1. Identifying suitably high fidelity version of the card to import
  2. Identify alternate representations that may be useful to the user1
  3. Implementing the logic to extract the correct data from the drop
  4. Implementing the logic to store the data in the app
  5. Designing and creating a badge icon to display in the UI
  6. Designing and creating the Cell UI to display the item on the shelf
  7. Designing and creating the Preview UI see the item
  8. Implementing the logic to export the data when needed

Requesting data types

Does your favourite app support Drag and Drop and you want The Shelf to support it? Let me know via email or twitter.

Once I have a bunch of request, I make it public which type are the most requested and what order I plan to add them. Based on the number of subscribers, I will be adding up to  3 new data types each month.

 

  1. For example, the URL of an image. Not the highest fidelity representation, but could be really useful.

One Reply to “What is a data type?”

Leave a Reply

Your email address will not be published. Required fields are marked *