aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Shpakovski2013-04-16 14:59:09 +0300
committerVadim Shpakovski2013-04-16 14:59:09 +0300
commit86443bc53c24cb99b7236c0ce382d701170e3449 (patch)
tree964f0c5e6d72b7b3122096aee6bdbda94bee3f54
parent278c5fa2a5f50b1281929179a570403b605015e5 (diff)
downloadMASShortcut-1.2.tar.bz2
Adding syntax highlighting to the usage section.1.2
-rw-r--r--README.md23
1 files changed, 12 insertions, 11 deletions
diff --git a/README.md b/README.md
index c8c839c..67bc92c 100644
--- a/README.md
+++ b/README.md
@@ -8,20 +8,21 @@ The project MASShortcut introduces modern API and user interface for recording,
I hope, it is really easy:
- // Drop a custom view into XIB and set its class to MASShortcutView
- @property (nonatomic, weak) IBOutlet MASShortcutView *shortcutView;
+```objective-c
+// Drop a custom view into XIB and set its class to MASShortcutView
+@property (nonatomic, weak) IBOutlet MASShortcutView *shortcutView;
- // Think up a preference key to store a global shortcut between launches
- NSString *const kPreferenceGlobalShortcut = @"GlobalShortcut";
+// Think up a preference key to store a global shortcut between launches
+NSString *const kPreferenceGlobalShortcut = @"GlobalShortcut";
- // Assign the preference key and the shortcut view will take care of persistence
- self.shortcutView.associatedUserDefaultsKey = kPreferenceGlobalShortcut;
+// Assign the preference key and the shortcut view will take care of persistence
+self.shortcutView.associatedUserDefaultsKey = kPreferenceGlobalShortcut;
- // Execute your block of code automatically when user triggers a shortcut from preferences
- [MASShortcut registerGlobalShortcutWithUserDefaultsKey:kPreferenceGlobalShortcut handler:^{
-
- // Let me know if you find a better or more convenient API.
- }];
+// Execute your block of code automatically when user triggers a shortcut from preferences
+[MASShortcut registerGlobalShortcutWithUserDefaultsKey:kPreferenceGlobalShortcut handler:^{
+ // Let me know if you find a better or more convenient API.
+}];
+```
To set an example, I made a demo project: [MASShortcutDemo](https://github.com/shpakovski/MASShortcutDemo). Enjoy!