Skip to content

Commit

Permalink
Merge pull request #724 from rechsteiner/spellcheck
Browse files Browse the repository at this point in the history
Fix spellchecking errors
  • Loading branch information
rechsteiner authored Aug 10, 2024
2 parents 22b92d5 + 8532621 commit 1f6c109
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Example/Examples/Header/HeaderViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
12 changes: 6 additions & 6 deletions Example/Examples/Icons/IconPagingCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -92,7 +92,7 @@ class IconPagingCell: PagingCell {
constant: -15
)

let leadingContraint = NSLayoutConstraint(
let leadingConstraint = NSLayoutConstraint(
item: imageView,
attribute: .leading,
relatedBy: .equal,
Expand All @@ -102,7 +102,7 @@ class IconPagingCell: PagingCell {
constant: 0
)

let trailingContraint = NSLayoutConstraint(
let trailingConstraint = NSLayoutConstraint(
item: imageView,
attribute: .trailing,
relatedBy: .equal,
Expand All @@ -113,10 +113,10 @@ class IconPagingCell: PagingCell {
)

contentView.addConstraints([
topContraint,
topConstraint,
bottomConstraint,
leadingContraint,
trailingContraint,
leadingConstraint,
trailingConstraint,
])
}
}
4 changes: 2 additions & 2 deletions Example/Examples/Images/UnsplashViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions Example/Examples/LargeTitles/LargeTitlesViewController.swift
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Example/Examples/Storyboard/StoryboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions Example/Resources/UIView+constraints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -14,7 +14,7 @@ extension UIView {
constant: 0
)

let horizontalContraint = NSLayoutConstraint(
let horizontalConstraint = NSLayoutConstraint(
item: subview,
attribute: .centerX,
relatedBy: .equal,
Expand All @@ -24,7 +24,7 @@ extension UIView {
constant: 0
)

let heightContraint = NSLayoutConstraint(
let heightConstraint = NSLayoutConstraint(
item: subview,
attribute: .height,
relatedBy: .equal,
Expand All @@ -34,7 +34,7 @@ extension UIView {
constant: subview.frame.height
)

let widthContraint = NSLayoutConstraint(
let widthConstraint = NSLayoutConstraint(
item: subview,
attribute: .width,
relatedBy: .equal,
Expand All @@ -45,10 +45,10 @@ extension UIView {
)

addConstraints([
horizontalContraint,
verticalContraint,
heightContraint,
widthContraint,
horizontalConstraint,
verticalConstraint,
heightConstraint,
widthConstraint,
])
}

Expand Down
2 changes: 1 addition & 1 deletion Parchment/Classes/PageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Parchment/Classes/PagingMenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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 }
Expand Down Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions Parchment/Classes/PagingOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion Parchment/Classes/PagingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions Parchment/Classes/PagingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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 }
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion Parchment/Enums/PagingSelectedScrollPosition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
12 changes: 6 additions & 6 deletions Parchment/Extensions/UIView+constraints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -24,7 +24,7 @@ extension UIView {
constant: 0
)

let leadingContraint = NSLayoutConstraint(
let leadingConstraint = NSLayoutConstraint(
item: subview,
attribute: .leading,
relatedBy: .equal,
Expand All @@ -34,7 +34,7 @@ extension UIView {
constant: 0
)

let trailingContraint = NSLayoutConstraint(
let trailingConstraint = NSLayoutConstraint(
item: subview,
attribute: .trailing,
relatedBy: .equal,
Expand All @@ -45,10 +45,10 @@ extension UIView {
)

addConstraints([
topContraint,
topConstraint,
bottomConstraint,
leadingContraint,
trailingContraint,
leadingConstraint,
trailingConstraint,
])
}
}
2 changes: 1 addition & 1 deletion Parchment/Protocols/PagingViewControllerDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion Parchment/Structs/PageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1f6c109

Please sign in to comment.