Which technology to use to set the alarm at Swift for iOS -


i alarm clock app. view:

enter image description here

what working:

i make single tap on "6:00", call function addalarm ("6:00", "unstable"). button "6:00" highlighted in green. time stored in data model of application, button time highlight after closing , reopening application.

button "8:00" red, because make double tap on it, call function addalarm ("6:00", "stable"). information recorded in data model.

what want:

the green color of button "6:00" means alarm should triggered once @ 6 am, , has deactivated: button again become blue. have function removealarm(time)

red button "8:00" means alarm should triggered each day @ 8 am, after button should red.

under «alarm should triggered», mean following. on screen of device should notice text «wake up», , begins play tune. file tune has 20 seconds duration, want play tune 3 minutes, repeating 20 second file tune.

alarm should triggered when application minimized, phone in sleep mode, or set "not disturb".

what not understand:

well, of course, how want :-) seriously, not clear methods use. managed find following.

i can use nstimer, call callback after appointed time, timers stop working after 10 minutes after minimizing application.

i can , should use uiapplication.sharedapplication().schedulelocalnotification(notification) appearance of notice, melody notice may not longer 30 seconds. not clear me, call function removealarm (time) alarm, created single time working, if user not respond notification, example, not wake up.

i can use background modes.

in general, question is:

what is, or methods should use, how combine them, , direction best choose?


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -