Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some typos and language in comments #11

Merged
merged 1 commit into from
Oct 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Framework/Sources/FloatingPanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class FloatingPanel: NSObject, UIGestureRecognizerDelegate, UIScrollViewDelegate
private func panningBegan() {
// A user interaction does not always start from Began state of the pan gesture
// because it can be recognized in scrolling a content in a content view controller.
// So I don't nothing here.
// So I do nothing here.
log.debug("panningBegan \(initialFrame)")
}

Expand Down
2 changes: 1 addition & 1 deletion Framework/Sources/FloatingPanelBehavior.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import UIKit

public protocol FloatingPanelBehavior {
// Returns a UIViewPropertyAnimator object in interacting a floating panel by a user pan gesture
// Returns a UIViewPropertyAnimator object for interacting with a floating panel by a user pan gesture
func interactionAnimator(_ fpc: FloatingPanelController, to targetPosition: FloatingPanelPosition, with velocity: CGVector) -> UIViewPropertyAnimator

// Returns a UIViewPropertyAnimator object to present a floating panel
Expand Down
22 changes: 11 additions & 11 deletions Framework/Sources/FloatingPanelController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI
return floatingPanel.backdropView
}

/// Returns the scroll view that the conroller tracks.
/// Returns the scroll view that the controller tracks.
public weak var scrollView: UIScrollView? {
return floatingPanel.scrollView
}
Expand All @@ -76,14 +76,14 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI
return floatingPanel.state
}

/// The content insets of the tracking scroll view derived the safe area of the parent view
/// The content insets of the tracking scroll view derived from the safe area of the parent view
public var adjustedContentInsets: UIEdgeInsets {
return floatingPanel.layoutAdapter.adjustedContentInsets
}

/// The behavior for determining the adjusted content offsets.
///
/// This property specifies how the content area of the tracking scroll view are modified using `adjustedContentInsets`. The default value of this property is FloatingPanelController.ContentInsetAdjustmentBehavior.always.
/// This property specifies how the content area of the tracking scroll view is modified using `adjustedContentInsets`. The default value of this property is FloatingPanelController.ContentInsetAdjustmentBehavior.always.
public var contentInsetAdjustmentBehavior: ContentInsetAdjustmentBehavior = .always

private var floatingPanel: FloatingPanel!
Expand All @@ -92,7 +92,7 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI
super.init(coder: aDecoder)
}

/// Initialize a newly created a floating panel controller.
/// Initialize a newly created floating panel controller.
public init() {
super.init(nibName: nil, bundle: nil)
}
Expand Down Expand Up @@ -139,7 +139,7 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI
public override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

// I needs to update safeAreaInsets here to ensure that the `adjustedContentInsets` has a correct value.
// Need to update safeAreaInsets here to ensure that the `adjustedContentInsets` has a correct value.
// Because the parent VC does not call viewSafeAreaInsetsDidChange() expectedly and
// `view.safeAreaInsets` has a correct value of the bottom inset here.
if let parent = parent {
Expand Down Expand Up @@ -173,10 +173,10 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI

// MARK: - Container view controller interface

/// Adds the view managed the controller as a child of the specified view controller.
/// Adds the view managed by the controller as a child of the specified view controller.
/// - Parameters:
/// - parent: A parent view controller object that displays FloatingPanelController's view. A conatiner view controller object isn't applicable.
/// - belowView: Insert the surface view managed by the controller below the specified view. As default, the surface view will be added to the end of the parent list of subviews.
/// - parent: A parent view controller object that displays FloatingPanelController's view. A container view controller object isn't applicable.
/// - belowView: Insert the surface view managed by the controller below the specified view. By default, the surface view will be added to the end of the parent list of subviews.
/// - animated: Pass true to animate the presentation; otherwise, pass false.
public func addPanel(toParent parent: UIViewController, belowView: UIView? = nil, animated: Bool = false) {
guard self.parent == nil else {
Expand All @@ -196,7 +196,7 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI

parent.addChild(self)

// Must set a layout again here because `self.traitCollection` is applied correctly on it's added to a parent VC
// Must set a layout again here because `self.traitCollection` is applied correctly once it's added to a parent VC
floatingPanel.layoutAdapter.layout = fetchLayout(for: traitCollection)
floatingPanel.layoutViews(in: parent)
floatingPanel.present(animated: animated) { [weak self] in
Expand Down Expand Up @@ -229,7 +229,7 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI
/// - Parameters:
/// - to: Pass a FloatingPanelPosition value to move the surface view to the position.
/// - animated: Pass true to animate the presentation; otherwise, pass false.
/// - completion: The block to execute after the view controller is dismissed. This block has no return value and takes no parameters. You may specify nil for this parameter.
/// - completion: The block to execute after the view controller has finished moving. This block has no return value and takes no parameters. You may specify nil for this parameter.
public func move(to: FloatingPanelPosition, animated: Bool, completion: (() -> Void)? = nil) {
floatingPanel.move(to: to, animated: animated, completion: completion)
}
Expand All @@ -255,7 +255,7 @@ public class FloatingPanelController: UIViewController, UIScrollViewDelegate, UI
/// Tracks the specified scroll view to correspond with the scroll.
///
/// - Attention:
/// The specified scroll view must be already assigned the delegate property because the controller intemediates the several delegate methods.
/// The specified scroll view must be already assigned to the delegate property because the controller intermediates between the various delegate methods.
///
public func track(scrollView: UIScrollView) {
floatingPanel.scrollView = scrollView
Expand Down
8 changes: 4 additions & 4 deletions Framework/Sources/FloatingPanelLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public protocol FloatingPanelLayout: class {
/// Returns the initial position of a floating panel
var initialPosition: FloatingPanelPosition { get }

/// Returns an array of FloatingPanelPosition object to tell the applicable position the floating panel controller
/// Returns an array of FloatingPanelPosition objects to tell the applicable positions of the floating panel controller
var supportedPositions: [FloatingPanelPosition] { get }

/// Return the interaction buffer to the top from the top position. Default is 6.0.
Expand All @@ -18,15 +18,15 @@ public protocol FloatingPanelLayout: class {
/// Return the interaction buffer to the bottom from the bottom position. Default is 6.0.
var bottomInteractionBuffer: CGFloat { get }

/// Returns a CGFloat value to determine a floating panel height for each positions(full, half and tip).
/// Returns a CGFloat value to determine a floating panel height for each position(full, half and tip).
/// A value for full position indicates a top inset from a safe area.
/// On the other hand, values for half and tip positions indicate bottom insets from a safe area.
/// If a position doesn't contain the supported positions, return nil.
func insetFor(position: FloatingPanelPosition) -> CGFloat?

/// Returns X-axis and width layout constraints of the surface view of a floaitng panel.
/// Returns X-axis and width layout constraints of the surface view of a floating panel.
/// You must not include any Y-axis and height layout constraints of the surface view
/// because their constarints will be configured by the floating panel controller.
/// because their constraints will be configured by the floating panel controller.
func prepareLayout(surfaceView: UIView, in view: UIView) -> [NSLayoutConstraint]

/// Return the backdrop alpha of black color in full position. Default is 0.3.
Expand Down
6 changes: 3 additions & 3 deletions Framework/Sources/FloatingPanelSurfaceView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class FloatingPanelSurfaceView: UIView {
/// The radius to use when drawing top rounded corners.
///
/// `self.contentView` is masked with the top rounded corners automatically on iOS 11 and later.
/// On iOS 10, they are not automatically masked because of UIVisualEffectView issue. See https://forums.developer.apple.com/thread/50854
/// On iOS 10, they are not automatically masked because of a UIVisualEffectView issue. See https://forums.developer.apple.com/thread/50854
public var cornerRadius: CGFloat = 0.0 { didSet { setNeedsLayout() } }

/// A Boolean indicating whether the surface shadow is displayed.
Expand Down Expand Up @@ -114,7 +114,7 @@ public class FloatingPanelSurfaceView: UIView {
updateShadowLayer()

if #available(iOS 11, *) {
// Don't use `contentView.clipToBounds` because it makes content view not able to expand the height of a subview of it
// Don't use `contentView.clipToBounds` because it prevents content view from expanding the height of a subview of it
// for the bottom overflow like Auto Layout settings of UIVisualEffectView in Main.storyborad of Example/Maps.
// Because the bottom of contentView must be fit to the bottom of a screen to work the `safeLayoutGuide` of a content VC.
let maskLayer = CAShapeLayer()
Expand All @@ -126,7 +126,7 @@ public class FloatingPanelSurfaceView: UIView {
maskLayer.path = path.cgPath
contentView.layer.mask = maskLayer
} else {
// Don't use `contentView.layer.mask` because of UIVisualEffectView issue on ios10, https://forums.developer.apple.com/thread/50854
// Don't use `contentView.layer.mask` because of a UIVisualEffectView issue in iOS 10, https://forums.developer.apple.com/thread/50854
// Instead, a user can mask the content view manually in an application.
}

Expand Down