31

I used to be able to use three finger scroll-up to switch between source/header. Since upgrading to Lion, I it just does a regular scroll. Is there any way to get that feature back?

Aka, it doesn't jump to counterpart when I scroll up / down like it used to.

Update

Apple fixed the issue in Xcode 4.2. So, upgrade your versions.

AWF4vk
  • 5,810
  • 3
  • 37
  • 70
  • I have encountered the same problem. I think this is because of Mission Control gesture which is set on three finger swipe-up. But even if I have changed it to be four finger swipe-up, xcode does not recognise/receive that one. – lukewar Jul 22 '11 at 21:04
  • 1
    I found the fix to this issue here: https://gist.github.com/1132018 – Buyin Brian Aug 30 '11 at 14:38
  • Buyin's fix indeed does work. Follow the directions right here: gist.github.com/1132018 – Todd Hopkinson Oct 27 '11 at 23:19

10 Answers10

25

This is the correct and best answer. It works. It is posted by "@Buyin" above. Another individual commented that it doesn't work. He is wrong. It works, I've confirmed it. It restores the three finger vertical swipe to switch between interface and implementation files (.h and .m) in xCode in Lion.

From your terminal:

Change to appropriate directory (note, if your Library dir is hidden, in the terminal just type the following: chflags nohidden ~/Library )

1. cd /Users/YOURUSERNAME/Library/Preferences/ByHost

List files so you can see the .GlobalPreferences.XXXX-XXXX-XXXX-XXXX.plist

2. ls -lah

Open that plist file in xcode

3. open -a /Applications/Xcode.app ".GlobalPreferences.XXXX-XXXX-XXXX-XXXX.plist"

Set value to 1 for the key "com.apple.trackpad.threeFingerVertSwipeGesture"

Save the plist file

Log out and back into machine

VOILA!

Cœur
  • 37,241
  • 25
  • 195
  • 267
Todd Hopkinson
  • 6,803
  • 5
  • 32
  • 34
  • 1
    Yep, it works. Nice to have that gesture back. And now I take it you will bring this oversight "to Apple's attention so they can fix it"? – Wienke Oct 27 '11 at 23:45
  • 3
    Nope, doesn't work. (Of course it works for YOU, but there's a step missing somewhere, some setting that is different for "us unfortunate people".) Saying "he is wrong" is, well, wrong. *shrug* – Kalle Nov 14 '11 at 16:24
  • Kalle, did you follow the steps, and what doesn't work, specifically. What step did you get stuck at? Did you shut down Xcode first. Did you find the .GlobalPreferences plist file? Did you set the key 'com.apple.trackpad.threeFingerVertSwipeGesture to '1'? – Todd Hopkinson Nov 14 '11 at 18:44
  • 1
    Thank you. Works for me. Also a log out/ login works instead of a restart. – Steve Moser Dec 28 '11 at 16:41
  • I think it's important to add that Terminal wouldn't navigate to that directory in my case, but showing hidden files and using the "Go" menu of Finder did work. – james_womack Jan 18 '12 at 17:48
  • 3
    I had to make a few changes... Firstly, my Xcode.app was downloaded from the App Store and so the path had to be updated to `open -a /Applications/Xcode.app`. Also, there were 4 files with the `.GlobalPreferences` prefix, and since I didn't know which one to change, I ended up changing all four. And lastly (as @SteveMoser writes above), you don't have to restart the machine, simply logging out of your user account and logging back in will suffice. – jowie Mar 22 '12 at 21:13
  • I updated the answer above to account for changes to the directory of Xcode since Xcode is now in new dir from app store. Thanks to "jowie" for your comment with this info... – Todd Hopkinson Jul 26 '12 at 23:39
  • For those who this isn't working for: do you have a magic trackpad? This answer did it for me: http://stackoverflow.com/a/9985510/677620 – Sam Apr 27 '13 at 21:24
10

Given apple took this away (hopefully just for now) the only way I can think of to get this working again would be to install BetterTouchTool[1] and bind the keyboard control - control-cmd-up, ctrl-cmd-down - to the three finger motion. You'd also have to switch the default three finger motion in sys prefs to use four fingers for mission control.

[1] http://blog.boastr.net/

shawnwall
  • 4,549
  • 1
  • 27
  • 38
  • Not a good solution since it would also send the same command to non-XCode apps. I'll just wait for Apple to fix it. – AWF4vk Jul 26 '11 at 22:00
  • 4
    I believe it's possible with BTT to bind to a specific app, but I agree it would be better if apple would just fix it :) – shawnwall Jul 26 '11 at 22:14
  • BetterTouchTool is a great little App! Fixed the XCode problem for me. – Angus Forbes Apr 03 '12 at 20:10
  • I started using BetterTouchTool when I got a magic trackpad because unlike the laptops trackpad, the above fixes weren't working. I still need to try medTechy's solution above which probably takes care of it, then I won't have to have BTT on. – Todd Hopkinson Feb 19 '13 at 18:23
10

As found in internet:

defaults -currentHost write -g "com.apple.trackpad.threeFingerVertSwipeGesture" -int 1

Logout and Login again

Inder Kumar Rathore
  • 39,458
  • 17
  • 135
  • 184
Taras Kalapun
  • 1,761
  • 15
  • 19
5

If you're using an Apple magic trackpad, you'll also need to edit

com.apple.driver.AppleBluetoothMultitouch.trackpad.plist 

which can be found in the

/Users/YOURUSERNAME/Library/Preferences 

directory. Open it and change the threeFingerVertSwipeGesture key to a 1.

Save the *.plist

I also changed both my App Expose and Mission Control swipes to be 4 finder swipes instead of Lion's default 3 finger swipe.

Restart your computer

Hope that helps!

Drew H
  • 1,226
  • 1
  • 12
  • 13
2

The answer from icnivad was so very close to working for me. With one additional step.

From your terminal:

Change to appropriate directory (note, if your Library dir is hidden, in the terminal just type the following: chflags nohidden ~/Library )

1. cd /Users/YOURUSERNAME/Library/Preferences/ByHost

List files so you can see the .GlobalPreferences.XXXX-XXXX-XXXX-XXXX.plist

2. ls -lah

Open that plist file in xcode

3. open -a /Developer/Applications/Xcode.app ".GlobalPreferences.XXXX-XXXX-XXXX-XXXX.plist"

Set value to 1 for the key "com.apple.trackpad.threeFingerVertSwipeGesture"

Save the plist file

Restart machine

THEN

Make sure the "Three finger drag" System Preference is disabled. This seems to take precedence and stop the Xcode gesture from working.

abh
  • 422
  • 6
  • 16
1

This stopped working for me in MacOS Big Sur and the plist changes recommended here didn't fix it for me.

What finally fixed it for me was to go to

System Preferences > Trackpad > More Gestures

and change the setting for "Swipe between pages" to "Swipe with two or three fingers". I suspect setting it to "Swipe with three fingers" would also work.

John Stephen
  • 7,625
  • 2
  • 31
  • 45
1

Looks like you can now switch using a left and right two finger swipe. Seems pretty buggy though, given that this also scrolls the screen. It also switches the butler from automatic to manual mode.

I'm starting to hate the combination of Lion and Xcode.

arsenius
  • 12,090
  • 7
  • 58
  • 76
  • 2
    This doesn't toggle between header and implementation files, it's the equivalent of pressing the back & forward buttons. Still useful, though. – Andrew Vilcsak Aug 09 '11 at 01:19
  • That's interesting, Andrew. It definitely switches between the header and implementation for me. It still seems very unnatural to me. – arsenius Aug 13 '11 at 13:51
  • This is not a fix, but a lousy workaround. What people are looking for is the vertical three finger swipe that we once had and loved before lion/xcode removed it. – Todd Hopkinson Oct 27 '11 at 23:14
1

Apple fixed the issue in Xcode 4.2. So, upgrade your versions.

Have fun coding and mind the occasional crash.

AWF4vk
  • 5,810
  • 3
  • 37
  • 70
  • It's four-fingers up or down now. – erikprice Nov 02 '11 at 20:37
  • @erikprice that just starts mission control for me. It's still 3 up/down. – AWF4vk Nov 04 '11 at 01:13
  • Weird, for me mission control is 3 up. I just noticed the 4 up/down recently, so maybe it came with some software update or other. – erikprice Nov 04 '11 at 15:07
  • 1
    @erikprice That's because you have it set up that way :) System Preferences->Trackpad->More Gestures->Mission Control (you can select 3 or 4 fingers). – AWF4vk Nov 04 '11 at 16:07
  • I'm running 4.2.1 and this gesture doesn't work, even if I switch mission control, etc, to four fingers in prefs. – shawnwall Jan 24 '12 at 01:44
  • I got this to work with Xcode 4.2 or 4.3 but I had to set the "switch between pages" gesture to 3 fingers. Which I don't like. I'm looking for a way to key 2 finger navigation with the three finger up/down gesture for switching .h and .m files. – Steve Moser Apr 28 '12 at 19:38
0

This worked for me in Mountain Lion, XCode 4.6: a busy cat http://monosnap.com/image/iakMgffAeOtp9G04qLdsnb3v5

Tudor
  • 4,137
  • 5
  • 38
  • 54
-1

I think the reason Apple removed the h/m 3-finger swipe is because they expect you to use the "Assistant" editor, which displays the h and m files together, side by side. This works, sort of, on a wide screen, although it is an inefficient use of space. But when you're on the road with a MacBookAir, it's a major handicap. Xcode4 feels like a straitjacket.

Wienke
  • 3,723
  • 27
  • 40
  • I'm always typing anyway so it's easier and faster to use the keyboard shortcut than the mouse. I'd say YMMV but it's Xcode, what are you doing if not typing when you want to switch between the header and implementation? – Sami Samhuri Aug 25 '11 at 23:35
  • I use Xcode 4 on my MacBook Air (11") and the Assistant works fine for me, and I still miss three-finger swipe for the times that I wanted to switch the main editor over to implementation in preparation to open something else (a nib or another class) in the assistant editor. – Peter Hosey Sep 20 '11 at 06:33
  • nope, this is not correct. they don't expect you to use the assistant editor instead. It appears to be an oversight and needs to be brought to Apple's attention so they can fix it. – Todd Hopkinson Oct 27 '11 at 23:04