robb/Cartography — pull request #38 by GarthSnyder (2014-11-15 23:50:41+00:00)
Title: Common ancestor algorithm is not quite right

Thanks for Cartography! This API is infinitely better than the default ones.

The commonSuperview() algorithm in Context.swift is not quite correct. Even though the views themselves get checked for a few common possibilities before the general algorithm is run, they still need to be included in the general search. The specific case that revealed this problem was View A -> intermediate view -> View B.

I reframed the algorithm in terms of a general ancestor sequence just as a Swift kata, but if you want to keep the original code it's just a small change.