diff --git a/Segmentio.podspec b/Segmentio.podspec index cedb202..0b7e6f1 100644 --- a/Segmentio.podspec +++ b/Segmentio.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "Segmentio" - spec.version = "1.1.1" + spec.version = "1.1.2" spec.homepage = "https://github.com/Yalantis/Segmentio" spec.summary = "Animated top/bottom segmented control written in Swift!" diff --git a/Segmentio/Source/Badge/Views/BadgeWithCounterView.swift b/Segmentio/Source/Badge/Views/BadgeWithCounterView.swift index 1bf4bfa..8d812d3 100644 --- a/Segmentio/Source/Badge/Views/BadgeWithCounterView.swift +++ b/Segmentio/Source/Badge/Views/BadgeWithCounterView.swift @@ -17,9 +17,14 @@ class BadgeWithCounterView: UIView { class func instanceFromNib(size size: CounterBadgeSize) -> BadgeWithCounterView { let nibName = nibNameForSize(size) - return UINib(nibName: nibName, bundle: nil).instantiateWithOwner(nil, options: nil)[0] as! BadgeWithCounterView + let podBundle = NSBundle(forClass: self.classForCoder()) + + if let bundleURL = podBundle.URLForResource("Segmentio", withExtension: "bundle"), bundle = NSBundle(URL: bundleURL) { + return UINib(nibName: nibName, bundle: bundle).instantiateWithOwner(nil, options: nil)[0] as! BadgeWithCounterView + } + return BadgeWithCounterView(frame: CGRectZero) } - + func setBadgeCounterValue(counterValue: Int) { var counterText: String! if counterValue > BadgeCounterMaxValue {