How to fetch data in background every hour in Swift even the app is terminated?

You can't do anything if your app is in terminated state. Apple is not allowing anything (except receiving notification) in terminated or closed state.

You are also restricted for background execution also. You can perform specific kind of task in background mode like : Location update,Music playing, VOIP, finite length task, Newsstand downloads, etc. You can refer apple documentation for more details about background execution.

Hope this will help :)