Stanwood
public struct Stanwood
Stanwood global instance
-
Checking if Snapshot is running.
Declaration
Swift
public let isRunningSnapshot: Bool
-
The
AbstractCollectionDataSource
conforms to theCollectionDataSource
protocol and implementsAbstractCollectionDataSource.numberOfSections(in:)
andAbstractCollectionDataSource.collectionView(_:numberOfItemsInSection:)
. It midiates the application data modelDataType
andType
for theUICollectionView
.It is requried to subclass
AbstractCollectionDataSource
and overrideAbstractCollectionDataSource.collectionView(_:cellForItemAt:)
Example: DataSource and Delegate design
let items = [Element(id: "1"), Element(id: "2")] self.objects = Stanwood.Elements<Element>(items: items) self.dataSource = ElementDataSource(dataObject: objects) self.delegate = ElementDelegate(dataObject: objects) self.collectionView.dataSource = self.dataSource self.collectionView.delegate = self.delegate
See also
See moreObjects
Declaration
Swift
@available(*, deprecated, message: "Migrate to `CollectionDataSource` https://github.com/stanwood/SourceModel_iOS") open class AbstractCollectionDataSource : NSObject, UICollectionViewDataSource, CollectionDataSource, DataSourceType
-
The
AbstractCollectionDelegate
conforms to theCollectionDelegate
protocol. It allows you to manage the selection and highlighting of items in a collection view and to perform actions on those items.UICollectionView
.Example: DataSource and Delegate design
let items = [Element(id: "1"), Element(id: "2")] self.objects = Stanwood.Elements<Element>(items: items) self.dataSource = ElementDataSource(dataObject: objects) self.delegate = ElementDelegate(dataObject: objects) self.collectionView.dataSource = self.dataSource self.collectionView.delegate = self.delegate
See also
See moreObjects
Declaration
Swift
@available(*, deprecated, message: "Migrate to `CollectionDelegate` https://github.com/stanwood/SourceModel_iOS") open class AbstractCollectionDelegate : NSObject, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, CollectionDelegate, DelegateSourceType
-
The
AbstractTableDataSource
conforms to theTableDataSource
protocol and implementsAbstractTableDataSource.numberOfSections(in:)
andAbstractTableDataSource.tableView(_:numberOfRowsInSection:)
. It midiates the application data modelDataType
andType
for theUITableView
.It is requried to subclass
AbstractTableDataSource
and overrideAbstractTableDataSource.tableView(_:cellForRowAt:)
Example: DataSource and Delegate design
let items = [Element(id: "1"), Element(id: "2")] self.objects = Stanwood.Elements<Element>(items: items) self.dataSource = ElementDataSource(dataType: objects) self.delegate = ElementDelegate(dataType: objects) self.tableView.dataSource = self.dataSource self.tableView.delegate = self.delegate
See also
See moreObjects
Declaration
Swift
@available(*, deprecated, message: "Migrate to `TableDataSource` https://github.com/stanwood/SourceModel_iOS") open class AbstractTableDataSource : NSObject, UITableViewDataSource, TableDataSource, DataSourceType
-
The
AbstractTableDelegate
conforms to theTableDelegate
protocol. It allows you to manage the selection and highlighting of items in a collection view and to perform actions on those items.UITableView
.Example: DataSource and Delegate design
let items = [Element(id: "1"), Element(id: "2")] self.objects = Stanwood.Elements<Element>(items: items) self.dataSource = ElementDataSource(dataType: objects) self.delegate = ElementDelegate(dataType: objects) self.tableView.dataSource = self.dataSource self.tableView.delegate = self.delegate
See also
See moreObjects
Declaration
Swift
@available(*, deprecated, message: "Migrate to `TableDelegate` https://github.com/stanwood/SourceModel_iOS") open class AbstractTableDelegate : NSObject, UITableViewDelegate, TableDelegate, DelegateSourceType
-
Coding bridge is a helper struct that bridge NSCoding and Codable objects
See moreDeclaration
Swift
public struct CodingBridge<Coding> : Codable where Coding : NSCoding
-
Elements holds an array of element types.
Important: only supports a single section dataType. For a more complex solution, please conform to the
DataType
protocol.Example: DataSource and Delegate design
let items = [Element(id: "1"), Element(id: "2")] self.objects = Stanwood.Elements<Element>(items: items) self.dataSource = ElementsDataSource(dataObject: elements) self.delegate = ElementsDelegate(dataObject: elements) self.collectionView.dataSource = self.dataSource self.collectionView.delegate = self.delegate
See also
Declaration
Swift
@available(*, deprecated, message: "Migrate to https://github.com/stanwood/SourceModel_iOS") open class Elements<Element> : DataType, Codable where Element : Type, Element : Decodable, Element : Encodable, Element : Equatable
-
Declaration
Swift
@available(iOS 10.0, *) open class FeedbackGenerator
-
A convinient observer class to add observers to
See moreNotificationCenter
Declaration
Swift
public struct Observer
-
Sections holds an array of DataTypes.
Example: DataSource and Delegate design
let itemsOne = [Item(id: "1"), Item(id: "2")] let itemsTwo = [Meal(id: "pizza"), Meal(id: "ham")] let sectionOnce = Stanwoon.Elements<Item>(items: itemsOne) let sectionTwo = Stanwoon.Elements<Meal>(items: itemsTwo) self.sections = Stanwood.Sections(items: [sectionOnce, sectionTwo]) self.dataSource = SectionsDataSource(dataObject: self.sections) self.delegate = SectionsDelegate(dataObject: self.sections) self.collectionView.dataSource = self.dataSource self.collectionView.delegate = self.delegate
See also
Declaration
Swift
@available(*, deprecated, message: "Migrate to https://github.com/stanwood/SourceModel_iOS") open class Sections : DataType
-
Inherit AutoSizeableCell to conform to Autosizable protocol
See moreDeclaration
Swift
@available(iOS 10.0, *) open class AutoSizeableCell : UICollectionViewCell, AutoSizeable