diff --git a/Serrata.podspec b/Serrata.podspec new file mode 100644 index 0000000..f8371c0 --- /dev/null +++ b/Serrata.podspec @@ -0,0 +1,33 @@ +Pod::Spec.new do |s| + s.name = "Serrata" + s.version = "1.0.0" + s.summary = "Slide image viewer library similar to twitter and LINE" + + s.description = <<-DESC + You can use it simply by passing the necessary information. + + It is a UI library that allows you to intuitively view images. + + Kingfisher is a lightweight and pure Swift implemented library. + + Kingfisher is used in the Serrata. I sincerely respect Kingfisher. + DESC + + s.homepage = "https://github.com/horitaku46/Serrata" + s.license = { :type => "MIT", :file => "./LICENSE" } + + s.author = { "Takuma Horiuchi" => "horitaku46@gmail.com" } + s.social_media_url = "https://twitter.com/horitaku_" + + s.platform = :ios, "10.0" + s.source = { :git => "https://github.com/horitaku46/Serrata.git", :tag => "#{s.version}" } + + s.ios.deployment_target = '10.0' + + s.source_files = "Serrata/**/*" + s.resource_bundles = { + "Serrata" => ["Serrata/**/*"] + } + + s.dependency "Kingfisher" +end diff --git a/Serrata/Sources/ImageDetailView.swift b/Serrata/Sources/ImageDetailView.swift index ad3efd2..fb84635 100644 --- a/Serrata/Sources/ImageDetailView.swift +++ b/Serrata/Sources/ImageDetailView.swift @@ -34,8 +34,9 @@ open class ImageDetailView: UIView { @IBOutlet weak private var closeButton: UIButton! { // UIButtonType = custom didSet { - closeButton.setImage(UIImage(named: "close_cross"), for: .normal) - closeButton.setImage(UIImage(named: "close_cross"), for: .highlighted) + let closeImage = UIImage(named: "close_cross", in: Bundle(for: ImageDetailView.self), compatibleWith: nil) + closeButton.setImage(closeImage, for: .normal) + closeButton.setImage(closeImage, for: .highlighted) closeButton.layer.cornerRadius = closeButton.bounds.height / 2 closeButton.backgroundColor = UIColor(white: 0, alpha: ImageDetailConst.maxAlpha) } diff --git a/Serrata/Sources/SlideLeafViewController.swift b/Serrata/Sources/SlideLeafViewController.swift index 4aeae45..894ae40 100644 --- a/Serrata/Sources/SlideLeafViewController.swift +++ b/Serrata/Sources/SlideLeafViewController.swift @@ -39,7 +39,7 @@ fileprivate enum SlideLeafConst { @IBOutlet weak private var collectionView: UICollectionView! { didSet { - collectionView.register(UINib(nibName: "SlideLeafCell", bundle: nil), forCellWithReuseIdentifier: "SlideLeafCell") + collectionView.register(UINib(nibName: "SlideLeafCell", bundle: Bundle(for: SlideLeaf.self)), forCellWithReuseIdentifier: "SlideLeafCell") collectionView.isPagingEnabled = true collectionView.backgroundColor = .clear collectionView.showsHorizontalScrollIndicator = false @@ -113,7 +113,7 @@ fileprivate enum SlideLeafConst { private var isDecideDissmiss = false open class func make(leafs: [SlideLeaf], startIndex: Int = 0, fromImageView: UIImageView? = nil) -> SlideLeafViewController { - let viewController = UIStoryboard(name: "SlideLeafViewController", bundle: nil) + let viewController = UIStoryboard(name: "SlideLeafViewController", bundle: Bundle(for: SlideLeafViewController.self)) .instantiateViewController(withIdentifier: "SlideLeafViewController") as! SlideLeafViewController viewController.transitioningDelegate = viewController.serrataTransition viewController.slideLeafs = leafs