LPThumbnailView 2.0.0

LPThumbnailView 2.0.0

Luis PadronLuis Padron维护。




LPThumbnailView

Banner

适用于iOS的上下文图像缩略视图。

特性

  • 易于使用
  • 流畅的动画
  • 可自定义
  • 使用最新Swift编写

需求

  • iOS 10.0+

安装

CocoaPods

  1. 安装CocoaPods

  2. 将此仓库添加到您的Podfile

    target 'Example' do
        # IMPORTANT: Make sure use_frameworks! is included at the top of the file
        use_frameworks!
        pod 'LPThumbnailView'
    end
  3. 运行pod install

  4. 打开CocoaPods创建的.xcworkspace

  5. 完成!

Carthage

配合Carthage使用

  1. 确保已安装Carthage

    brew install carthage

  2. 将此仓库添加到您的Cartfile

    github "luispadron/LPThumbnailView"

  3. MyProjDir/Carthage/Builds/iOS/LPThumbnailView中将LPThumbnailView.framework拖到您的Xcode项目“General -> Embedded Binaries”部分。

手动

  1. 简单下载此处的源文件并将它们拖到项目中。

用法

简单动画

// Pick your animation style
thumbnailView.animationStyle = .enterFromRight 
// Simply add an image to the thumbnail view, animation is handled for you!
thumbnailView.addImage(image)

Demo gif 1

上下文动画

// Create/use an existing image view you would like to be animated to the position of the thumbnail.
let imgView = UIImageView(image: someImage)
// Animation from imgView to thumbnail is handled for you!
// imgView will animate to the correct frame and will be removed from the super view on completion of animation.
thumbnailView.addImageWithContext(imgView)

Demo gif 2

文档

请在此处阅读文档以获取更多信息,并在发布问题之前先阅读。

示例项目

请查看示例项目这里