SDL_SetEventFilter is a way to “speed up" the SDL event queue. Basically, you receive events as they are received before they get into the queue, and in the case of iOS, you should immediately respond to them.
The technical reason for this is that for such messages, iOS uses a series of callbacks that the SDL receives and wraps for you to make the cross platform as seamless as possible, but the fact remains: iOS still expects you to act on them. before returning from the callback.
So, for example, if we just put a message saying that the system is in the queue, the queue is in the queue, instead of transferring it directly to the application through this mechanism, and you just do nothing until this event passes through the queue , you polled it, etc., iOS may force close your application because it does not behave as expected.
When the application goes into the background, you do not need to save your textures. iOS does this for you, and if it doesn't have enough memory, it just kills your application (you never lose GL ES / ES2 contexts, which can happen on some Android devices).
The userdata pointer will contain the data that you pass as the second parameter to the SDL_SetEventFilter, so if you use SDL_SetEventFilter (HandleAppEvents, NULL), then the user data will be NULL.
In SDL_APP_WILLENTERBACKGROUND, if I remember correctly, you do not need to do anything. I have not run the iOS application for a while, but I think the SDL handles all its internal state (including blocking the event loop, and then restarts it). The events you have are SDL_APP_LOWMEMORY and SDL_APP_TERMINATING, how you deal with a particular application (delete textures, free memory, etc., This is beyond the scope of SDL)