Skip to content

Instantly share code, notes, and snippets.

@iiiyu
Created June 25, 2012 06:23
Show Gist options
  • Save iiiyu/2986981 to your computer and use it in GitHub Desktop.
Save iiiyu/2986981 to your computer and use it in GitHub Desktop.
NSString+Version
//
// NSString+Version.m
// FAW-VW
//
// Created by ChenYu Xiao on 12-6-25.
// Copyright (c) 2012年 Sumi Interactive. All rights reserved.
//
#import "NSString+Version.h"
@implementation NSString (Version)
- (BOOL)isOlderVersionThan:(NSString *) otherVersion
{
return ([self compare:otherVersion options:NSNumericSearch] == NSOrderedAscending);
}
- (BOOL)isNewerVersionThan:(NSString *) otherVersion
{
return ([self compare:otherVersion options:NSNumericSearch] == NSOrderedDescending);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment