So, I'm running into a bit of a problem. My particle emitter (written using CAEmissionLayer + CAEmitterCell) is supposed to stop emitting almost immediately after emission has begun. I tried this:
but that resulted in absolutely no emission occurring at all, as if viewLayer hadn't added a CAEmitterLayer.
I'd like to be able to have the stopping of the emission happen in the same method in which it is begun, but so far haven't found the right way to do that. dispatch_after doesn't take millisecond values. I want the process to happen in just milliseconds so it appears as if the app had all these particles lined up and waiting to be emitted.
Code:
[viewLayer addSublayer:layer];
[emitterCell setBirthRate:0.0f];
but that resulted in absolutely no emission occurring at all, as if viewLayer hadn't added a CAEmitterLayer.
I'd like to be able to have the stopping of the emission happen in the same method in which it is begun, but so far haven't found the right way to do that. dispatch_after doesn't take millisecond values. I want the process to happen in just milliseconds so it appears as if the app had all these particles lined up and waiting to be emitted.