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

Swift Escape Charater '\' being added to the string
Swift presenting new view after user sends email from MFMailComposeViewController
How to use special characters \n in URL
Receipt validation iOS - The file could not be opened because there is no such file
UITextField to Int to UILabel
Swift 3: append characters to an Array
Automatically have += defined when defining +?
Object is nil although it was set in init
why is Calendar.current.firstWeekday == 2?
How to access class data as if it were a dictionary
How to add Docusign API to my swift project
Quering items in a one-to-many relationship in Realm Swift
Realm Object Server. Offline object status
Conditional Sign out based on type of User
Should perform segue on request
Swift 3: How to check the type of a generic array

Categories

HOME
translation
puppet
wxwidgets
tomcat7
zend-framework2
is-empty
tizen-wearable-sdk
jframe
google-spreadsheet-api
octopus-deploy
pjsip
game-maker-studio-1.4
symfony-forms
ssms-2016
opera-mini
ms-access-2007
prestodb
styles
autolayout
source-maps
bcrypt
rhmap
pptp
dss
web-frontend
helper
i3
hana-studio
weinre
consumer
m2e
division
body-parser
qtablewidget
npm-shrinkwrap
phpspreadsheet
pox
rhel.net
es-shell
initializer
fax
react-native-router-flux
jdbi
floor
nsjsonserialization
ideone
chown
webdatagrid
applepayjs
tiddlywiki
workflow-foundation-4.5
struts-layout
butterknife
unity3d-editor
sqlexception
garrys-mod
project-template
settimeout
build-process
gradle-script-kotlin
activeweb
uiprogressview
gherkin
dbscan
django-south
difference
plone-3.x
code-readability
uialertview
wif
stream-framework
sparse-file
xaml-designer
virus
google-earth-plugin
ticket-system
client-side-validation
dache
code-testing
io.js
valence
joox
magic-numbers
map-force
uipickerviewcontroller
sim900
magicalrecord-2.2
fogbugz-api
installshield-2011
entity-framework-4.1
qtgui
appfog
phpsh
lync-server-2010
pitch
jpf
point-sprites
nintendo
objectbrowser
datamember
cookieless
gethashcode
libavformat
asp.net-mvc-controller
longjmp
ajaxpro

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