I'm doing an app and I already designed how it will work, it actually does on my iPhone 4, but I don't know the coding to automate some part of it does anyone know how to command this?:

If
an app is on the recently used apps list.

then
kill it (close it, get it out of the list)

thank you guys