r/iOSProgramming • • Dec 21 '20

Solved! Did you know? In Xcode you can now access refactoring features simply with a Command + click on a type 😎

215 Upvotes

18 comments sorted by

13

u/MankAndInd Dec 21 '20

It’s weird that it adds constructor above the class variable declarations. Don’t most people put variable declarations first?

1

u/VincentPradeilles Dec 21 '20

Agreed that it is indeed not the best position...

1

u/BarAgent Dec 22 '20

I don’t. I think this is one of those things that varies widely.

0

u/[deleted] Dec 21 '20

[deleted]

2

u/MankAndInd Dec 22 '20

Yeah it’s annoying; I always have to move them.

58

u/SirensToGo Objective-C / Swift Dec 21 '20

neat, now i can crash xcode even faster

10

u/well___duh Dec 21 '20

My biggest pet peeve with xcode for about 3 years now, you can't rename anything more than once.

Just try it:

  1. Rename anything and see that xcode allows for this to happen

  2. Try to rename something else (or the same thing, doesn't matter). Xcode will hang forever.

4

u/[deleted] Dec 21 '20

I haven’t been able to do that since swift was released. Before Swift, Objective-C programming was really reliable with the Xcode convenience tools but it all went down hill for me in 2014.

2

u/mawesome4ever Dec 22 '20

Ah, 2014, the year I became an adult. You and I both.

6

u/XmasRights Dec 21 '20

Love this feature - HATE that it puts the initialiser before the property declarations. WHO DOES THAT?!

4

u/Lythox Dec 21 '20

Cmd + ctrl + click is a nice one too to go to the declaration of something

1

u/JOyo246 SwiftUI Dec 21 '20

Yep! Callers is nice too.

3

u/crematory7 Dec 21 '20

Cool😎

2

u/FrozenPyromaniac_ Dec 21 '20

Yep, they really leaned into it with swiftui. You can quickly extract sub views, embed views in stacks and some more stuff

2

u/[deleted] Dec 21 '20

Refactoring with option click was already possible. Since I don’t know Xcode 5?

1

u/[deleted] Dec 22 '20

Yeah, it was possible for a while but if it works at all, it's still crap. Mostly it simply doesn't work.

0

u/VincentPradeilles Dec 23 '20

To learn a few more tricks about Xcode’s refactoring tool 👉 https://youtu.be/zZoiqQhHUCs‬