From 8dc86c9b62f1f2a4649bf9e09b9afe0a92de00c1 Mon Sep 17 00:00:00 2001 From: Aral Balkan Date: Tue, 13 Jan 2015 17:21:27 +0000 Subject: Added explicit instructions for use in Swift The explicit Cocoa import had tripped me up. Would be good to save someone the same hassle.--- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 9a98ddb..17815c5 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,14 @@ _observableKeyPath = [@"values." stringByAppendingString:kPreferenceGlobalShortc context:kGlobalShortcutContext]; ``` +# Using in Swift projects + + 1. Install as a Pod using the latest CocoaPods with Swift support. + 2. Create a bridging header file [using the instructions here](http://swiftalicio.us/2014/11/using-cocoapods-from-swift/) + 3. Your bridging header file should contain the following [two](https://github.com/shpakovski/MASShortcut/issues/36) imports: + #import + #import + # Non-ARC Version If you like retain/release, please check out these forks: [heardrwt/MASShortcut](https://github.com/heardrwt/MASShortcut) and [chendo/MASShortcut](https://github.com/chendo/MASShortcut). However, the preferred way is to enable the `-fobjc-arc` in Xcode source options. -- cgit v1.2.3 From 988fcee20835f2df48bc4d29d351a797eba34a30 Mon Sep 17 00:00:00 2001 From: Vadim Shpakovski Date: Tue, 13 Jan 2015 20:45:29 +0300 Subject: Fix README. --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 17815c5..f4978ff 100644 --- a/README.md +++ b/README.md @@ -100,8 +100,11 @@ _observableKeyPath = [@"values." stringByAppendingString:kPreferenceGlobalShortc 1. Install as a Pod using the latest CocoaPods with Swift support. 2. Create a bridging header file [using the instructions here](http://swiftalicio.us/2014/11/using-cocoapods-from-swift/) 3. Your bridging header file should contain the following [two](https://github.com/shpakovski/MASShortcut/issues/36) imports: - #import - #import + +```objective-c +#import +#import +``` # Non-ARC Version -- cgit v1.2.3 From cfc4bd64d0f5d784633b7ae5d9faf8a6a657f239 Mon Sep 17 00:00:00 2001 From: Tomáš Znamenáček Date: Wed, 14 Jan 2015 09:59:28 +0100 Subject: Updated headerdoc markup for MASShortcutView+Bindings. --- Framework/MASShortcutView+Bindings.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Framework/MASShortcutView+Bindings.h b/Framework/MASShortcutView+Bindings.h index b0148e7..8cc84df 100644 --- a/Framework/MASShortcutView+Bindings.h +++ b/Framework/MASShortcutView+Bindings.h @@ -1,19 +1,19 @@ #import "MASShortcutView.h" /** - @brief A simplified interface to bind the recorder value to user defaults. + A simplified interface to bind the recorder value to user defaults. - You can bind the @p shortcutValue to user defaults using the standard - @p bind:toObject:withKeyPath:options: call, but since that’s a lot to type + You can bind the `shortcutValue` to user defaults using the standard + `bind:toObject:withKeyPath:options:` call, but since that’s a lot to type and read, here’s a simpler option. - Setting the @p associatedUserDefaultsKey binds the view’s shortcut value + Setting the `associatedUserDefaultsKey` binds the view’s shortcut value to the given user defaults key. You can supply a value transformer to convert - values between user defaults and @p MASShortcut. If you don’t supply - a transformer, the @p NSUnarchiveFromDataTransformerName will be used + values between user defaults and `MASShortcut`. If you don’t supply + a transformer, the `NSUnarchiveFromDataTransformerName` will be used automatically. - Set @p associatedUserDefaultsKey to @p nil to disconnect the binding. + Set `associatedUserDefaultsKey` to `nil` to disconnect the binding. */ @interface MASShortcutView (Bindings) -- cgit v1.2.3 From bdb64f0177a9bac79002ac929d0328b32f10143c Mon Sep 17 00:00:00 2001 From: Tomáš Znamenáček Date: Wed, 14 Jan 2015 10:03:31 +0100 Subject: Use the clear glyph instead of backspace for clearing a shortcut. The recording control used to display the backspace glyph (U+232B) on the button that clears the shortcut. That’s a bit confusing, since the same backspace glyph can also appear inside the control, representing the recorded shortcut. The clear glyph (U+2715, diagonal cross) seems like a better fit – it’s already used in similar context throughout the Apple UIs like search bars. --- Framework/MASShortcutView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Framework/MASShortcutView.m b/Framework/MASShortcutView.m index aace67e..9f26e07 100644 --- a/Framework/MASShortcutView.m +++ b/Framework/MASShortcutView.m @@ -188,7 +188,7 @@ NSString *const MASShortcutBinding = @"shortcutValue"; - (void)drawRect:(CGRect)dirtyRect { if (self.shortcutValue) { - [self drawInRect:self.bounds withTitle:NSStringFromMASKeyCode(self.recording ? kMASShortcutGlyphEscape : kMASShortcutGlyphDeleteLeft) + [self drawInRect:self.bounds withTitle:NSStringFromMASKeyCode(self.recording ? kMASShortcutGlyphEscape : kMASShortcutGlyphClear) alignment:NSRightTextAlignment state:NSOffState]; CGRect shortcutRect; -- cgit v1.2.3