<commit_before>//
//  PanelContentDelegate.swift
//  PanelKit
//
//  Created by <NAME> on 12/03/2017.
//  Copyright © 2017 Silver Fox. All rights reserved.
//

import UIKit

public protocol PanelContentDelegate: class {

	var closeButtonTitle: String { get }
	var popButtonTitle: String { get }
	var modalCloseButtonTitle: String { get }

	var shouldAdjustForKeyboard: Bool { get }

	var preferredPanelContentSize: CGSize { get }
	
	var preferredPanelPinnedWidth: CGFloat { get }

	func updateConstraintsForKeyboardShow(with frame: CGRect)

	func updateUIForKeyboardShow(with frame: CGRect)

	func updateConstraintsForKeyboardHide()

	func updateUIForKeyboardHide()

	/// Excludes potential "close" or "pop" buttons
	var leftBarButtonItems: [UIBarButtonItem] { get }

	/// Excludes potential "close" or "pop" buttons
	var rightBarButtonItems: [UIBarButtonItem] { get }

	func updateNavigationButtons()
	
	func panelDragGestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool
	
}
<commit_msg>PanelContentDelegate: add documentation<commit_after>//
//  PanelContentDelegate.swift
//  PanelKit
//
//  Created by <NAME> on 12/03/2017.
//  Copyright © 2017 Silver Fox. All rights reserved.
//

import UIKit

/// PanelContentDelegate determines the panel size and allows
/// you to get notified for certain events.
public protocol PanelContentDelegate: class {

	/// The title for the close button in the navigation bar.
	var closeButtonTitle: String { get }
	
	/// The title for the pop button in the navigation bar.
	/// This is the button that will make the panel float when tapped.
	var popButtonTitle: String { get }
	
	/// The close button title for the panel when it is presented modally.
	var modalCloseButtonTitle: String { get }

	/// Return true to make the panel manager resize the panel
	/// when a keyboard is shown.
	///
	/// Typically you would only want to return true when something
	/// in the panel is first responser.
	///
	/// Returns false by default.
	var shouldAdjustForKeyboard: Bool { get }

	/// The size the panel should have while floating.
	/// The panel manager will try to maintain the size specified by 
	/// this property. The panel manager may deviate from this size, 
	/// for example when the keyboard is shown.
	var preferredPanelContentSize: CGSize { get }
	
	/// The width the panel should have when it is pinned.
	var preferredPanelPinnedWidth: CGFloat { get }

	/// Notifies you that the keyboard will be shown.
	/// Use this to update any constraints that descend from the panel's view.
	/// The constraints will be updated with an animation automatically.
	///
	/// - Parameter frame: the keyboard frame,
	/// in the panel's coordinate space.
	func updateConstraintsForKeyboardShow(with frame: CGRect)

	/// Notifies you that the keyboard will be shown.
	/// Use this to change any view frames (when not using Auto Layout).
	/// This function will be invoked in a UIView animation block.
	///
	/// - Parameter frame: the keyboard frame,
	/// in the panel's coordinate space.
	func updateUIForKeyboardShow(with frame: CGRect)

	/// Notifies you that the keyboard will hide.
	/// Use this to update any constraints that descend from the panel's view.
	/// The constraints will be updated with an animation automatically.
	func updateConstraintsForKeyboardHide()

	/// Notifies you that the keyboard will hide.
	/// Use this to change any view frames (when not using Auto Layout).
	/// This function will be invoked in a UIView animation block.
	func updateUIForKeyboardHide()

	/// Excludes potential "close" or "pop" buttons.
	/// Default implementation is an empty array.
	var leftBarButtonItems: [UIBarButtonItem] { get }

	/// Excludes potential "close" or "pop" buttons.
	/// Default implementation is an empty array.
	var rightBarButtonItems: [UIBarButtonItem] { get }

	/// This is called when the state of the panel changes.
	/// The default implementation provides the default close or pop button.
	/// Only implement yourself if you wish to use your own close and pop button.
	func updateNavigationButtons()
	
	/// Return true to make the drag gesture recognizer receive its touch.
	/// This is only applicable when a panel is in a floating state.
	/// Returning false will prevent the panel from being dragged.
	/// 
	/// This can be used to prevent the panel from dragging in certain areas.
	func panelDragGestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool
	
}

{'fraction_non_alphanumeric': 0.0824627695043343, 'fraction_numerical': 0.005334518781951545, 'mean_word_length': 3.4776119402985075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4437838', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1174, 'n_words': 544}