• Stars
    star
    851
  • Rank 53,558 (Top 2 %)
  • Language
    Swift
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Custom interactive view controller transition from one view to another view.

View2ViewTransition

Carthage compatible Pod Version Swift Version License MIT Plaforms

Simple framework for custom interactive viewController transition from one view to another view.

Installation

Carthage

github "naru-jpn/View2ViewTransition"

CocoaPods

pod 'View2ViewTransition'

Usage

Create TransitionController and implement presentation

// Create TransitionController
var transitionController: TransitionController = TransitionController()
// Present view controller with transition delegate
let presentedViewController: PresentedViewController = PresentedViewController()
presentedViewController.transitioningDelegate = transitionController

transitionController.present(viewController: presentedViewController, on: self, attached: presentedViewController, completion: nil)

(also supports push)

// Set transitionController as a navigation controller delegate and push.
let presentedViewController: PresentedViewController = PresentedViewController()

if let navigationController = self.navigationController {
   navigationController.delegate = transitionController
   transitionController.push(viewController: presentedViewController, on: self, attached: presentedViewController)
}

Presenting viewController conforms View2ViewTransitionPresenting

func initialFrame(userInfo: [String: AnyObject]?, isPresenting: Bool) -> CGRect
func initialView(userInfo: [String: AnyObject]?, isPresenting: Bool) -> UIView
func prepereInitialView(userInfo: [String: AnyObject]?, isPresenting: Bool) -> Void // (optional)

Presented viewController conforms View2ViewTransitionPresented

func destinationFrame(userInfo: [String: AnyObject]?, isPresenting: Bool) -> CGRect
func destinationView(userInfo: [String: AnyObject]?, isPresenting: Bool) -> UIView
func prepareDestinationView(userInfo: [String: AnyObject]?, isPresenting: Bool) -> Void // (optional)

Use UserInfo

You can set userInfo to notify indexPath or share resource etc.

transitionController.userInfo = ["key": "value", ...]

Modify Animation Parameters

Animate with custom animation parameters.

// For present
transitionController.presentAnimationController.usingSpringWithDamping = 0.7
transitionController.presentAnimationController.initialSpringVelocity = 0.0
transitionController.presentAnimationController.animationOptions = [.CurveEaseInOut]

// For dismiss
transitionController.dismissAnimationController.usingSpringWithDamping = 0.7
transitionController.dismissAnimationController.initialSpringVelocity = 0.0
transitionController.dismissAnimationController.animationOptions = [.CurveEaseInOut]

Debug Mode

If you have hierarchical view controllers (navigation controllers) in app, viewController to conform protocol is not intuitive. View2ViewTransition prints some information in debug mode.

let transitionController = TransitionController()
// ...
transitionController.debuging = true

Example

View2ViewTransitionExample

More Repositories

1

pencil

Super lightweight DB written in Swift.
Swift
90
star
2

LoopedContentsView

View to display looped contents.
Swift
53
star
3

BottomSheetController

Component containing supplementary content that are anchored to the bottom of the screen.
Swift
39
star
4

MetalAR

AR application sample using Metal without SceneKit.
Swift
34
star
5

Monaka

Monaka convert custom struct to NSData.
Swift
22
star
6

Storages

Browse local storages of your applications.
Swift
22
star
7

pip-exercise

Some examples for iOS Picture-in-Picture.
21
star
8

CallStackSymbols

Get formatted call stack symbols.
Swift
13
star
9

100000-particles

Sample implementation for one hundred thousand particles simulated and drawn by Metal.
Swift
9
star
10

LayoutXML

Android styled XML template engine for iOS written in Swift.
Swift
7
star
11

Symbolicator

Convert numeric addresses to symbols with callStackSymbols and dSYM.
Swift
7
star
12

XMLLayouts

Layout system using XML for ios
Objective-C
6
star
13

NDISwiftPackage

Sample project with local swift package linked NDI SDK.
Swift
5
star
14

struct-archiver

Archive struct and fundamental values into NSData and unarchive.
Swift
5
star
15

MeasureAccelerates

Sample library to measure performance of calculation with Accelerate Framework.
Swift
5
star
16

metal-drawings

Swift
3
star
17

MPSTrainingChallenge

Challenge to train neural network using MetalPerformanceShaders Framework.
Objective-C
3
star
18

FrameMint

Make video frames in 420YpCbCr8BiPlanarFullRange from view representation of UIKit or SwiftUI.
Swift
2
star
19

KeyboardSimulator

Application to simulate keyboard inputs at intervals for macOS.
Swift
2
star
20

pip-battery-drain

Reproduce PiP Battery Drain
Swift
2
star
21

BluetoothRSASample

RSA้€šไฟกใฎๅฎŸๆ„Ÿใ‚ตใƒณใƒ—ใƒซ
Objective-C
1
star
22

hexadecimals

Convert hexadecimal number to some different radix numbers
Swift
1
star
23

InferenceVowel

Demo Application for Inference of vowel
Swift
1
star
24

PHHashService

Calculate hash for all local images and store them.
Objective-C
1
star
25

ObservableAppGroups

Observable file changes in app groups container with Combine.
Swift
1
star
26

Files

Framework to easily browse, observe and control local storage.
Swift
1
star