Issue in code page 193 Chapter 13!

Hi ,

I got so many errors on Code


func searchForOpponent() {
let avatarSize = myAvatar.frame.size
let bounceXOffset: CGFloat = avatarSize.width/1.9
let morphSize = CGSize(
width: avatarSize.width * 0.85,
height: avatarSize.height * 1.1)

here when I make bounceXOffset of type CGFloat

I got error in second code

let rightBouncePoint = CGPoint(
    x: view.frame.size.width/2.0 + bounceXOffset,
let leftBouncePoint = CGPoint(
    x: view.frame.size.width/2.0 - bounceXOffset,

Binary operator '+' cannot be applied to operands of type 'CGFloat' and 'CGFont'

Please fix it

@icanzlib Do you have any feedback regarding this? Thank you - much appreciated! :]

@x901 Thanks very much for your question!

Here is a solution I found for your problem on I think it should help :slight_smile:

I hope this helps!

All the best!

This topic was automatically closed after 166 days. New replies are no longer allowed.