From 8add4a874e3616fcf6f73b5b7aa09209aaf8b9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E6=BA=90?= Date: Mon, 22 Apr 2019 20:16:37 +0800 Subject: [PATCH] [FIX] fix path error --- CardSlider/CardSlider/Public/CardSliderViewController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CardSlider/CardSlider/Public/CardSliderViewController.swift b/CardSlider/CardSlider/Public/CardSliderViewController.swift index ea82192..8a2a733 100755 --- a/CardSlider/CardSlider/Public/CardSliderViewController.swift +++ b/CardSlider/CardSlider/Public/CardSliderViewController.swift @@ -54,7 +54,11 @@ open class CardSliderViewController: UIViewController, UIScrollViewDelegate { /// - Parameter dataSource: CardSliderDataSource public static func with(dataSource: CardSliderDataSource) -> CardSliderViewController { - guard let controller = UIStoryboard(name: "Main", bundle: Bundle(for: self)).instantiateInitialViewController() as? CardSliderViewController else { + + var path = Bundle(for: self).path(forResource: "CardSlider", ofType: "bundle") + let realBundle = Bundle(path: path!) + + guard let controller = UIStoryboard(name: "Main", bundle: realBundle).instantiateInitialViewController() as? CardSliderViewController else { fatalError("Failed to initialize CardSliderViewController") } controller.dataSource = dataSource