Skip to content

Commit 9a106d0

Browse files
authored
Replace all Apple glyph names with their HTML code (#20)
close #19
1 parent 57f47c6 commit 9a106d0

File tree

2 files changed

+43
-28
lines changed

2 files changed

+43
-28
lines changed

.github/CONTRIBUTING.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,25 @@
22

33
Pull requests are welcome! We only ask that you follow these steps:
44

5-
1. If adding a new tip, be sure it is specific to using Xcode, not a general coding tip.
6-
2. Conform to the existing pattern for listing a tip.
5+
1. If adding a new tip, be sure it is specific to **using Xcode**, not a general coding tip.
6+
1. Conform to the existing pattern for listing a tip.
77
1. Place it under the correct category.
8-
2. Give it a brief but descriptive heading.
9-
3. Provide a concise explanation.
10-
4. Link to the original source (a blog post, a tweet, etc.), if any, to give credit to the person who shared it.
11-
5. If there isn't a post or a tweet, and it is just a tip you want to share, credit yourself! 😄
8+
1. Give it a brief but descriptive heading.
9+
1. Provide a concise explanation.
10+
1. Keyboard shortcuts should be **bold** and use glyph symbols like ⌘ and ⇧ rather than symbol names like `cmd` and `shift`, etc. See the table below and follow existing examples.
11+
1. Link to the original source:
12+
1. A blog post, a tweet, etc. to give credit to the person who shared it.
13+
1. If there isn't a post or a tweet, and it is just a tip you want to share, credit yourself! 😄
14+
15+
### Quick reference for Apple symbol glyphs
16+
17+
| Symbol name | Glyph | HTML code |
18+
| --------| :---: | :---: |
19+
| Command | ⌘ | `⌘` |
20+
| Option | ⌥ | `⌥` |
21+
| Control | ⌃ | `⌃` |
22+
| Shift | ⇧ | `⇧` |
23+
| Arrow up | ↑ | `↑` |
24+
| Arrow down | ↓ | `↓` |
25+
| Arrow left | ← | `←` |
26+
| Arrow right | → | `→` |

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Source: [Jesse Squires](https://www.jessesquires.com/blog/2020/01/21/xcode-tip-b
3636

3737
### Quickly toggling breakpoints
3838

39-
Use `cmd \` to toggle a breakpoint on the current line.
39+
Use **⌘ \\** to toggle a breakpoint on the current line.
4040

4141
Source: [Paul Hudson](https://www.hackingwithswift.com/articles/229/24-quick-xcode-tips)
4242

@@ -94,7 +94,7 @@ Source: [Paul Hudson](https://www.hackingwithswift.com/articles/229/24-quick-xco
9494

9595
### Apply all fix-its
9696

97-
Go to the Editor menu and choose Fix All Issues to apply fix-its all at once.
97+
Go to the Editor menu and choose Fix All Issues (**⌃⌥⌘ F**) to apply fix-its all at once.
9898

9999
Source: [Paul Hudson](https://www.hackingwithswift.com/articles/229/24-quick-xcode-tips)
100100

@@ -129,57 +129,57 @@ Source: [Michael Tsai](https://mjtsai.com/blog/2018/03/27/nsdoublelocalizedstrin
129129

130130
### Jump to a specific line
131131

132-
Open the file you want. Press `cmd L`, type a line number and Xcode will jump directly to that line.
132+
Open the file you want. Press **⌘L**, type a line number and Xcode will jump directly to that line.
133133

134134
### Reindenting/Formatting code
135135

136-
Press `ctrl I` to apply Xcode's indentation and formatting.
136+
Press **⌃I** to apply Xcode's indentation and formatting.
137137

138138
### Adding comments quickly
139139

140-
Use `cmd /` to toggle comments for the current line or selection. Use `cmd option /`, pressed directly before a method to have Xcode generate a documentation comment.
140+
Use **⌘/** to toggle comments for the current line or selection. Use **⌥⌘/**, pressed directly before a method to have Xcode generate a documentation comment.
141141

142142
Source: [Paul Hudson](https://www.hackingwithswift.com/articles/229/24-quick-xcode-tips)
143143

144144
### Jump to file in source navigator
145145

146-
Press `cmd shift J` to quickly jump to the current open file in the navigator to easily see and select related files.
146+
Press **⌘⇧J** to quickly jump to the current open file in the navigator to easily see and select related files.
147147

148148
Source: [Jeroen Leenarts](https://leenarts.net/2020/02/18/frequently-used-keyboard-shortcuts-i-use-inwith-xcode/)
149149

150150
### Open the jump bar
151151

152-
Press `ctrl 6` to open the symbol jump bar in Xcode. Now start typing. Try it, jumping to a function in the current file, never has been so easy.
152+
Press **⌃6** to open the symbol jump bar in Xcode. Now start typing. Try it, jumping to a function in the current file, never has been so easy.
153153

154154
Source: [Jeroen Leenarts](https://leenarts.net/2020/02/18/frequently-used-keyboard-shortcuts-i-use-inwith-xcode/)
155155

156156
### Remapping unhelpful keys
157157

158-
Some great shortcuts (e.g. `cmd shift O` for Open Quickly) are next to useless shortcuts (`cmd shift P`, for the never times you want to print code.) It takes only seconds to remove unhelpful keys, and you can even remap things like `cmd P` to resuming SwiftUI's preview.
158+
Some great shortcuts (e.g. **⇧⌘O** for Open Quickly) are next to useless shortcuts (**⇧⌘P**, for the never times you want to print code.) It takes only seconds to remove unhelpful keys, and you can even remap things like **⌘P** to resuming SwiftUI's preview.
159159

160160
Source: [Paul Hudson](https://www.hackingwithswift.com/articles/229/24-quick-xcode-tips)
161161

162162
### Increase or decrease editor font size
163163

164-
Press `cmd +` to increase and `cmd -` to decrease.
164+
Press **⌘+** to increase and **⌘-** to decrease.
165165

166166
### Move cursor to the top or bottom of the file
167167

168-
Press `cmd UpArrow` to move to the top of the file. Press `cmd DownArrow` to move to the bottom of the file.
168+
Press **⌘↑** to move to the top of the file. Press **⌘↓** to move to the bottom of the file.
169169

170170
### Show and hide debug area
171171

172-
Press `cmd shift Y` to open and close the debug area.
172+
Press **⌘⇧Y** to open and close the debug area.
173173

174174
### Generating an interface file
175175

176-
Press `cmd ctrl UpArrow` to display a generated interface, showing properties, function signatures, and comments for a type. Press it again, to jump to tests for that file if they exist.
176+
Press **⌃⌘⇧** to display a generated interface, showing properties, function signatures, and comments for a type. Press it again, to jump to tests for that file if they exist.
177177

178178
Source: [Paul Hudson](https://www.hackingwithswift.com/articles/229/24-quick-xcode-tips)
179179

180180
### Open Human Interface Guidelines
181181

182-
Press `cmd shift H` to open the Human Interface Guidelines in your web browser.
182+
Press **⌘⇧H** to open the Human Interface Guidelines in your web browser.
183183

184184
# [Refactoring](#refactoring)
185185

@@ -219,19 +219,19 @@ Source: [Ole Begemann](https://oleb.net/blog/2017/07/xcode-9-text-macros/)
219219
### Improving the assistant editor
220220

221221
1. Set “Uses Focused Editor” in the Navigation preferences
222-
1. `cmd J` to switch between panes or open new ones
223-
1. `cmd shift O` to open files in the currently focused pane
222+
1. **⌘J** to switch between panes or open new ones
223+
1. **⌘⇧O** to open files in the currently focused pane
224224

225225
Source: [Jesse Squires](https://www.jessesquires.com/blog/2018/06/12/xcode-tip-improving-assistant-editor/)
226226

227227
### Navigation using the assistant editor
228228

229229
The assistant editor is very useful for navigating around while remaining at your original position:
230230

231-
- Use `cmd option ,` to open the current location in the neighbouring editor
232-
- Hold `cmd ctrl option` and click on any method to jump to that method in the neighbouring editor (`cmd ctrl` opens in the current editor)
233-
- `cmd ctrl UpArrow` to switch between associated files, and `cmd ctrl option UpArrow` to do so using the neighbouring editor
234-
- `cmd ctrl LeftArrow` and `cmd ctrl RightArrow` to move back and forward through navigation history, add `option` for their neighbouring editor counterparts
231+
- Use **⌘⌥,** to open the current location in the neighbouring editor
232+
- Hold **⌘⌃⌥** and click on any method to jump to that method in the neighbouring editor (**⌘⌃** opens in the current editor)
233+
- **⌘⌃↑** to switch between associated files, and **⌘⌃⌥↑** to do so using the neighbouring editor
234+
- **⌘⌃←** and **⌘⌃→** to move back and forward through navigation history, add **⌥** for their neighbouring editor counterparts
235235

236236
### Using behaviors to improve debugging
237237

@@ -257,13 +257,13 @@ Source: [Jesse Squires](https://www.jessesquires.com/blog/2020/04/13/fully-autom
257257

258258
### Re-run your last test
259259

260-
Use `cmd ctrl option G` to re-run your last test. [Jon Reid](https://twitter.com/qcoding) has a name for this making it easier to remember: “smash go!”
260+
Use **⌃⌥⌘G** to re-run your last test. [Jon Reid](https://twitter.com/qcoding) has a name for this making it easier to remember: “smash go!”
261261

262262
Source: [Paul Hudson](https://www.hackingwithswift.com/articles/229/24-quick-xcode-tips)
263263

264264
### Randomizing test order
265265

266-
Go to the Product menu, hold down `option`, then click Test. Inside the Info tab, click Options then check Randomize Execution Order to run tests in a different order every time.
266+
Go to the Product menu, hold down **⌥**, then click Test. Inside the Info tab, click Options then check Randomize Execution Order to run tests in a different order every time.
267267

268268
Source: [Paul Hudson](https://www.hackingwithswift.com/articles/229/24-quick-xcode-tips)
269269

@@ -275,7 +275,7 @@ Source: [Jesse Squires](https://www.jessesquires.com/blog/2021/03/17/xcode-ui-te
275275

276276
### Testing in-app purchases
277277

278-
Make a new StoreKit Config File, and add your IAP. Now go to the Product menu, hold down Option, and click Run. From the Options tab of the window, change StoreKit Config, and now you'll use the test IAP.
278+
Make a new StoreKit Config File, and add your IAP. Now go to the Product menu, hold down **⌥**, and click Run. From the Options tab of the window, change StoreKit Config, and now you'll use the test IAP.
279279

280280
Source: [Paul Hudson](https://www.hackingwithswift.com/articles/229/24-quick-xcode-tips)
281281

0 commit comments

Comments
 (0)