KeyParamsSequence
internal struct KeyParamsSequence : Sequence, IteratorProtocol
Custom sequence / iterator that will spit out 2-tuples of CGRect and Note values for the next key in a keyboard view.
-
Construct a new sequence generator for the given settings
Declaration
Swift
init(keyWidth: CGFloat, keyHeight: CGFloat, firstMidiNote: Int, lastMidiNote: Int)Parameters
widththe key width to use
keyHeightthe key height to use
firstMidiNotethe MIDI note of the first key to generate
lastMidiNotethe MIDI note of the last key to generate
-
Create a new iterator for the sequence.
Declaration
Swift
@inlinable func makeIterator() -> KeyParamsSequenceReturn Value
self
-
Declaration
Swift
@inlinable var underestimatedCount: Int { get } -
Obtain the next element from the sequence.
Declaration
Swift
mutating func next() -> (CGRect, Note)?Return Value
2-tuple containing the frame to use for the key and the note that the key will play
View on GitHub
KeyParamsSequence Structure Reference