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.
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.