I want to check if the iOS version of the device is greater than 3.1.3 I tried things like:
iOS
3.1.3
[[UIDevice currentDevice].systemVersion
As suggested by the official Apple docs: you can use the NSFoundationVersionNumber, from the NSObjCRuntime.h header file.
NSObjCRuntime.h
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) { // here you go with iOS 7 }