Refactor LongPressGestureRecognizer to make it Swift 1.2 compatible

RESOLVED FIXED

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: st3fan, Assigned: st3fan)

Tracking

unspecified
All
iOS 8
Dependency tree / graph

Firefox Tracking Flags

(fennec+)

Details

(Assignee)

Description

4 years ago
The LongPressGestureRecognizer is difficult to make Swift 1.2 compatible because of the way it's initializers are organized.

When looking at the code I realized that there actually is way too much logic in the UIGestureRecognizer subclass: the only thing it should do is captire the long press and then fire a delegate so that the BVC can handle it.

So I think it is best to refactor this code a bit and kill two bugs with one stone. Not a rewrite, just reorganize the code a bit.

Setting tracking-fennec because this needs to be done for the Swift 1.2 move.
Blocks: 1152609
OS: Mac OS X → iOS 8
Hardware: x86 → All
Status: NEW → ASSIGNED
(Assignee)

Comment 2

4 years ago
Just a quick note about the code: I was able to get rid of the UIGestureRecognizer subclass completely. All code is now contained in a BrowserHelper which emits a delegate callback to the BVC which handles showing the actual action sheet.
https://github.com/mozilla/firefox-ios/commit/2b60f9547461f0196f68e9a79471d4ea91938cd1
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.