Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Serialisation for canvas layout element
  • Loading branch information
drpancake committed Apr 18, 2012
1 parent d18e741 commit bb87345
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions layout/CBCanvas.m
Expand Up @@ -21,4 +21,17 @@ - (id)initWithJSON:(NSDictionary *)json
return self;
}

- (NSDictionary *)toJSON
{
NSDictionary *base = [super toJSON];
NSMutableDictionary *json = [[NSMutableDictionary alloc] initWithDictionary:base];

if (self.points) {
[json setObject:self.points forKey:@"points"];
}

// Copy to immutable
return [NSDictionary dictionaryWithDictionary:json];
}

@end

0 comments on commit bb87345

Please sign in to comment.