- File Name:
2024-06-19 - OSS Library Status + Report.mdย - URL: dominicstop/2024-06-19 - OSS Library Status + Report.md (๐ attachments gist)
- Reports: 2024-07-06-21:11
2024-06-06-19:32-GMT+8-react-native-ios-utilities- Branch: wip-new-arch (current changes | all changes)
- Desc: WIP fix for build errors when
RNIBaseViewis used inreact-native-ios-modal.
2024-06-07-18:43-GMT+8-react-native-ios-utilities- Branch: wip-new-arch (current changes | all changes)
- Release:
v5.0.0-1(changes),v5.0.0-2(changes), - Desc: Compatibility fix for
react-native-ios-modal, and impl.RNIContentViewParentDelegate.reactSubviews+RNIContentViewParentDelegate.requestToRemoveReactSubview.
2024-06-13-12:09-GMT+8-ConfigBasedModal(all changes)- Desc: Initial scaffolding for
ConfigBasedModal- Setup example, example components, helpers, etc.- Impl.
AttributedStringConfig+FontConfig- Currently used for making the example cards, but this can be used in the future to create/represent "rich text" (e.g. text with image attachments, rich text input component, labels that containSFSymbolsor images viaNSAttachment, etc). - Impl. reusable components for making examples and tests.
- Impl. helper extensions for
UIViewController(e.g. for getting child VC items, and modal-related info).
- Impl.
- Desc: Initial scaffolding for
2024-06-15-12:06-GMT+8-ConfigBasedModal(all changes)- Desc: Impl. basic modal presentation + modal focus and presentation state.
- Impl.
ValueInjectable- Used to inject properties via associated objects at runtime; will be used to impl. per instance swizzling.
- Impl.
- Desc: Impl. basic modal presentation + modal focus and presentation state.
2024-06-17-16:44-GMT+8-ConfigBasedModal(all changes)- Desc: Impl. modal focus and presentation logic + events, and initial impl. for
ModalEventsReporting.- Impl. helpers + logic for getting the system/default modal gesture for sheet-based modals.
- Impl. helpers + logic for getting the system/default modal gesture for sheet-based modals.
- Desc: Impl. modal focus and presentation logic + events, and initial impl. for
2024-06-18-19:51-GMT+8-DGSwiftUtilities(all changes)2024-06-18-20:01-GMT+8-ConfigBasedModal(all changes)- Desc: Update + bump min. version for package:
DGSwiftUtilities, and remove temp. sources + replace w/ imports fromDGSwiftUtilities.- Add dep. to
VisualEffectBlurView.
- Add dep. to
- Desc: Update + bump min. version for package:
2024-06-18-22:02-GMT+8-VisualEffectBlurView(all changes)- Desc: Add dependency to
DGSwiftUtilities, and remove duplicate/redundant sources.
- Desc: Add dependency to
2024-06-19-17:25-GMT+8-VisualEffectBlurView(all changes)- Release:
2.0.0(changes) - Desc: Rewrite object wrappers - Remove
HashedStringDecodable,ObjectWrapper,ObjectWrapping, and replace usage w/ObjectWrapper+PrivateObjectWrapperfromDGSwifrUtilities.
- Release:
2024-06-21-09:14-GMT+8-VisualEffectBlurView(all changes)- Desc: Initial impl. for
LayerFilterWrapper.
- Desc: Initial impl. for
2024-06-21-11:04-GMT+8-DGSwiftUtilities(all changes)2024-06-21-13:33-GMT+8- Desc: Check dependents of
DGSwiftUtilities, and upgrade/update. - Attachments: dependency-tree (snapshot | latest)
2024-06-21-12:03-GMT+8-VisualEffectBlurView(changes)- Desc: Raise min. dependency to
DGSwiftUtilities.
- Desc: Raise min. dependency to
2024-06-21-12:19-GMT+8-ยConfigBasedModal(changes)- Desc: Raise min. dependency to
DGSwiftUtilities.
- Desc: Raise min. dependency to
2024-06-21-12:29-GMT+8-ComputableLayoutย(changes)- Desc: Update
DGSwiftUtilitiespackage and check if it compiles.
- Desc: Update
2024-06-21-12:40-GMT+8-ContextMenuAuxiliaryPreview(changes)- Desc: Update
DGSwiftUtilitiespackage and check if it compiles.
- Desc: Update
2024-06-21-13:06-GMT+8-adaptive-modal(branch:main- changes)- Desc: Update
DGSwiftUtilitiespackage and check if it compiles.
- Desc: Update
2024-06-21-13:08-GMT+8-adaptive-modal(branch:wip-3.x.x- changes | all changes)- Desc: Raise min. dependency to
DGSwiftUtilities, and replace usage w/ impl. fromDGSwiftUtilities.
- Desc: Raise min. dependency to
- Desc: Check dependents of
2024-06-21-21:56-GMT+8-VisualEffectBlurView- Attachments: ๐ผ๏ธ 2024-06-21-21-42-53 - 03.gif
- Log: Test for different
CAFiltereffects.
2024-06-22-07:24-GMT+8-VisualEffectBlurView- Attachments:
๐ Log-2024-06-22-Dump-UIBlurEffectStyle.txt,๐ Log-2024-06-22-Dump-UIVibrancyEffectStyle-01.txt,๐ Log-2024-06-22-Dump-CAFilters.txt,๐ Log-2024-06-22-Dump-UIVibrancyEffectStyle-02.txt - Desc: Log all the supported
CAFilterstrings (iOS 17), all the requested values/filter params (i.e._UIVisualEffectFilterEntry) for:UIVibrancyEffectStyle+UIBlurEffectStyle, (including theCAColorMatrixvalues).
- Attachments:
2024-06-23-22:09-GMT+8-VisualEffectBlurView- Attachments:
๐ Log-2024-06-23-Dump-UIBlurEffectStyle-02.txt,๐ Log-2024-06-23-Dump-UIBlurEffectStyle-03.txt,๐ Log-2024-06-23-Dump-CAColorMatrix.txt - Desc: For each
UIVibrancyEffect.Style, dump the descriptions for:UICABackdropLayer,_UIVisualEffectBackdropView,_UIVisualEffectDescriptor,_UIVisualEffectFilterEntry,_UIVisualEffectHost.
- Attachments:
- #
2024-06-24-13:20-GMT+8-VisualEffectBlurViewCAColorMatrixis a c struct that is a 5x4floatmatrix, so it has 20floatmembers.- The struct is defined in:
QuartzCore-Structs.h(e.g.<QuartzCore/CAColorMatrix.h>), and is defined like this:float m11, m12, m13, m14, m15;float m21, m22, m23, m24, m25;float m31, m32, m33, m34, m35;float m41, m42, m43, m44, m45;
NSValuesays the size is 80 byte.- A float is typically 4 bytes, so: 4 bytes per float * 20 float members = 80 bytes total. There is no extra bytes for alignment.
- A 2 digit hex number (e.g.
FF) is 2 bytes and can represent 256 numbers, UInt8is 1 byte (8 bits), andUInt16is 2 bytes,UInt32is 4 bytes, andUInt64is 8 bytes.- As such you will need 4 digit hex to represent a
UInt32.
- The first 4 "8 byte/
UInt64/64bit" values are always:0x31b16f3f 66cba4be abad7dbd 00000000, this indicates that it's an actual value and not garbage.- Pointing
NSValue.getValueto a buffer of size 80, with alignment of:MemoryLayout<UInt32>yields:31 b1 6f 3f 66 cb a4 be. - The first 4 bytes (i.e.
31 b1 6f 3f), matches:0x31b16f3f, and has a little endian float value:0.9362975. - The next 4 bytes (i.e.
66 cb a4 be), matches:66cba4be, and has a little endian float value:-0.3218643. - for ratio of "20 floats" : "80 bytes" (assuming 2 floats are packed into 8 bytes), need to offset by 9 to read all 20 floats.
- Assumption: "2 floats are packed into 8 bytes" because it's exactly 64 bits, and ios is running on
ARM64, so it's aligned to always use 8 bytes for addressing. - Create buffer via
var buffer = [UInt32](repeating: 0, count: 20), and then write the raw bytes via:inputColorMatrix.getValue(&buffer, size: 80)- Array size = 20
- index 0-3:
[0.9362975, -0.3218643, -0.0619332, 0.0] - index 4-7:
[0.04874998, -0.1635529, 0.7786505, -0.06259762] - index 8-11:
[0.0, 0.04874998, -0.1642173, -0.3208677] - index 12-15:
[1.037585, 0.0, 0.04875004, 0.0] - index 16-19:
[0.0, 0.0, 1.0, 0.0]
- This doesn't look right, via swizzling
[NSValue description], we get the ff. output:vibrantColorMatrix[inputColorMatrix] = CAColorMatrix:{0.936297, -0.321864, -0.061933, 0.000000, 0.048750}{-0.163553, 0.778651, -0.062598, 0.000000, 0.048750}{-0.164217, -0.320868, 1.037585, 0.000000, 0.048750}{0.000000, 0.000000, 0.000000, 1.000000, 0.000000}
- Via debugger, inspecting
CAColorMatrixyields:(CAColorMatrix) colorMatrixm11 = 0.936297476,m12 = -0.321864307,m13 = -0.0619332008,m14 = 0,m15 = 0.0487499796.m21 = -0.163552895,m22 = 0.778650522,m23 = -0.0625976175,m24 = 0,m25 = 0.0487499796.m31 = -0.164217293,m32 = -0.320867687,m33 = 1.03758502,m34 = 0,m35 = 0.0487500392.m41 = 0,m42 = 0,m43 = 0,m44 = 1,m45 = 0.
- The values returned by
_UIVisualEffectFilterEntry.identityValues:m11: 1.0, m12: 0.0, m13: 0.0, m14: 0.0, m15: 0.0,m21: 0.0, m22: 1.0, m23: 0.0, m24: 0.0, m25: 0.0,m31: 0.0, m32: 0.0, m33: 1.0, m34: 0.0, m35: 0.0,m41: 0.0, m42: 0.0, m43: 0.0, m44: 1.0, m45: 0.0
- Pointing
- The concrete value might be:
redPrimary={0.936297 -0.321864 -0.061933 0.000000}greenPrimary={-0.163553 0.778651 -0.062598 0.000000}bluePrimary={-0.164217 -0.320868 1.037585 0.000000}alphaPrimary={0.000000 0.000000 0.000000 1.000000}additiveColor={0.048750 0.048750 0.048750 0.000000}
- The objc type is not stable across runs/compiles, but stable across the entire lifecycle of the app.
NSValue.objCTypeis of type:UnsafePointer<CChar>- Docs: This property provides the same string produced by the
@encode()compiler directive.
- What i don't understand is why is
CAColorMatrixhave uneven rows/columns? - Mapping: Matrix -> color components (incomplete)
redPrimary ย ={m11 m12 m13 ???}greenPrimary ={m21 m22 m23 ???}bluePrimary ย ={m31 m32 m33 ???}alphaPrimary ={??? ??? ??? m44}additiveColor={m15 m16 m17 ???}
- Mapping: Color components -> matrix (incomplete)
m11: r1, m12: r2, m13: r3, m14: ??, m15: d1m21: g1, m22: g2, m23: g3, m24: ??, m25: d2m31: b1, m32: b2, m33: b3, m34: ??, m35: d3m41: ??, m42: ??, m43: ??, m44: a4, m45: ??
- color components (identity):
redPrimary ย ={1 0 0 0}greenPrimary ={0 1 0 0}bluePrimary ย ={0 0 1 0}alphaPrimary ={0 0 0 1}additiveColor={0 0 0 0}
- #
2024-06-24-21:42-GMT+8-VisualEffectBlurView(changes)- Desc: WIP impl. for
VisualEffectView,LayerFilterType, andColorMatrixRGBA.
- Desc: WIP impl. for
2024-06-25-22:47-GMT+8-VisualEffectBlurView- Attachments:
๐ 2024-06-25-CAColorMatrix-Unique.txt
- Attachments:
- #
2024-07-03-04:11-GMT+8-VisualEffectBlurView(changes)- Attachments:
๐ผ Screen-Recording-2024-07-01-at-07-47-PM.mov - Related:
๐ฆ tweet-2024-07-03-05:54-GMT+8 - Desc: Impl.
LayerFilterType, rename symbols, and impl.variableBlurfilter.- Initial work to rename symbols so that they don't match the private API identifiers.
- Improvements to
PrivateObjectWrapper- Allow for creating instances directly viaPrivateObjectWrapper.createInstance, and a "helper" initializer (i.e.PrivateObjectWrapper.init()). - Extract the
ColorMatrixpresets used byUIVibrancyEffectto help with testing. - Update
ColorMatrixRGBAso that it can be used to configure a filter effect (i.e.LayerFilterType). - Impl.
LayerFilterTypeEnum - Used to configure a filter, and set the filter parameters, as well as for creating a layer filter (i.e. viaLayerFilterType.createFilterWrapper), and applying the "filter configuration" to a existing layer filter (e.g. viaLayerFilterType.applyTo(layerFilterWrapper:)). - Impl.
LayerFilterType.variadicBlur- ExposesvariableBlurfilter. - Consolidate - Create
FilterEntryMetadatatype as a unified container for extracting filter-related metadata from the standardUIVisualEffecteffects (i.e.UIBlurEffect+UIVibrancyEffect).
- Attachments:
2024-07-05-17:00-GMT+8-VisualEffectBlurViewLogs- Attachments:
๐ Log-Inspect-CALayer-setValue-forKey.txt,๐ Log-Inspect-_UIVisualEffectDescriptor.txt - Desc: Trying to figure out how to use
[_UIVisualEffectDescriptor addFilterEntry:]and inspecting[CALayer setValue:forKey:]. - Note: The timestamp is approx. because I forgot to copy/paste the current time.
- Attachments:
2024-07-03-04:59-GMT+8-DGSwiftUtilities(all changes)2024-07-06-06:34-GMT+8-VisualEffectBlurView(changes)- Attachments:
๐ผ Render-02-2024-07-06-06-39-51.mp4 - Related:
๐๏ธ VisualEffectBlurTestViewController.gif,๐ฆ tweet-2024-07-06-07:20-GMT+8 - Desc: Creating the methods for
VisualEffectViewto apply and update the filters.- More work to rename classes, enums, and property/dictionary keys so that they don't match the private API identifiers (e.g. replaced prefix
UIVisualEffect-w/UVE-, renamed methods with synonyms. etc). - Bumped min. dep. to
DGSwiftUtilitiesfrom0.23.0to0.24.0, and removed temp. sources that were migrated toDGSwiftUtilities, and replace them with imports. - Impl. method to apply the "filter configuration" (i.e. the filter values + filter type) to
UVEFilterEntryWrapperviaLayerFilterType.applyTo(filterEntryWrapper:). - Impl. setting/applying filter effects to
VisualEffectViewviaVisualEffectView.setFiltersViaLayers, andVisualEffectView.setFiltersUsingEffectDesc. - Impl.
LayerFilterTypecomputed properties for getting the "filter configuration" (i.e. the various filter-related values) as dictionaries. - Updated to use "effect descriptors" to set/update the layer filters via:
- Impl. initializers for
UVEFilterEntryWrapperto allow for the creation of_UIVisualEffectFilterEntryvia exposinginitWithFilterType:configurationValues:requestedValues:identityValues: - Impl.
UVEDescriptorWrappermethods (i.e. wrapper for_UIVisualEffectDescriptor) to set/update the "filter entries" (e.g.setFilterValuesIdentity,setFilterValuesConfig,updateFilterItems).
- Impl. initializers for
- More work to rename classes, enums, and property/dictionary keys so that they don't match the private API identifiers (e.g. replaced prefix
- Attachments:
- #
2024-07-06-07:33-GMT+8-DGSwiftUtilities(all changes)- Release:
0.25.0 - Desc: Imported shared helpers/utilities from
VisualEffectBlurView.
- Release:
- #
2024-07-06-21:11-GMT+8- Report Summary- Attachment:
๐ผ Screen-Recording-2024-07-06-at-09-51-PM.mp4 - Last Report: 2024-06-24-21:42-GMT+8 (โ 12 days ago)
- Report Range: 2024-07-03-04:11-GMT+8 โ 2024-07-06-07:33-GMT+8
- Desc: Updated
VisualEffectViewto allow for setting of layer filter effects.
- Attachment:
2024-07-24-16:13-GMT+8-DGSwiftUtilities(all changes)- Release:
0.26.0 - Date Range:
2024-07-10-04:12-GMT+8->2024-07-24-16:13-GMT+8 - Desc: Impl. interpolation-related helpers based on
adaptive-modalusing a generic + protocol-oriented approach.
- Release:
2024-07-26-16:26-GMT+8-VisualEffectBlurView(all changes)- Release:
3.0.0 - Date Range:
2024-06-19-22:51-GMT+8->2024-07-11-03:44-GMT+8,2024-07-25-04:55-GMT+8->2024-07-26-16:26-GMT+8. - Desc: Exposes custom
CALayerfilters inVisualEffectView.
- Release:
- #
2024-07-26-16:26-GMT+8-react-native-ios-visual-effect-view(changes)- Related:
๐ฆ tweet-2024-07-26-10:56-GMT+8 - Desc: Contains the wip/demo impl. of
VisualEffectBlurView+react-native-ios-utlitiesnew arch compatibility layer.
- Related:
WIP Changes - Placeholder for commits/changes that aren't logged yet.
- N/A
TBA- In order to use
ColorMatrixRGBA/CAColorMatrix, some "Color Transformations" matrix/linear algebra math is needed?- So while the matrix looks very complicated, it's representing a
RGBAvector; but it's being stored as a matrix to make it easier to "transform" colors via matrix multiplication.
- So while the matrix looks very complicated, it's representing a
- Looking at the dumped matrix values, i think it's used for "tinting" the layer, i.e. by adj. the values in the matrix, the "influence" of color channel (rgb) changes, making the view appear tinted towards that color.
- This is similar to
Transform3D(a swift wrapper type for:CATransform3D), however i do not know what values to multiply to achieve tinting yet.- I think similar to transforms, by multiplying certain values, color "effects" (e.g. color/hue shifting, brightness, saturation, tinting, etc) can be performed.
- There seems to be a concept of "rotation" to achieve hue shifting.
- Although not exactly 1:1, there's a protocol called
CIColorMatrix.- it has 5 channels i.e. RGBA + something called "bias vector'.
- Each channel is of type:
CIVector, which holds 4 values:x,y,z, andw. - This kinda matches
CAColorMatrix; they are both4x5.
- On further research, i came across
YCbCrcolorsplace; althoughYCbCris using a 3x3 matrix, andCAColorMatrixis 5x4 (rgba + "additive color"), they are sort of similar? - Reference Link - "almost any color can be represented as a linear combination of red, green, and blue. But you can transform (or "rotate") that coordinate system such that the three basis elements are no longer RGB."
- Related Keywords: "color coordinate systems".
- In order to use
Task
f03c15: Unify animation api/types using the base impl. inadaptive-modalLerpComputableprotocol +LerpInterpolatorstruct.- Alternate names:
LerpDrivenAnimation
- Alternate names:
LerpComputable: protocol to compose different lerping animation together.- Accept an array of โlerp-ableโ animation values; Each "entry" has to have name/id so that they can be uniquely identified.
- Probably Use look up table/dict, because just using an array will have to be ordered.
- Requirements for protocol:
inputValue(e.g.inputPercentValue),inputPercentValue,rangeOutput, and clamping configuration - Use cache for
rangeOutput. - Driven by percentage; receives a percent, computes lerp, then applies the value to target.
LerpComputablehas the logic to compute the lerp/interpolated value for types:CGRect,CGSize,UIColor, etc.
- Somehow apply lerp result to some target (e.g. property) via:
- Target object + keypath
- Accept block that gets continuously invoked; block receives new value.
- Clamping config; each "lerpable" type will have a "clamping config" set type.
- Config used create a lerping function that can be cached, and recreated from scratch.
Task
#a4ded7: Unify keyframe based animation (based onadaptive-modal), and make lerp + keyframe based animations work together.- Common keyframe configuration than can be specialized/customized.
- The animation can be animated to a "keyframe position" either manually using a percent, or via
UIViewPropertyAnimator. - Track the various states; the current keyframe, animation state, etc. should be tracked.
- A bunch of keyframes (
KeyframeGroup?) will produceLerpComputable, and will be given toLerpInterpolatorto manually drive the interpolation animation (e.g. via a gesture) using aCGFloatpercent.- Experiment - If the animation is simple enough, use
UIViewPropertyAnimatorto drive all animations; past testing did not work, try again. - Given 2 keyframe items,
keyframeStartandkeyframeEnd(which can be a single keyframe, or multiple), there is enough info to createUIViewPropertyAnimator.
- Experiment - If the animation is simple enough, use
- There should be a way for animations that don't work with
UIView.animate/CABasicAnimationto be "animated" (i.e. animations that are manually driven byCADisplayLink). - Concept: A
KeyframeItem= something like:{a: 0, b: 1}KeyframeGroup= something like:[{a: 0}, {b: 0}, {a: 1, b: 1}]- Computing
KeyframeGroupresults inname-tba-foo, which is something like:[{a:0,b:0}, {a:0,b:0}, {a:1,b:1}]or:[{a:0,b:0}, {a:0.5,b:0}, {a:1,b:1}]. - The former uses "fill in the blanks using the prev. item" (i.e.
fillMissingValuesViaCopyingmode), and latter uses "fill in the blank using lerp + current position in percent" (i.e.fillMissingValuesUsingLerp). - The former (i.e.
fillMissingValuesViaCopying) is useful for animation that have "snapping" points.- In other words, animations that have "discrete steps" where a "in-between"/interpolated value does not make sense.
- E.g. like the snapping points in
adaptive-modal.
- The latter (i.e.
fillMissingValuesUsingLerp) is more useful for animations that happen "fluidly"- In other words, animations that happen "all in one go" w/ a set duration that may or may not be interrupted.
- E.g. this will be useful for standalone animations, like animating to a blur radius in
VisualEffectBlurView.
name-tba-foois composed of individual steps which will be called:name-tba-bar-item.- What we have so far:
KeyframeGroupis composed ofKeyframeItem.KeyframeItemhas gaps/missing values.KeyframeGroupcan be "computed" to producename-tba-foo.name-tba-foois composed ofname-tba-bar-item.name-tba-bar-itemdoes not have any gaps or missing values.
- Concept:
KeyframeItem,KeyframeGroup->InterpolationPoint
Task
#7caf2d: Create the config type forConfigBasedModal- Possible modal config items:
overlay,modalBackground,modalDragIndicator. - Possible "modal" type:
basicSheet- Config item -
modalBackgroundEffect:systemBlurEffect,customEffect,customEffectWithAppearance - Config item -
modalAccessoryView - Config item -
modalDragIndicator.
- Config item -
- Possible "modal" type:
basicSheetWithKeyframes- Config item -
shouldAllowGestureToDriveAnimation - Config item -
startKeyframe - Config item -
endKeyframe
- Config item -
- Struct type:
ModalAccesoryConfig- modes:
edge,stretch - edgeAnchor:
top,outerTop,bottom,outerBottom,bottom, etc. - stretch, center, leading trailing
- viewProvider:
- modes:
- Possible modal config items: