Giter Club home page Giter Club logo

Comments (6)

mineschan avatar mineschan commented on July 21, 2024

Hi,

Currently MZTimerLabel is not aim for working in the the background. Sorry about that.
And I think if you terminate the app, Apple would not suggest you to keep counting using the timer way.

I would suggest you to save the counting timer information before you terminate the app via AppDelegate. And when you launch the app again, loop through those saved timers and determine if the timer should be ended and perform following actions.

Cheers,
MineS

from mztimerlabel.

Morpheus2002 avatar Morpheus2002 commented on July 21, 2024

I'm not terminating the app. Just closing it by clicking the home button. So it actually should work in background.

I also found out something wired. The timer and delegate calls working fine in simulator, but not working in my iPhone 6. The delegate method is not called if the app is in background.

Any ideas?

from mztimerlabel.

mineschan avatar mineschan commented on July 21, 2024

So you mean when you using simulator, the delegate method called even in background?

from mztimerlabel.

mineschan avatar mineschan commented on July 21, 2024

How long it takes you after minimize the app and the delegate should call?

from mztimerlabel.

Morpheus2002 avatar Morpheus2002 commented on July 21, 2024

I created a property for MZTimerLabel in my Appdelegate. This way it works in background. Already tested in my other project.

I got one timer with two settings: 10 seconds and 30 seconds.
Here are the steps I'm doing.

  1. I start the timer with 10 seconds
    [appDelegate.mzTimerLabel setCountDownTime:10];
    [appDelegate.mzTimerLabel start];
  2. After it's done I call the delegate, and check what time was set previously.
  3. I set up the time to 30 seconds and start the timer again.
  4. After this timer is done, I call delegate again and start 10 seconds time. This way it runs for 8 minutes.

Here is my delegate method:

- (void)timerLabel:(MZTimerLabel*)timerLabel finshedCountDownTimerWithTime:(NSTimeInterval)countTime
{
    if (countTime == 10) {

        [appDelegate.mzTimerLabel setCountDownTime:30];
        [appDelegate.mzTimerLabel start];

        }else{

         [appDelegate.mzTimerLabel setCountDownTime:10];
         [appDelegate.mzTimerLabel start];

        }
}

from mztimerlabel.

mineschan avatar mineschan commented on July 21, 2024

let me investigate a bit.

from mztimerlabel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.