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 to Compare Enum Ignoring Associated Values? [duplicate]
Adding text in a bitmap graphic context (on macOS) with Swift
swift nil form dictionary
UITextview edit mode in swift
Swift: Numeric Literals Decimal Floats Exponents [duplicate]
UDP Messaging in Swift Bytes Read But No Message
Swift- Copying an Object from a Third-party Library
Cast Swift Dictionary to CFDictionary
ActionPickerView get result
smooth scrolling PFQueryTableViewController
swift 3 table view with slide out menu
How can I access a struct member by passing its name as a function parameter in Swift?
fetch data from firebase swift
Can't push cell data in UITableViewCell to new UITableViewController
Are static classes supported by Swift?
Swift 3 - Is there any way to force method call on object?

Categories

HOME
sql-server-2008
angular-cli
amazon-swf
voip
nuxeo
windows-7
azureservicebus
tumblr
sequelize.js
gimp
netflix-feign
wordpress-theming
hashicorp-vault
camera-calibration
nuxt.js
uiview
android-toolbar
aptana
ms-access-2007
primes
multicore
tortoisegit
sonarqube-msbuild-runner
plsqldeveloper
iis-10
opencart2.3
ui5
edge-detection
nesc
cortex-m3
aurelia-binding
pygooglechart
shapes
hawtio
geo
npm-shrinkwrap
color-scheme
coreclr
parent
distributed-transactions
rkt
cppunit
startapp
amazon-clouddrive
archer
drawingarea
dimple.js
jags
seamless-immutable
bnd
greenhills
mcrypt
adler32
autoresize
svn-merge
windows-azure-pack
debugdiag
update-site
spoofing
freetype2
clob
asp.net-mvc-partialview
concur
asynccallback
direct3d12
vips
registrykey
vine
ibm-data-studio
apache-mina
virus
es2015
ejabberd-saas
jcr-sql2
lexicographic
inputaccessoryview
kendo-mvvm
author
csplit
voldemort
jstack
anjuta
internal
visual-c++-2010-express
magicalrecord-2.2
dllexport
vmware-server
magickwand
fluidsynth
domain-calculus
angularjs-timeout
phpsh
cbcentralmanager
sunspot-rails
selectonemenu
pivotal-crm
hadoop-plugins
oggvorbis
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