Question: Suppose when a user enters *buy milk tomorrow* in the text field, it should be classified as:

1. task: buy milk
2. due date: tomorrow
3. tag: food

Is there any recommended swift library or web api that supports this?

Answer: 
how about trying <https://github.com/quire-io/SwiftyChrono>.
your question will be separated into three parts

1. language tagging => try to know what the object is S, V, etc.
2. knowledge understanding => what buy is, what the S and O is.
3. ontology => milk belongs to food.

there are huge effort to do that. according to my experience, the date in sentence could be parsed by detecting patterns. so your can trying to find NLP date parser.
```
let df = DateFormatter()
df.dateStyle = .full
df.doesRelativeDateFormatting = true
dump(df.string(from: Date()))
dump(df.string(from: Date(timeIntervalSinceNow: -1*24*60*60)))

```

Using the date formatter you can ask it to use relative date formatting. This way you get localization for free as well. If it can show a relative date (yesterday, today, tomorrow, etc) it will, otherwise it falls back to the dateStyle etc.