How to check if array is null or empty?

Viewed 80001

I want to check if my array is empty or null, and on base of which I want to create a condition for example.

if(array ==  EMPTY){
//do something
}

I hope I'm clear what I am asking, just need to check if my array is empty?

regards

12 Answers

In Swift 4

if (array.isEmpty) {
    print("Array is empty")
}
else{
    print("Array is not empty")
}
Related