dropbox / zxcvbn-ios

A realistic password strength estimator.
https://tech.dropbox.com/2012/04/zxcvbn-realistic-password-strength-estimation/
MIT License
223 stars 64 forks source link

Use bundleForClass instead of mainBundle #19

Closed Quentiu closed 8 years ago

Quentiu commented 8 years ago

Getting the resource paths for adjacency_graphs.json and frequency_lists.json returns nil when zxcvbn-ios is in a framework. Replacing [NSBundle mainBundle] with [NSBundle bundleForClass:[self class]] solves this problem and works for zxcvbn-ios when is in the main application or in a framework.

This problem can easily be seen by adding zxcvbn-ios to a project via CocoaPods with the use_frameworks! option in the Podfile.

Quentiu commented 8 years ago

Closing PR in favour of https://github.com/dropbox/zxcvbn-ios/pull/16