Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TNCheckBoxData.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <Foundation/Foundation.h>

@interface TNCheckBoxData : NSObject
@interface TNCheckBoxData : NSObject <NSCopying>

@property (nonatomic, copy) NSString *identifier;
@property (nonatomic) NSInteger tag;
Expand Down
26 changes: 26 additions & 0 deletions src/TNCheckBoxData.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,32 @@

@implementation TNCheckBoxData

#pragma mark - Copying
- (id)copyWithZone:(NSZone *)zone
{
TNCheckBoxData *copy = [[[self class] allocWithZone:zone] init];

if (copy) {
copy.identifier = self.identifier;
copy.tag = self.tag;
copy.checked = self.checked;

copy.labelText = self.labelText;
copy.labelFont = self.labelFont;
copy.labelColor = self.labelColor;

copy.labelMarginLeft = self.labelMarginLeft;
copy.labelWidth = self.labelWidth;
copy.labelHeight = self.labelHeight;

copy.labelBorderWidth = self.labelBorderWidth;
copy.labelBorderCornerRadius = self.labelBorderCornerRadius;
copy.labelBorderColor = self.labelBorderColor;
}

return copy;
}

#pragma mark - Debug
- (NSString *)description {
return [NSString stringWithFormat:@"[TNCheckBoxData] Identifier: %@ - Tag: %i - Checked: %d", self.identifier, self.tag, self.checked];
Expand Down
16 changes: 16 additions & 0 deletions src/TNCircularCheckBoxData.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@

@implementation TNCircularCheckBoxData

#pragma mark - Copying
- (id)copyWithZone:(NSZone *)zone
{
TNCircularCheckBoxData *copy = [super copyWithZone:zone];

if (copy) {
copy.borderColor = self.borderColor;
copy.circleColor = self.circleColor;

copy.borderRadius = self.borderRadius;
copy.circleRadius = self.circleRadius;
}

return copy;
}

#pragma mark - Getters and setters
- (UIColor *)borderColor {

Expand Down
13 changes: 13 additions & 0 deletions src/TNFillCheckBoxData.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,17 @@

@implementation TNFillCheckBoxData

#pragma mark - Copying
- (id)copyWithZone:(NSZone *)zone
{
TNFillCheckBoxData *copy = [super copyWithZone:zone];

if (copy) {
copy.labelBgNormalColor = self.labelBgNormalColor;
copy.labelBgSelectedColor = self.labelBgSelectedColor;
}

return copy;
}

@end
13 changes: 13 additions & 0 deletions src/TNImageCheckBoxData.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,17 @@

@implementation TNImageCheckBoxData

#pragma mark - Copying
- (id)copyWithZone:(NSZone *)zone
{
TNImageCheckBoxData *copy = [super copyWithZone:zone];

if (copy) {
copy.checkedImage = self.checkedImage;
copy.uncheckedImage = self.uncheckedImage;
}

return copy;
}

@end
18 changes: 18 additions & 0 deletions src/TNRectangularCheckBoxData.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@

@implementation TNRectangularCheckBoxData

#pragma mark - Copying
- (id)copyWithZone:(NSZone *)zone
{
TNRectangularCheckBoxData *copy = [super copyWithZone:zone];

if (copy) {
copy.borderColor = self.borderColor;
copy.rectangleColor = self.rectangleColor;

copy.borderWidth = self.borderWidth;
copy.borderHeight = self.borderHeight;
copy.rectangleWidth = self.rectangleWidth;
copy.rectangleHeight = self.rectangleHeight;
}

return copy;
}

#pragma mark - Getters and setters
- (UIColor *)borderColor {

Expand Down