All Projects → horitaku46 → Serrata

horitaku46 / Serrata

Licence: mit
Slide image viewer library similar to Twitter and LINE.

Programming Languages

swift
15916 projects
swift4
162 projects

Projects that are alternatives of or similar to Serrata

Imgix Swift
A Swift client library for generating URLs with imgix
Stars: ✭ 19 (-94.1%)
Mutual labels:  images, cocoapods, carthage
Agrume
🍋 A lemony fresh iOS image viewer written in Swift.
Stars: ✭ 449 (+39.44%)
Mutual labels:  cocoapods, carthage, image-viewer
Microfeatures Guidelines
📦📝 uFeatures guidelines
Stars: ✭ 315 (-2.17%)
Mutual labels:  cocoapods, carthage
Vulcan
Multi image downloader with priority in Swift
Stars: ✭ 291 (-9.63%)
Mutual labels:  cocoapods, carthage
Misterfusion
MisterFusion is Swift DSL for AutoLayout. It is the extremely clear, but concise syntax, in addition, can be used in both Swift and Objective-C. Support Safe Area and Size Class.
Stars: ✭ 314 (-2.48%)
Mutual labels:  cocoapods, carthage
Swiftprogresshud
📦 SwiftProgressHUD is a user-friendly pure swift HUD. 支持Cocoapods 及 Carthage
Stars: ✭ 290 (-9.94%)
Mutual labels:  cocoapods, carthage
Imageloaderswift
A lightweight and fast image loader for iOS written in Swift.
Stars: ✭ 290 (-9.94%)
Mutual labels:  cocoapods, carthage
Stevia
🍃 Concise Autolayout code
Stars: ✭ 3,182 (+888.2%)
Mutual labels:  cocoapods, carthage
Passwordtextfield
A custom TextField with a switchable icon which shows or hides the password and enforce good password policies
Stars: ✭ 281 (-12.73%)
Mutual labels:  cocoapods, carthage
Ioniconskit
Use Ionicons in your Swift projects.
Stars: ✭ 310 (-3.73%)
Mutual labels:  cocoapods, carthage
Web3.swift
A pure swift Ethereum Web3 library
Stars: ✭ 295 (-8.39%)
Mutual labels:  cocoapods, carthage
Eachnavigationbar
A custom navigation bar for each view controller.
Stars: ✭ 314 (-2.48%)
Mutual labels:  cocoapods, carthage
Xlactioncontroller
Fully customizable and extensible action sheet controller written in Swift
Stars: ✭ 3,228 (+902.48%)
Mutual labels:  cocoapods, carthage
Realreachability
We need to observe the REAL reachability of network. That's what RealReachability do.
Stars: ✭ 3,042 (+844.72%)
Mutual labels:  cocoapods, carthage
Functionkit
A framework for functional types and operations designed to fit naturally into Swift.
Stars: ✭ 302 (-6.21%)
Mutual labels:  cocoapods, carthage
Jgprogresshud
An elegant and simple progress HUD for iOS and tvOS, compatible with Swift and ObjC.
Stars: ✭ 3,110 (+865.84%)
Mutual labels:  cocoapods, carthage
Kyshutterbutton
KYShutterButton is a custom button that is similar to the shutter button of the camera app
Stars: ✭ 293 (-9.01%)
Mutual labels:  cocoapods, carthage
Costumekit
Base types for theming an app.
Stars: ✭ 300 (-6.83%)
Mutual labels:  images, carthage
Stepperview
SwiftUI iOS component for Step Indications.
Stars: ✭ 281 (-12.73%)
Mutual labels:  cocoapods, carthage
Faceaware
An extension that gives UIImageView the ability to focus on faces within an image.
Stars: ✭ 3,004 (+832.92%)
Mutual labels:  cocoapods, carthage

Platform Swift Cocoapods Carthage compatible License

Overview

You can use it simply by passing the necessary information!
Serrata is a UI library that allows you to intuitively view images.

Features

Kingfisher is a lightweight and pure Swift implemented library.
It is used in the Serrata. I sincerely respect Kingfisher!

  • Support iPhone, iPad and iPhone X! 🎉
  • It is the almost same as Image Viewer of Twitter and LINE.😎

Requirements

  • Xcode 9.0+
  • iOS 11+
  • Swift 4.0+

Installation

Caution ⚠️

Kingfisher is installed, too!

CocoaPods

pod 'Serrata'

Carthage

github "horitaku46/Serrata"

Usage

See Example, for more details.

How to use in Example.

guard let selectedCell = collectionView.cellForItem(at: indexPath) as? ImageCell else {
    return
}

let slideLeafs: [SlideLeaf] = images.enumerated().map { SlideLeaf(image: $0.1,
                                                                  title: "Image Title \($0.0)",
                                                                  caption: "Index is \($0.0)") }

let slideImageViewController = SlideLeafViewController.make(leafs: slideLeafs,
                                                            startIndex: indexPath.row,
                                                            fromImageView: selectedCell.imageView)

slideImageViewController.delegate = self // Please watch the following SlideLeafViewControllerDelegate.
present(slideImageViewController, animated: true, completion: nil)

Details of SlideLeafViewController.make().

/// This method generates SlideLeafViewController.
///
/// - Parameters:
///   - leafs: It is array to display it by a slide.
///   - startIndex: It is for initial indication based on array of leafs.
///   - fromImageView: ImageView of the origin of transition. In the case of nil, CrossDissolve.
/// - Returns: Instance of SlideLeafViewController.
open class func make(leafs: [SlideLeaf], startIndex: Int = 0, fromImageView: UIImageView? = nil) -> SlideLeafViewController {
    // code...
}

Details of SlideLeaf.

import UIKit

public final class SlideLeaf: NSObject {

    public var image: UIImage?
    public var imageUrlString: String?

    public var title: String
    public var caption: String


    /// If either title and caption is empty, detailView is not displayed.
    ///
    /// - Parameters:
    ///   - image: To read by a slide.
    ///   - title: Title of the image.
    ///   - caption: Caption of the image.
    public init(image: UIImage?, title: String = "", caption: String = "") {
        self.image = image
        self.title = title
        self.caption = caption
    }

    /// If either title and caption is empty, detailView is not displayed.
    ///
    /// - Parameters:
    ///   - imageUrlString: To read by a slide. It is displayed by Kingfisher.
    ///   - title: Title of the image.
    ///   - caption: Caption of the image.
    public init(imageUrlString: String?, title: String = "", caption: String = "") {
        self.imageUrlString = imageUrlString
        self.title = title
        self.caption = caption
    }
}

delegate

Detail of SlideLeafViewControllerDelegate.

extension ViewController: SlideLeafViewControllerDelegate {

    func tapImageDetailView(slideLeaf: SlideLeaf, pageIndex: Int) {
        // code...
    }

    func longPressImageView(slideLeafViewController: SlideLeafViewController, slideLeaf: SlideLeaf, pageIndex: Int) {
        // code...
    }

    func slideLeafViewControllerDismissed(slideLeaf: SlideLeaf, pageIndex: Int) {
        // code...
    }
}

Author

Takuma Horiuchi

Example images from

License

Serrata is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].