I have 2 CGPoint
like :
let a : CGPoint = CGPointMake(1, 1)
let b : CGPoint = CGPointMake(1, 1)
if Both are same then I want to do something.
This is just an example but I want to compare this two CGPoint and I found this question which is already asked but this is on objective-C so can anybudy tell me how can I do this is swift?
CGPoint
already implements the Equatable
protocol, so you can compare using the ==
operator:
if a == b {
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With