gpt4 book ai didi

ios - 我们如何检测和保存写在 iPhone/iPad 触摸屏上的文本?

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:44:35 27 4
gpt4 key购买 nike

<分区>

我有一个 TableView 。
如果我用手指在 iPhone/iPod 触摸屏上写字/文本。

我的任务是
我们如何检测写在屏幕上的文本?
还有我们如何将该文本保存在我的表中?

示例链接:See this

实际上这是我为 touchBegun、touchMoved、touchEnd 事件编写的代码。这很好用。但是我怎样才能完成上述任务呢?

- (void) touchesMoved:(NSSet *)toucheswithEvent:(UIEvent *)event {
NSUInteger touchCount = [touches count];
NSUInteger tapCount = [[touches object] tapCount];
label.text = @"touchesMoved";
statusLabel.text = [NSString stringWithFormat:@"%d touches", touchCount];
tapStatusLabel.text = [NSString stringWithFormat:@"%d taps", tapCount];
}

- (void) touchesBegan:(NSSet *)toucheswithEvent:(UIEvent *)event {
NSUInteger touchCount = [touches count];
NSUInteger tapCount = [[touches object] tapCount];
label.text = @"touchesBegan";
statusLabel.text = [NSString stringWithFormat:@"%d touches", touchCount];
tapStatusLabel.text = [NSString stringWithFormat:@"%d taps", tapCount];
}

- (void) touchesEnded:(NSSet *)toucheswithEvent:(UIEvent *)event {
NSUInteger touchCount = [touches count];
NSUInteger tapCount = [[touches object] tapCount];
label.text = @"touchesEnded";
statusLabel.text = [NSString stringWithFormat:@"%d touches", touchCount];
tapStatusLabel.text = [NSString stringWithFormat:@"%d taps", tapCount];
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com