I've recently seen a youtube video, which is advertising an iphone app which will unlock your mac computer by knocking on your iphone. The ad is claiming that it is faster and safer than typing your password. I am concerned about the security of this method. Can anyone tell me if it is really safer to do so?
It depends on how they implement it, but the most secure would be to use that with a password. They are probably using a certificate based system which wouldn't be able to be guessed and they are turning the phone in to a "what you have" token that can pass the information to the authentication system when you prove you have it by knocking on it.
The exact security of the system would depend on how secure they implemented the authentication though and unless it requires a password to be entered on your phone, it reduces security related to someone being able to simply rob you for your phone to get in to your computer even though it would increase the security of someone without access to your phone being able to get in.
This is why two factor authentication is typically considered a best practice, that way they need not only something you have but also either something you are or something you know. Generally, it's also good to have at least one be something you know since it's far easier to force you to use your biometrics or take something from you, but they can't force a secret out of your head, but some cases are ok to be who you are and what you have.
I presume the idea is that if you're sitting in Starbucks, no-one can learn your password by you tapping on your phone (& that you're unlikely to leave you phone down somewhere).
See "Shoulder surfing".