Kentzo / ShortcutRecorder

The best control to record shortcuts on macOS, written in ObjC with Swift in mind
Other
575 stars 115 forks source link

Linking with CocoaPods #58

Closed larsblumberg closed 8 years ago

larsblumberg commented 8 years ago

I would prefer using CocoaPods over a git submodule. Did anybody have success in doing so?

When I add a dependency to my Podfile

pod 'ShortcutRecorder', :git => 'https://github.com/Kentzo/ShortcutRecorder.git', :tag => '2.15'

Xcode will spit out this error when running the app that makes use of a SRRecorderControl in its storyboard:

Failed to set (contentViewController) user defined inspected property on (NSWindow): Unable to find bundle with resources.

Additionally, the control is not displayed in the storyboard. Xcode shows this error here:

file:///Users/.../shortcutrecorder-demo/Base.lproj/Main.storyboard: error: IB Designables: Failed to render instance of SRRecorderControl: The agent threw an exception.
Kentzo commented 8 years ago

@larsblumberg Could you upload a demo project that would demonstrate the issue?

Kentzo commented 8 years ago

@larsblumberg Also try http://stackoverflow.com/questions/29933691/ibdesignable-from-external-framework and let me know if it works: I'll update the README.

larsblumberg commented 8 years ago

Uploaded a simple project, it just has a CocoaPods dependency to ShortcutRecorder and a SRRecorderControl added to its storyboard: https://github.com/larsblumberg/shortcutrecorder-cocoapods-demo

larsblumberg commented 8 years ago

I didn't have success when following the steps from the cited stackoverflow answer. I'm not even sure if I applied the suggestion correctly.

Kentzo commented 8 years ago

@larsblumberg Try version from the issue-58 branch.

larsblumberg commented 8 years ago

Branch issue-58 fixes both issues (*) – the control not appearing at runtime and in the storyboard. Great! Will you merge to master?

(*) I've updated https://github.com/larsblumberg/shortcutrecorder-cocoapods-demo to use the issue-58 branch to test.

PS: Xcode says that there's a [super dealloc] missing in PTKeyCodeTranslator.m / (void)dealloc{}

Kentzo commented 8 years ago

Hmm, I don't really support PT these days. I'll see into this issue though.

Overall, I'd suggest to find a modern alternative to register global shortcuts.

larsblumberg commented 8 years ago

I personally don't use the PT feature. Xcode had me just pointed to that issue.

Kentzo commented 8 years ago

I wonder if it's possible with CocoaPods to opt out this framework from building.

Kentzo commented 8 years ago

@larsblumberg Merged and released 2.16

larsblumberg commented 8 years ago

@Kentzo Thank you very much!

larsblumberg commented 8 years ago

@Kentzo It's possible to opt out PT if you create a Core subspec. By then only specifying pod 'ShortcutRecorder/Core' CocoaPods would install the core part w/o PTHotKey.

See here: https://github.com/jverkoey/nimbus/blob/master/Nimbus.podspec and also here: http://stackoverflow.com/questions/20345566/how-do-you-install-a-pods-sub-spec-without-installing-the-whole-pod

Kentzo commented 8 years ago

@larsblumberg PR is welcome :)

larsblumberg commented 8 years ago

Will prepare a PR

larsblumberg commented 8 years ago

https://github.com/Kentzo/ShortcutRecorder/pull/60