开发者

is it possible to custom commitEditingStyle?

开发者 https://www.devze.com 2022-12-20 17:33 出处:网络
Quick question here. I\'m implementing a UITableView with cells, some of the cells contain links. I would like to use something like the commitEditingStyle so when a user swipe a specific row, it wi

Quick question here.

I'm implementing a UITableView with cells, some of the cells contain links.

I would like to use something like the commitEditingStyle so when a user swipe a specific row, it will show a custom message instead of Delete or Insert, i want it to be Mail so i'll be able to mail a link to someone.

Is that possible ? i'm currently using an Alert, and I would like to chan开发者_开发百科ge that to a swipe.

Thanks in advance.


First, it's going to be very challenging to not confuse the user if you change swiping a tableview cell to do something other than delete. Maybe you've got something in mind that will make this non-standard interface very clear and discoverable to the user, but be very careful before you change the meaning of a well-established gesture.

That said, there is no built-in swipe handling in 3.1. Since 3.2 is still in beta, I won't discuss the details here, but read the "What's new in iPhone OS 3.2" on the beta site for helpful information if you're writing to 3.2.

For 3.1, you'd likely need to subclass the table cell to override touchesBegan:withEvent:, etc. See Handling Swipe and Drag Gestures for full details on how to implement this by hand.

0

精彩评论

暂无评论...
验证码 换一张
取 消