Support both OSX and iOS platform