I'm trying to implement the Objective-C library, ORSSerialPort into my Swift project.
The example provided with the library provides the following setup for the ORSSerialPortManager class:
ORSSerialPortManager *portManager = [ORSSerialPortManager sharedSerialPortManager];
Should something such as this not be able to take it's place in Swift?
ORSSerialPortManager = ORSSerialPortManager.sharedSerialPortManager()
Perhaps with the pointer something like this?
ORSSerialPortManager = withUnsafePointer(&ORSSerialPortManager, ORSSerialPortManager.sharedSerialPortManager())
I get the errors: 'Cannot assign to the result of this expression', and 'Expressions are not allowed at the top level'. What has to change?