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

Default website when web browser launches xcode swift
How to define global final variable that not changes for all tests under class?
Swift3 : How to load html file to WKWebview from document directory
How to write own model mapper in Swift Language
how to display relative time in swift [duplicate]
Render Text with MetalKit
Using an overflow operator in Swift 3
How To Make Play/Pause Button on Apple TV Remote Play/Pause AVAudioPlayer
Swift optional binding constant names
Calculating Angle of Reach in Scenekit
Does _ArrayType or _ArrayProtocol not available in Swift 3.1?
Why doesn't it work to return in else? [closed]
How to write this code in swift 3.0. using For loop [duplicate]
Log Out automatically from the application when i login from another mobile device “swift - firebase”
call uiactivityviewcontroller with spritekit/skscene
print a string from an int, or… how to make an int equal to a specific string

Categories

HOME
tensorflow
google-contacts
thunderbird-addon
ubuntu-12.04
appmaker
orientation
xtext
user
shipping
click
flexbox
ssr
cortex-a
future
squarespace
equalizer
typeahead
titan
ssms-2016
boolean-expression
richfaces
nmf
bootstrap-typeahead
philips-hue
iis-10
printdocument
metis
bus-error
nesc
aurelia-binding
rowcount
polymorphism
geopy
ios-ui-automation
viewstate
honeysql
zero
issue-tracking
android-preferences
nashorn
mediawiki-extensions
bids
prototypejs
appstore-approval
gist
sapui
istorage
azureportal
spell-checking
emgu
spyne
keycode
asteriskami
boost-hana
image-editing
fps
test-class
hateoas
code-readability
jericho-html-parser
wif
urn
gulp-livereload
google-hadoop
web-component-tester
xaml-designer
shift-jis
google-earth-plugin
qtestlib
adcolony
sortable
ghostdoc
iostream
libssh2
aquafold
pic24
voldemort
unison
opensocial
gamepad
cdata
sslexception
goinstant
multiple-conditions
dynamic-data
zend-framework-modules
mozart-mvc
redirectstandardoutput
ninject-extensions
entity-framework-ctp5
hinstance
nssavepanel
executable-format
ets
dashcode
drawtext
recordset
quick-search
gwt-2.2-celltable
grooveshark
rtsp-client
scatterview
windows-controls
revision
handheld
castle-validators





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android


MS Developer
developer works
python
ios
c
html
jquery


RDBMS discuss