How to convert this code from Swift to Objective C -
private var distance: double { return fabs(max - min) }
how define variable in objective c language.
in .m file:
@interface myclass () @property (nonatomic, assign, readonly) double distance; @end @implementation myclass -(double)distance { return fabs(max - min); } @end
Comments
Post a Comment