swift


Swift 3 Timer does not start from Notification


I have a timer in ViewController using swift 3
var displayDataUpdateTimer = Timer()
The timer is triggered from a Notification from a socket in bridged Objective C code to the following observer in swift in ViewController, which calls the startDroTimer function, in the Viewcontroller
droUpdateObserver.addObserver(self, selector: #selector(startDroTimer), name: NSNotification.Name(rawValue: "droUpdate"), object: nil)
func startDroTimer(notification:Notification){
print("Message received to Start Display update")
displayDataUpdateTimer = Timer.scheduledTimer(timeInterval: 0.3,target: self,selector: #selector(refreshDisplayData),userInfo: nil,repeats: true)
}
The notification arrives and the "Message received to Start Display update" is printed in the console, but the timer does not fire.
If I start the timer from a button
#IBAction func requestDisplayUpdate(_ sender: Any) {
displayDataUpdateTimer = Timer.scheduledTimer(timeInterval: 0.3,target: self,selector: #selector(refreshDisplayData),userInfo: nil,repeats: true)
}
It fires consistently
Any suggestions what to try will be appreciated

Related Links

Using Realm with Amazon DynamoDB
applicationWillHide not called
No haptic feedback
Xcode - Resource files not copied on build
JSQMessages Are Being Shown Under Navigation Bar From Show Segue
xCode Swift file grayed out with red text
Why does use of closure shorthand-named variables has to be exhaustive in a singular return expression in Swift?
How to set a constant to use outside of its scope in a if statement?
ambiguous issue in swift 3.0 [closed]
Custom UIAlertController - Application tried to present modally an active controller
Different ways of making read public write private variables in swift?
onNext not getting called unit testing RxCocoa Driver
Swift add target for paste action UITextField
How to split string into only two parts with a given separator in Swift? [duplicate]
How to append string inside for loop [duplicate]
Resizing SKScene not working for different iMessage view sizes?

Categories

HOME
python
cluster-computing
performancecounter
ncurses
fparsec
cocos2d-x-3.0
extract
algorithmic-trading
subquery
eval
netflix-feign
aruco
event-log
eclipse-luna
bar-chart
aptana
ng-show
styles
sql-update
multichoiceitems
datadog
devforce
ivy
clockwork
exponential
stocks
pycparser
reactivemongo
lego
installshield-2012
fax
upsert
amd
prototypejs
amazon-clouddrive
fqdn
recycle-bin
walmart-electrode
gd
spring-data-hadoop
dwarf
crystal-reports-8.5
pagefile
static-code-analysis
selenium-firefoxdriver
jcreator
festival
restivejs
cron-task
visible
gemini
geodjango
windows-vista
response-headers
crash-dumps
adobe-indesign
symfony-2.6
rhel5
adaptive-compression
korma
indexing-service
zipalign
dynamic-proxy
trimming
threadx
apache2.2
vt100
tridion2009
mozart-mvc
ubuntu-11.10
ninject-extensions
file-exists
maven-ant-tasks
posting
carbide
openvg
graph-layout
castle-validators
outlook-form

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App