Skip to content

Commit

Permalink
Add default implementations for styleTransitionWillBegin/End
Browse files Browse the repository at this point in the history
  • Loading branch information
iKenndac authored and Boerworz committed Dec 6, 2017
1 parent e54b608 commit cb41c3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 0 additions & 8 deletions Gagat Example/ArchiveTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ class ArchiveTableViewController: UITableViewController, UIGestureRecognizerDele

extension ArchiveTableViewController: GagatStyleable {

func styleTransitionWillBegin() {
// Do any work you might need to do before the transition snapshot is taken.
}

func styleTransitionDidEnd() {
// Do any work you might need to do once the transition has completed.
}

func toggleActiveStyle() {
useDarkMode = !useDarkMode
}
Expand Down
8 changes: 8 additions & 0 deletions Gagat/Gagat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ public protocol GagatStyleable {
func styleTransitionDidEnd()
}

/// Since styleTransitionWillBegin() and styleTransitionDidEnd() aren't considered as required to implement
/// the core functionality of the GagatStyleable protocol, this extension provides default (empty) implementations
/// of those functions. This makes implementing them in your GagatStyleable object optional.
public extension GagatStyleable {
func styleTransitionWillBegin() {}
func styleTransitionDidEnd() {}
}

public struct Gagat {

/// The `Configuration` struct allows clients to configure certain
Expand Down

0 comments on commit cb41c3f

Please sign in to comment.