[Solved] Read the first index of array for checking a boolean [closed]

[ad_1]

If the array could be empty this is a safe way

if myarray.first?.isRunning == true {

or (also safe)

if !myarray.isEmpty, myarray[0].isRunning {

If the array is never empty then your bad way is good.

0

[ad_2]

solved Read the first index of array for checking a boolean [closed]