diff --git a/Example/Examples/Header/HeaderViewController.swift b/Example/Examples/Header/HeaderViewController.swift index 75f8599e..c3969503 100644 --- a/Example/Examples/Header/HeaderViewController.swift +++ b/Example/Examples/Header/HeaderViewController.swift @@ -100,7 +100,7 @@ class HeaderViewController: UIViewController { insets: .zero ) - // Contrain the paging view to all edges. + // Constrain the paging view to all edges. pagingViewController.view.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ pagingViewController.view.topAnchor.constraint(equalTo: view.topAnchor), diff --git a/Example/Examples/Icons/IconPagingCell.swift b/Example/Examples/Icons/IconPagingCell.swift index 2bd3a599..8cba83f2 100644 --- a/Example/Examples/Icons/IconPagingCell.swift +++ b/Example/Examples/Icons/IconPagingCell.swift @@ -72,7 +72,7 @@ class IconPagingCell: PagingCell { private func setupConstraints() { imageView.translatesAutoresizingMaskIntoConstraints = false - let topContraint = NSLayoutConstraint( + let topConstraint = NSLayoutConstraint( item: imageView, attribute: .top, relatedBy: .equal, @@ -92,7 +92,7 @@ class IconPagingCell: PagingCell { constant: -15 ) - let leadingContraint = NSLayoutConstraint( + let leadingConstraint = NSLayoutConstraint( item: imageView, attribute: .leading, relatedBy: .equal, @@ -102,7 +102,7 @@ class IconPagingCell: PagingCell { constant: 0 ) - let trailingContraint = NSLayoutConstraint( + let trailingConstraint = NSLayoutConstraint( item: imageView, attribute: .trailing, relatedBy: .equal, @@ -113,10 +113,10 @@ class IconPagingCell: PagingCell { ) contentView.addConstraints([ - topContraint, + topConstraint, bottomConstraint, - leadingContraint, - trailingContraint, + leadingConstraint, + trailingConstraint, ]) } } diff --git a/Example/Examples/Images/UnsplashViewController.swift b/Example/Examples/Images/UnsplashViewController.swift index e7bf2cea..0982824d 100644 --- a/Example/Examples/Images/UnsplashViewController.swift +++ b/Example/Examples/Images/UnsplashViewController.swift @@ -163,7 +163,7 @@ class UnsplashViewController: UIViewController { ) // Add the paging view controller as a child view controller and - // contrain it to all edges. + // constrain it to all edges. addChild(pagingViewController) view.addSubview(pagingViewController.view) view.constrainToEdges(pagingViewController.view) @@ -236,7 +236,7 @@ extension UnsplashViewController: PagingViewControllerDataSource { extension UnsplashViewController: ImagesViewControllerDelegate { func imagesViewControllerDidScroll(_ imagesViewController: ImagesViewController) { // Calculate the menu height based on the content offset of the - // currenly selected view controller and update the menu. + // currently selected view controller and update the menu. let height = calculateMenuHeight(for: imagesViewController.collectionView) updateMenu(height: height) } diff --git a/Example/Examples/LargeTitles/LargeTitlesViewController.swift b/Example/Examples/LargeTitles/LargeTitlesViewController.swift index a27e32ba..fa78a121 100644 --- a/Example/Examples/LargeTitles/LargeTitlesViewController.swift +++ b/Example/Examples/LargeTitles/LargeTitlesViewController.swift @@ -1,7 +1,7 @@ import Parchment import UIKit -// This example shows how to use Parchment togehter with +// This example shows how to use Parchment together with // "prefersLargeTitles" on UINavigationBar. It works by creating a // "hidden" scroll view that is added as a subview to the view // controller. Apparently, UIKit will look for a scroll view that is @@ -116,7 +116,7 @@ class LargeTitlesViewController: UIViewController { hiddenScrollView.contentInset = viewController.tableView.contentInset hiddenScrollView.contentOffset = viewController.tableView.contentOffset - // Set the UITableViewDelegate to the currenly visible table view. + // Set the UITableViewDelegate to the currently visible table view. viewController.tableView.delegate = self } } @@ -154,7 +154,7 @@ extension LargeTitlesViewController: PagingViewControllerDelegate { guard let destinationViewController = destinationViewController as? TableViewController else { return } guard let startingViewController = startingViewController as? TableViewController else { return } - // Set the UITableViewDelegate back to the currenly selected + // Set the UITableViewDelegate back to the currently selected // view controller when the page scroll ended. if transitionSuccessful { destinationViewController.tableView.delegate = self diff --git a/Example/Examples/MultipleCells/MultipleCellsViewController.swift b/Example/Examples/MultipleCells/MultipleCellsViewController.swift index c6bbf291..a7dacef1 100644 --- a/Example/Examples/MultipleCells/MultipleCellsViewController.swift +++ b/Example/Examples/MultipleCells/MultipleCellsViewController.swift @@ -21,7 +21,7 @@ class MultipleCellsViewController: UIViewController { pagingViewController.select(index: 0) // Add the paging view controller as a child view controller - // and contrain it to all edges. + // and constrain it to all edges. addChild(pagingViewController) view.addSubview(pagingViewController.view) diff --git a/Example/Examples/SizeDelegate/SizeDelegateViewController.swift b/Example/Examples/SizeDelegate/SizeDelegateViewController.swift index 6b4567fe..bea5e5dd 100644 --- a/Example/Examples/SizeDelegate/SizeDelegateViewController.swift +++ b/Example/Examples/SizeDelegate/SizeDelegateViewController.swift @@ -2,7 +2,7 @@ import Parchment import UIKit final class SizeDelegateViewController: UIViewController { - // Let's start by creating an array of citites that we + // Let's start by creating an array of cities that we // will use to generate some view controllers. fileprivate let cities = [ "Oslo", @@ -30,7 +30,7 @@ final class SizeDelegateViewController: UIViewController { pagingViewController.sizeDelegate = self // Add the paging view controller as a child view controller and - // contrain it to all edges. + // constrain it to all edges. addChild(pagingViewController) view.addSubview(pagingViewController.view) view.constrainToEdges(pagingViewController.view) diff --git a/Example/Examples/Storyboard/StoryboardViewController.swift b/Example/Examples/Storyboard/StoryboardViewController.swift index 6c280a83..696d4258 100644 --- a/Example/Examples/Storyboard/StoryboardViewController.swift +++ b/Example/Examples/Storyboard/StoryboardViewController.swift @@ -19,7 +19,7 @@ class StoryboardViewController: UIViewController { ]) // Make sure you add the PagingViewController as a child view - // controller and contrain it to the edges of the view. + // controller and constrain it to the edges of the view. addChild(pagingViewController) view.addSubview(pagingViewController.view) view.constrainToEdges(pagingViewController.view) diff --git a/Example/Resources/UIView+constraints.swift b/Example/Resources/UIView+constraints.swift index 74f5349f..094df3c5 100644 --- a/Example/Resources/UIView+constraints.swift +++ b/Example/Resources/UIView+constraints.swift @@ -4,7 +4,7 @@ extension UIView { func constrainCentered(_ subview: UIView) { subview.translatesAutoresizingMaskIntoConstraints = false - let verticalContraint = NSLayoutConstraint( + let verticalConstraint = NSLayoutConstraint( item: subview, attribute: .centerY, relatedBy: .equal, @@ -14,7 +14,7 @@ extension UIView { constant: 0 ) - let horizontalContraint = NSLayoutConstraint( + let horizontalConstraint = NSLayoutConstraint( item: subview, attribute: .centerX, relatedBy: .equal, @@ -24,7 +24,7 @@ extension UIView { constant: 0 ) - let heightContraint = NSLayoutConstraint( + let heightConstraint = NSLayoutConstraint( item: subview, attribute: .height, relatedBy: .equal, @@ -34,7 +34,7 @@ extension UIView { constant: subview.frame.height ) - let widthContraint = NSLayoutConstraint( + let widthConstraint = NSLayoutConstraint( item: subview, attribute: .width, relatedBy: .equal, @@ -45,10 +45,10 @@ extension UIView { ) addConstraints([ - horizontalContraint, - verticalContraint, - heightContraint, - widthContraint, + horizontalConstraint, + verticalConstraint, + heightConstraint, + widthConstraint, ]) } diff --git a/Parchment/Classes/PageViewController.swift b/Parchment/Classes/PageViewController.swift index e5741930..f9299729 100644 --- a/Parchment/Classes/PageViewController.swift +++ b/Parchment/Classes/PageViewController.swift @@ -31,7 +31,7 @@ public final class PageViewController: UIViewController { /// The underlying scroll view where the page view controllers are /// added. Changing the properties on this scroll view might cause - /// undefined behaviour. + /// undefined behavior. public private(set) lazy var scrollView: UIScrollView = { let scrollView = UIScrollView() scrollView.isPagingEnabled = true diff --git a/Parchment/Classes/PagingMenuView.swift b/Parchment/Classes/PagingMenuView.swift index b9453e3a..a054f69a 100644 --- a/Parchment/Classes/PagingMenuView.swift +++ b/Parchment/Classes/PagingMenuView.swift @@ -36,7 +36,7 @@ open class PagingMenuView: UIView { set { options.menuHorizontalAlignment = newValue } } - /// Determine the transition behaviour of menu items while scrolling + /// Determine the transition behavior of menu items while scrolling /// the content. _Default: .scrollAlongside_ public var menuTransition: PagingMenuTransition { get { return options.menuTransition } @@ -61,7 +61,7 @@ open class PagingMenuView: UIView { } /// Determine how the selected menu item should be aligned when it - /// is selected. Effectivly the same as the + /// is selected. Effectively the same as the /// `UICollectionViewScrollPosition`. _Default: .preferCentered_ public var selectedScrollPosition: PagingSelectedScrollPosition { get { return options.selectedScrollPosition } @@ -270,14 +270,14 @@ open class PagingMenuView: UIView { } /// Selects a given paging item. This need to be called after you - /// initilize the `PagingViewController` to set the initial + /// initialize the `PagingViewController` to set the initial /// `PagingItem`. This can be called both before and after the view /// has been loaded. You can also use this to programmatically /// navigate to another `PagingItem`. /// /// - Parameter pagingItem: The `PagingItem` to be displayed. /// - Parameter animated: A boolean value that indicates whether - /// the transtion should be animated. Default is false. + /// the transition should be animated. Default is false. open func select(pagingItem: PagingItem, animated: Bool = false) { pagingController.select(pagingItem: pagingItem, animated: animated) } diff --git a/Parchment/Classes/PagingOptions.swift b/Parchment/Classes/PagingOptions.swift index 7c538f70..5a7ce68a 100644 --- a/Parchment/Classes/PagingOptions.swift +++ b/Parchment/Classes/PagingOptions.swift @@ -23,7 +23,7 @@ public struct PagingOptions { /// _Default: .top_ public var menuPosition: PagingMenuPosition - /// Determine the transition behaviour of menu items while scrolling + /// Determine the transition behavior of menu items while scrolling /// the content. _Default: .scrollAlongside_ public var menuTransition: PagingMenuTransition @@ -43,7 +43,7 @@ public struct PagingOptions { public var menuLayoutClass: PagingCollectionViewLayout.Type /// Determine how the selected menu item should be aligned when it - /// is selected. Effectivly the same as the + /// is selected. Effectively the same as the /// `UICollectionViewScrollPosition`. _Default: .preferCentered_ public var selectedScrollPosition: PagingSelectedScrollPosition diff --git a/Parchment/Classes/PagingView.swift b/Parchment/Classes/PagingView.swift index 1822ec0b..88f475e6 100644 --- a/Parchment/Classes/PagingView.swift +++ b/Parchment/Classes/PagingView.swift @@ -41,7 +41,6 @@ open class PagingView: UIView { } // MARK: Public Methods - /// Configures the view hierarchy, sets up the layout constraints /// and does any other customization based on the `PagingOptions`. /// Override this if you need any custom behavior. diff --git a/Parchment/Classes/PagingViewController.swift b/Parchment/Classes/PagingViewController.swift index 785683f5..0c4990a3 100644 --- a/Parchment/Classes/PagingViewController.swift +++ b/Parchment/Classes/PagingViewController.swift @@ -58,7 +58,7 @@ open class PagingViewController: set { options.menuPosition = newValue } } - /// Determine the transition behaviour of menu items while scrolling + /// Determine the transition behavior of menu items while scrolling /// the content. _Default: .scrollAlongside_ public var menuTransition: PagingMenuTransition { get { return options.menuTransition } @@ -83,7 +83,7 @@ open class PagingViewController: } /// Determine how the selected menu item should be aligned when it - /// is selected. Effectivly the same as the + /// is selected. Effectively the same as the /// `UICollectionViewScrollPosition`. _Default: .preferCentered_ public var selectedScrollPosition: PagingSelectedScrollPosition { get { return options.selectedScrollPosition } @@ -438,14 +438,14 @@ open class PagingViewController: } /// Selects a given paging item. This need to be called after you - /// initilize the `PagingViewController` to set the initial + /// initialize the `PagingViewController` to set the initial /// `PagingItem`. This can be called both before and after the view /// has been loaded. You can also use this to programmatically /// navigate to another `PagingItem`. /// /// - Parameter pagingItem: The `PagingItem` to be displayed. /// - Parameter animated: A boolean value that indicates whether - /// the transtion should be animated. Default is false. + /// the transition should be animated. Default is false. open func select(pagingItem: PagingItem, animated: Bool = false) { pagingController.select(pagingItem: pagingItem, animated: animated) } diff --git a/Parchment/Enums/PagingSelectedScrollPosition.swift b/Parchment/Enums/PagingSelectedScrollPosition.swift index 04d6675b..294612a1 100644 --- a/Parchment/Enums/PagingSelectedScrollPosition.swift +++ b/Parchment/Enums/PagingSelectedScrollPosition.swift @@ -7,7 +7,7 @@ public enum PagingSelectedScrollPosition { /// Centers the selected menu item where possible. If the item is /// to the far left or right, it will not update the scroll - /// position. Effectivly the same as .centeredHorizontally on + /// position. Effectively the same as .centeredHorizontally on /// UICollectionViewScrollPosition. case preferCentered } diff --git a/Parchment/Extensions/UIView+constraints.swift b/Parchment/Extensions/UIView+constraints.swift index 427cf813..72ec4370 100644 --- a/Parchment/Extensions/UIView+constraints.swift +++ b/Parchment/Extensions/UIView+constraints.swift @@ -4,7 +4,7 @@ extension UIView { func constrainToEdges(_ subview: UIView) { subview.translatesAutoresizingMaskIntoConstraints = false - let topContraint = NSLayoutConstraint( + let topConstraint = NSLayoutConstraint( item: subview, attribute: .top, relatedBy: .equal, @@ -24,7 +24,7 @@ extension UIView { constant: 0 ) - let leadingContraint = NSLayoutConstraint( + let leadingConstraint = NSLayoutConstraint( item: subview, attribute: .leading, relatedBy: .equal, @@ -34,7 +34,7 @@ extension UIView { constant: 0 ) - let trailingContraint = NSLayoutConstraint( + let trailingConstraint = NSLayoutConstraint( item: subview, attribute: .trailing, relatedBy: .equal, @@ -45,10 +45,10 @@ extension UIView { ) addConstraints([ - topContraint, + topConstraint, bottomConstraint, - leadingContraint, - trailingContraint, + leadingConstraint, + trailingConstraint, ]) } } diff --git a/Parchment/Protocols/PagingViewControllerDataSource.swift b/Parchment/Protocols/PagingViewControllerDataSource.swift index e14a81e8..5de4933c 100644 --- a/Parchment/Protocols/PagingViewControllerDataSource.swift +++ b/Parchment/Protocols/PagingViewControllerDataSource.swift @@ -17,7 +17,7 @@ public protocol PagingViewControllerDataSource: AnyObject { @MainActor func numberOfViewControllers(in pagingViewController: PagingViewController) -> Int - /// Return the view controller accociated with a given index. This + /// Return the view controller associated with a given index. This /// method is only called for the currently selected `PagingItem`, /// and its two possible siblings. /// diff --git a/Parchment/Protocols/PagingViewControllerInfiniteDataSource.swift b/Parchment/Protocols/PagingViewControllerInfiniteDataSource.swift index 3bad23b5..77ac96f8 100644 --- a/Parchment/Protocols/PagingViewControllerInfiniteDataSource.swift +++ b/Parchment/Protocols/PagingViewControllerInfiniteDataSource.swift @@ -8,7 +8,7 @@ import UIKit /// the initial `PagingItem` by calling `select(pagingItem:)` on /// `PagingViewController`. public protocol PagingViewControllerInfiniteDataSource: AnyObject { - /// Return the view controller accociated with a `PagingItem`. This + /// Return the view controller associated with a `PagingItem`. This /// method is only called for the currently selected `PagingItem`, /// and its two possible siblings. /// diff --git a/Parchment/Structs/PageView.swift b/Parchment/Structs/PageView.swift index 48052d3b..c6dc61f8 100644 --- a/Parchment/Structs/PageView.swift +++ b/Parchment/Structs/PageView.swift @@ -339,7 +339,7 @@ extension PageView { return view } - /// Determine the transition behaviour of menu items while + /// Determine the transition behavior of menu items while /// scrolling the content. public func menuTransition(_ transition: PagingMenuTransition) -> Self { var view = self diff --git a/README.md b/README.md index 7e1ebf9c..bb60cb75 100644 --- a/README.md +++ b/README.md @@ -240,7 +240,7 @@ Read more: [Using the infinite data source](/Documentation/infinite-data-source. ### Selecting items -You can select items programatically using: +You can select items programmatically using: ```Swift func select(pagingItem: PagingItem, animated: Bool = false)