Archived
1

Added Target-Action

This commit is contained in:
Kim Wittenburg
2014-09-07 16:49:36 +02:00
parent d30dbdda9b
commit 7ee3ca4bb9
2 changed files with 12 additions and 0 deletions

View File

@@ -25,4 +25,7 @@
@property (nonatomic, getter = isEditable) BOOL editable; @property (nonatomic, getter = isEditable) BOOL editable;
@property (nonatomic, strong) MPRangePath *selection; @property (nonatomic, strong) MPRangePath *selection;
@property (nonatomic, weak) id target;
@property (nonatomic) SEL action;
@end @end

View File

@@ -275,6 +275,15 @@
} }
} }
- (void)insertNewline:(id)sender
{
if (self.target && self.action) {
[self.target performSelector:self.action
withObject:self
afterDelay:0.0];
}
}
- (void)moveRight:(id)sender - (void)moveRight:(id)sender
{ {
if (self.selection.length > 0) { if (self.selection.length > 0) {