swift


Why can't I call subscript on SKScene?


Apple documentation says that subscript(_:) is a method of SKNode.
https://developer.apple.com/reference/spritekit/sknode/1483070-subscript
The documentation also says that SKNode inherits from SKEffectNode, which inherits from SKNode. My beginner's understanding of this says that SKScene should have all the same methods available to it that an instance of SKNode would have.
However, in my GameScene subclass of SKScene, code hinting does not reveal the subscript method. If I try to use the method as follows, I get an error.
self.subscript("sensor")
Can anyone explain why this method seems to be unavailable? None of my research online has turned up any explanation.
subscript is not a method of SKNode. (Note that the documentation you linked does not say func subscript.)
SKNode has a subscript operator.
let sensorNodes: [SKNode] = self["sensor"]

Related Links

Swift: Determining if cast to integer from string succeeds
how to fix memory leaks with xcode (Swift 3)
Find minutes remaining between two times
Swift - Calling a func of a UIViewController from a Custom UITableViewCell
Label automatically hide/show on scrolling in Header View
Random Node Location without Overlap
UITableView within UIViewController crashes when the next cell to add would not be visible
SKLabelNode Not Showing [SpriteKit]
How to convert static properties of a Swift class to a Dictionary?
Generating interface from .swift file
Log in Twitter swift
Swift: Create card-like cells in a PFQueryTableViewController (Parse)
SKNode perform animation before removing
Update UI in UIAlertAction handler
How can I add a little white tick to SSRadioButton
Xcode resize vector shape generated with paintcode

Categories

HOME
json
rest
sass
crate
npm
rotation
drupal-7
firebase-app-indexing
visual-studio-2013
sbt-assembly
defragmentation
docker-windows
slim-3
constructor
octopus-deploy
metronic
criteria
google-shopping
image-recognition
cs-cart
gwtp
pdo
eclipse-luna
riak
r-lavaan
primes
backpropagation
prediction
apply
go-cd
jquery-scrollify
tflearn
pipelinedb
opencart2.3
skmaps
widevine
excel-2013
reactiveui
vegan
svnkit
skygear
oracle-xml-db
edb
hotmail
fabric-digits
recurrence-relation
service-locator
rider
jboss-esb
nodeclipse
mms
rhel.net
coreclr
equivalence
alchemy.js
lftp
cppunit
rapidweaver
number-theory
chunked-encoding
windows-firewall
sgmlreader
multi-agent
pluck
ticker
gce
pagefile
quintus
search-box
date-range
ingres
pspice
payu
libreadline
manifest.mf
visible
sun-codemodel
geodjango
windows-vista
app.xaml
sem
anti-patterns
isml
activity-streams
scala-2.11
author
crystal-reports-10
edit-in-place
pyjade
facebook-chat
bignum
cdata
osx-snow-leopard
cilk-plus
nservicebus4
sslexception
nuspec
client-side-scripting
graph-coloring
socketstream
usn
icefaces-3
legacy-code
rose-db-object
z-machine
mysql-error-1045
sendfile
google-instant
front-controller
dotproject

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