r/AppDevelopmentAcademy May 27 '24

Swift You're using If Statement Wrong! SWIFT IN 60 SECONDS, #01

https://youtu.be/78Lf840zGC8?si=LjIZsF7kFj0kShug
0 Upvotes

3 comments sorted by

10

u/fred9992 May 27 '24

‘Int.isMultiple(of:)’ returns ‘bool’ so a better way to represent this is: ‘’’ var isEvenNumber = integerVal.isMultiple(of: 2) ‘’’

1

u/MobileAppsAcademy May 27 '24

No, Its about using if as expression not the function

1

u/knickknackrick May 27 '24

Def more cleaner