I created a new Swift project and tried to import my existing Objective C code into the Swift project. Everything is going fine except, Xcode 6 Beta 5 is complaining about CGFloat
UIFont
CGSize
...The error I see is
Expect a type
and
Unknown type name 'CGFloat'
right next to some of my methods. I thought Swift should be friendly with Objective C and accept all my Objective C code but unfortunately, this is not the case.
Any Idea?, suggestions, or comments, I would appreciate it. Thanks.
just Add this in which you are facing error
#import <UIKit/UIKit.h>
Swift
import CoreGraphics
or
import UIKit
If you'd like. (UIKit includes CoreGraphics)
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