Tags and subfolders

HI
I have a developper fonder with for each project subfolders, I'd like to make a rule that does :
- Tag each swift files in subfolders with a tag swift
- Tag each folder with iOS dev of Mac OS dev tags
But I don't know how to make recursive rules, I have made something with the examples on this site it works for folders but not for files, any idea ?
Thanks for your help
I have a developper fonder with for each project subfolders, I'd like to make a rule that does :
- Tag each swift files in subfolders with a tag swift
- Tag each folder with iOS dev of Mac OS dev tags
But I don't know how to make recursive rules, I have made something with the examples on this site it works for folders but not for files, any idea ?
Thanks for your help