I'm trying to set all my colours in one Swift file that can be used throughout my application.
The following code below results in...
import Foundation
import UIKit
class DotColors {
let tsblueColor = UIColor(red:58/255.0, green: 125/255.0, blue: 208/255.0, alpha: 1.0)
}
... Expected ';' after top level declarator
The same error occurred to me after I've added the first swift file to my objc project. That's how I fixed it:
#import "ExampleFile.swift"
but use #import "ProjectName-Swift.h"
@objc
statements in your swift code that you want to import to objcThese are the links that were helpful:
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