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

How call the function on UIBarButtonItem?
How to use GPUimage filter only in selected part of image? iOs(swift)
Admob BannerView float over PFQueryTableViewController
Closure closing strongly over a class type instance that go out of scope; can the instance be accessed somehow via the closure instance?
UIButton Heartbeat Animation
Decoding Firebase base64 Swift 2.0
CKSubscriptions and production container
Swift 2.0 autolayout constraints programmatically
Am I using a closure in the following code - Understanding Closures in Swift
How to creat an instance of an UITableView class in swift
PFQuery categorizing results into multilevel arrays
Use of typealias syntax within protocols in the Swift standard library
CoreData Fetch Where All Relationship Property is True
cURL get data doesn't update when data on server has changed
Calling InterfaceController from Menu Item leeds to infinite spinning wheel
Perform a Realm Migration that adds primary key

Categories

HOME
cil
pug
dynamics-crm
performancecounter
google-tag-manager
smartphone
ubuntu-12.04
survival-analysis
safari
appmaker
apple-numbers
filter
urlencode
eval
contact-form-7
netflix-feign
unity2d
packer
window
xamarin-studio
rfid
nixos
sendkeys
lstm
flat-file
prestodb
android-fragmentactivity
google-ima
countif
nsmenuitem
auditing
mayavi
positioning
dhtmlx-scheduler
vegan
outsystems
polymorphism
jquery-cycle2
hashcat
socketpair
dql
agent
infusionsoft
onbackpressed
viewgroup
g1gc
apiary
catia
asmx
archer
shutdown
chrome-remote-desktop
tofixed
hpcc
teiid
restivejs
sqldatareader
svn-merge
payu
inject
coremidi
system.web.ui.webcontrols
spring-ioc
software-product-lines
uiprogressview
instruments
image-editing
date-format
selecteditem
flexjson
xmp
license-key
lemoon
windows-vista
site-prism
pyrocms
pgm
ember-cli-addons
es2015
magento-1.12
client-side-validation
c++-actor-framework
colt
wss
ssms-addin
alertifyjs
dvcs
late-static-binding
initialization-vector
android-json-rpc
mimosa
magicalrecord-2.2
fogbugz-api
goinstant
dynamics-ax-2009
prng
xml-libxml
usn
radchart
responsetext
signals2
entity-framework-ctp5
objectbrowser
paintcomponent
authenticode
symbol-server
libavformat
clause
getresource
j-interop
front-controller
plinq
openwysiwyg
longjmp
msf
usergroups





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