Swift Equatable Protocol

前端 未结 3 1065
南方客
南方客 2020-11-29 06:24

I was folling this tutorial for Swift: https://www.raywenderlich.com/125311/make-game-like-candy-crush-spritekit-swift-part-1 and came across this code:

func          


        
3条回答
  •  天命终不由人
    2020-11-29 06:49

    making the class an NSObject solved the equatable problems for me...

    class Cookie: NSObject {
    ...
    }
    

    (got the tip from the iOS apprentice tutorials)

提交回复
热议问题