Coder Social home page Coder Social logo

zaprogramiacz / mgflipview Goto Github PK

View Code? Open in Web Editor NEW
65.0 2.0 4.0 3.51 MB

MGFlipView allows to create flipping view in easy way without worrying about flipping animation and flipping logic.

License: MIT License

Swift 100.00%
swiftui swift-package-manager swift swift5-3 ios macos watchos tvos flipview flip

mgflipview's Introduction

MGFlipView

Swift Platforms Dependency manager

About

If you are looking for an easy way of implement 3D flipping view, you are in the right place. MGFlipView allows to create flipping view in easy way without worring about flipping animation and flipping logic.

The library is written in SwiftUI and it can be used on all platforms (iOS, macOS, watchOS, tvOS).

Examples of usage for all platforms are available after opening MGFlipView.xcworkspace.

The library is distributed via SPM.

Preview

Preview

Documentation

FlipView takes 6 arguments:

Argument Type Description
frontView () -> View Front view builder. Visible if flipped == true.
backView () -> View Back view builder. Visible if flipped == false.
flipped Binding<Bool> Binding which gives possiblity to flip the view.
flipAxis FlipAxis Rotation axis. FlipAxis have 4 defined values(x, y, xy, custom(x: Double, y: Double)). The custom value gives possiblity to declare your own axis. It has x default value when argument is not passed to the FlipView initializer.
perspective CGFloat The relative vanishing point. It has 0.5 default value when argument is not passed to the FlipView initializer.
animation AnimationDescription Defines the animation that takes place when flipping. Animation can be customized by setting duration and timing function (linear, easeIn, easeOut, easeInOut). It has .init(type: .linear, duration: 0.25) default value when argument is not passed to the FlipView initializer.
public init(@ViewBuilder frontView: @escaping () -> ContentFront,
            @ViewBuilder backView: @escaping () -> ContentBack,
                         flipped: Binding<Bool>,
                         flipAxis: FlipAxis = .x,
                         perspective: CGFloat = 0.5,
                         animation: AnimationDescription = .default)

Installation

Use https://github.com/Zaprogramiacz/MGFlipView.git link to add Swift Package to Xcode project

License

MIT License

Copyright (c) 2020 Maciej Gomółka

mgflipview's People

Contributors

zaprogramiacz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.