-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from kyleve/kve/file-organization-1
Reorganize files by splitting many apart ahead of writing missing docs.
- Loading branch information
Showing
32 changed files
with
584 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,7 +298,7 @@ public struct Content | |
} | ||
|
||
|
||
internal extension Content | ||
extension Content | ||
{ | ||
struct Slice | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// AnyHeaderFooter.swift | ||
// ListableUI | ||
// | ||
// Created by Kyle Van Essen on 12/14/20. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
public protocol AnyHeaderFooter : AnyHeaderFooter_Internal | ||
{ | ||
var sizing : Sizing { get set } | ||
var layout : HeaderFooterLayout { get set } | ||
} | ||
|
||
|
||
public protocol AnyHeaderFooter_Internal | ||
{ | ||
var layout : HeaderFooterLayout { get } | ||
|
||
func apply( | ||
to headerFooterView : UIView, | ||
for reason : ApplyReason, | ||
with info : ApplyHeaderFooterContentInfo | ||
) | ||
|
||
func anyIsEquivalent(to other : AnyHeaderFooter) -> Bool | ||
|
||
func newPresentationHeaderFooterState(performsContentCallbacks : Bool) -> Any | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// HeaderFooterLayout.swift | ||
// ListableUI | ||
// | ||
// Created by Kyle Van Essen on 12/14/20. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
public struct HeaderFooterLayout : Equatable | ||
{ | ||
public var width : CustomWidth | ||
|
||
public init( | ||
width : CustomWidth = .default | ||
) { | ||
self.width = width | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
ListableUI/Sources/Internal/Presentation State/PresentationState.RefreshControl.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// RefreshControl.PresentationState.swift | ||
// ListableUI | ||
// | ||
// Created by Kyle Van Essen on 12/14/20. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
extension PresentationState | ||
{ | ||
internal final class RefreshControlState | ||
{ | ||
public var model : RefreshControl | ||
public var view : UIRefreshControl | ||
|
||
public init(_ model : RefreshControl) | ||
{ | ||
self.model = model | ||
self.view = UIRefreshControl() | ||
|
||
self.view.addTarget(self, action: #selector(refreshControlChanged), for: .valueChanged) | ||
} | ||
|
||
func update(with control : RefreshControl) | ||
{ | ||
self.model = control | ||
|
||
if let title = self.model.title { | ||
switch title { | ||
case .string(let string): self.view.attributedTitle = NSAttributedString(string: string) | ||
case .attributed(let string): self.view.attributedTitle = string | ||
} | ||
} else { | ||
self.view.attributedTitle = nil | ||
} | ||
|
||
self.view.tintColor = self.model.tintColor | ||
|
||
if self.model.isRefreshing { | ||
self.view.beginRefreshing() | ||
} else { | ||
self.view.endRefreshing() | ||
} | ||
} | ||
|
||
@objc func refreshControlChanged() | ||
{ | ||
self.model.onRefresh() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// AnyItem.swift | ||
// ListableUI | ||
// | ||
// Created by Kyle Van Essen on 12/14/20. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
public protocol AnyItem : AnyItem_Internal | ||
{ | ||
var identifier : AnyIdentifier { get } | ||
|
||
var anyContent : Any { get } | ||
|
||
var sizing : Sizing { get set } | ||
var layout : ItemLayout { get set } | ||
var selectionStyle : ItemSelectionStyle { get set } | ||
var insertAndRemoveAnimations : ItemInsertAndRemoveAnimations? { get set } | ||
var swipeActions : SwipeActionsConfiguration? { get set } | ||
|
||
var reordering : Reordering? { get set } | ||
} | ||
|
||
|
||
public protocol AnyItem_Internal | ||
{ | ||
func anyWasMoved(comparedTo other : AnyItem) -> Bool | ||
func anyIsEquivalent(to other : AnyItem) -> Bool | ||
|
||
func newPresentationItemState( | ||
with dependencies : ItemStateDependencies, | ||
updateCallbacks : UpdateCallbacks, | ||
performsContentCallbacks : Bool | ||
) -> Any | ||
} |
Oops, something went wrong.