Add init method to Tokenizer header and extend to accept string parameter

This commit is contained in:
iska
2014-10-24 01:06:21 +02:00
parent 5d3ea61a04
commit 9e198c9766
2 changed files with 5 additions and 1 deletions
+2
View File
@@ -15,4 +15,6 @@
*/
@interface HTMLTokenizer : NSObject <NSFastEnumeration>
- (instancetype)initWithString:(NSString *)string;
@end
+3 -1
View File
@@ -53,7 +53,7 @@
#pragma mark - Lifecycle
- (instancetype)init
- (instancetype)initWithString:(NSString *)string
{
self = [super init];
if (self) {
@@ -62,6 +62,8 @@
[self setupStateMachine];
_tokens = [NSMutableArray new];
_inputStreamReader = [[HTMLInputStreamReader alloc] initWithString:string];
}
return self;
}