Skip to content

Commit 7acb135

Browse files
committed
Initial commit.
0 parents  commit 7acb135

20 files changed

+896
-0
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Xcode
2+
.DS_Store
3+
build/
4+
*.pbxuser
5+
!default.pbxuser
6+
*.mode1v3
7+
!default.mode1v3
8+
*.mode2v3
9+
!default.mode2v3
10+
*.perspectivev3
11+
!default.perspectivev3
12+
*.xcworkspace
13+
!default.xcworkspace
14+
xcuserdata
15+
profile
16+
*.moved-aside
17+
DerivedData
18+
.idea/

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# SCXcodeSwitchExpander
2+
3+
SCXcodeSwitchExpander is a small Xcode plugin that expands switch statements by inserting missing cases.
4+
5+
### Features
6+
7+
- inserts all possible switch cases
8+
9+
- keeps already used cases and only inserts missing ones (even if the type changes)
10+
11+
- only keeps the 'default:' case when used with the built-in Xcode snippet
12+
13+
- works on ivars, properties, method parameters etc.
14+
15+
- works with nested switches
16+
17+
- hooks into the undo manager stack (makes it easier to fix typos)
18+
19+
- fast and reliable (won't affect Xcode's performance in any signinficant way)
20+
21+
### Screenshots
22+
23+
- Replacing the default Xcode snippet
24+
![DefaultSnippet](https://dl.dropboxusercontent.com/u/12748201/SCXcodeSwitchExpander/SCXcodeSwitchExpander1.gif)
25+
26+
- Inserting missing cases
27+
![MissingInsertion](https://dl.dropboxusercontent.com/u/12748201/SCXcodeSwitchExpander/SCXcodeSwitchExpander2.gif)
28+
29+
### Known Issues
30+
31+
- takes a bit for it to kick in after starting Xcode as it's waiting for the IDEIndexDidChange notification. I found that building the project usually makes that happen.
32+
33+
- only works with NS_ENUM but keeps default Xcode behavior for old style enums
34+
35+
### Installation
36+
37+
- Build the project and restart Xcode or ...
38+
39+
- Download SCXcodeSwitchExpander.xcplugin.zip from the releases tab, unzip and move it to the Xcode plugins folder ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SCXcodeSwitchExpander.xcplugin and restart Xcode or ...
40+
41+
- Get it through [Alcatraz](https://github.com/supermarin/Alcatraz)
42+
43+
- If you encounter any issues you can uninstall it by removing the ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SCXcodeSwitchExpander.xcplugin folder
44+
45+
### Contact
46+
Any suggestions or improvements are more than welcome. Feel free to contact me at [stefan.ceriu@yahoo.com](mailto:stefan.ceriu@yahoo.com) or [@stefanceriu](https://twitter.com/stefanceriu).
47+
48+
49+
### License
50+
51+
MIT License
52+
53+
Copyright (c) 2014 Stefan Ceriu
54+
55+
Permission is hereby granted, free of charge, to any person obtaining a copy of
56+
this software and associated documentation files (the "Software"), to deal in
57+
the Software without restriction, including without limitation the rights to use,
58+
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
59+
Software, and to permit persons to whom the Software is furnished to do so,
60+
subject to the following conditions:
61+
62+
The above copyright notice and this permission notice shall be included in all
63+
copies or substantial portions of the Software.
64+
65+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
66+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
67+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
68+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
69+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
70+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
71+

0 commit comments

Comments
 (0)