Liquid syntax error: 'raw' tag was never closed
For further actions, you may consider blocking this person and/or reporting abuse
Liquid syntax error: 'raw' tag was never closed
For further actions, you may consider blocking this person and/or reporting abuse
Vaibhav Dwivedi -
TaeVon Lewis -
Vaibhav Dwivedi -
Herlandro Hermogenes -
Top comments (15)
As a beginner I must say that this is a great and in depth tutorial, Very nice! But...
"register:sender needs to be connected with the shortcut button.
unregister:sender needs to be connected to the clear shortcut button.
clearButton property needs to be connected to the clear shortcut button.
shortcutButton needs to be connected to the shortcut button."
Sorry but... what? :D
There's one button and there's one text field. Can't figure out which to connect with which action/outlet because you're calling them all "button"
There's screenshots for all things but this one. Would be incredibly great to know what I'm doing wrong.
Hi Patrick,
Thank you for reading and for the kind words!
Sorry for the confusion. There's a mistake in the tutorial. Instead of using a text field and a button I'd recommend two buttons. One is the clear button, and the other is the "set" button.
You may also wish to set default text on the set button so the user knows to click it. You can do that from the storyboard title button property, as well as updating the unregister method
Hey Mitch,
thank you for your reply which explained a lot and now all makes sense, haha :D
If I may grab another minute off you:
How would you go on if there was no MainWindow? I have an existing app and I have the MainStoryboard wired to a ViewController. Like this: thepracticaldev.s3.amazonaws.com/i...
I want this one to pop up when hitting the shortcut. I've tried a few things but nothing worked so far :-/
Thanks again and best regards
Patrick
No problem Patrick :)
Can you show me a screenshot of your Storyboard?
Usually a view controller will have window or something else that it is used in.
One of the exceptions is if you're making a menubar app, in which case you can use NSPopover in your AppDelegate
This code is a little messy (copied it from an old project) but hopefully it is enough to give you an idea of how it works.
Once again: thank you! I guess I'm coming closer to that goal, hehe. Indeed it's a menu bar app. I ran through a "Swift on sundays" session by Paul Hudson and that's why there's a lot of stuff in the AppDelegate.swift and I don't know exactly how to merge both your code and the code that's already there.
Here's the MainStoryboard: thepracticaldev.s3.amazonaws.com/i...
And here's my AppDelegate. Tried to understand that Markdown stuff here but didn't succeed :(
Is the settings window supposed to be a popover as well? Or is that just a separate window that opens when the setting button is clicked?
I would try
1) Adding a popover instance to the AppDelegate
2) Add the main view controller instance to the new popover in the
applicationDidFinishLaunching
methodSomething like this (This is untested!)
Mildly related, I recommend reading this Ray Wenderlich tutorial on menu bar apps, it helped me understand them better - raywenderlich.com/450-menus-and-po...
Thank you! I guess this is far above my skill level. I'm already out on "event monitor" and "instance variable", "fresh controller instance". Funny thing: the moment you sent the reply I was on that exact same site of Ray Wenderlich to find out how to use an image as menu bar icon instead of that mathematical "sum" icon I had used before. I think I will keep learning stuff and get back to this in about 5 years, haha :D
But again: thank you very much. It's doesn't happen too often that people just offer their time to help out in this huge form. And: it shows that there will be a solution in the future when I'm able to understand these things and alter the necessary "things" (Objects? Items? I have no idea at all! :D)
My pleasure Patrick,
The trick is to keep pushing yourself to try different things in your code. The fact that you're already doing this is a great start.
I hope you continue to pursue Swift. It's truly a wonderful language, especially with the new SwiftUI stuff that's arrived recently!
Thanks. And... I'm a fool. I stopped reading the page at "Bet you’re feeling smarter already!" with that little fella flexing. Thought "OK, page end" and quit. I reopened the site to re-read a detail I had missed and saw that there's an entire "Event Monitoring" part following that little dude. NOW I know what you were talking about in the comments of your code.
Well... time for an awkward confession: I'm learning Swift since late 2017 and I even have a few iOS Apps on the App Store. But I am totally new to that thing on macOS. It's very similar in the basics but there're many differences in actions and objects and members of objects etc.
I like Swift a lot. I always like things that show your progress immediately (or tell you what or THAT something went wrong). And as a Mac and iPhone user I can do things for myself. Things I need or always wanted. Yes, it's great. And the day will come when this super small app is done :D
Thanks for motivation - I'll keep practicing :)
Yeah MacOS is a completely different beast! and unfortunately it's really hard to find good tutorials and resources for it which makes it that much harder to build for.
Not only that, you'll often have to rely on old APIs that are really awful to write/read. iOS is much nicer in that sense!
Glad you've got the event monitoring stuff figured out 😀
Not only figured that out. I got the shortcut thing AND the window/popup issues sorted out and finally both up and running now. And that's only because of your help. Thank you. Again and again :)
There are only 2-3 little things left.
Another good thing is that not everything is different from iOS. I just learned that UserDefaults work the exact same way. At least this was a hattrick scored within seconds, hehe.
Phew... by the way: if you don't understand any things I write feel free to ask. Just a German digging in pale memories of English lessons from over 25 years ago, haha.
That's great to hear! And yeah being able to share code between iOS and MacOS is really handy :).
Don't worry your English seems pretty good to me, I didn't even noticed until the screenshot you sent had German in it, haha :D.
I'm a bit new to Xcode and swift and I got the hotels working for bringing the window up... But it's doesn't seem to works for the caps lock button.. It'll decide the caps lock button when setting it, but then it just ignores the caps locks key, if you have Command + CapsLock + D for example Command + D will bring up the window still. CapsLock + D set, then try to bring up the window and no luck for me.... Wonder what it is.
There are certain keys that can't be used for shortcuts. Capslock is a funny one as it's more of a toggle key rather than an input, so it might not be usable.
It might be best to add in some validation to tell users when certain keys aren't available or certain combinations can't be used (e.g. command+c for example, which is already a system-wide command).
So just wanted to share this
dev-to-uploads.s3.amazonaws.com/up...