Entries with the open-source tag
Pull request Do not reset backgroundView when delegate is nil on composed-swift/Composed
Partial fix for #31
Pull request Work around memory leak when checking for `nil` on composed-swift/Composed
Added to work around https://bugs.swift.org/browse/SR-14103
Pull request Cache `SingleElementSections.numberOfElements` on composed-swift/Composed
Overall this is pretty minor but when dealing with a lot of SingleElementSections
that are infrequently updated is does start to slow down.
I thought a faster approach would be to use generics on replace(element:)
to only check for nil
when the value is Optional
, but generics don't allow for this kind of overload.
Also added some basic tests. The performance tests show a ~9% performance increase.
Pull request Batch collection view updates on composed-swift/Composed
Replacing https://github.com/composed-swift/ComposedUI/pull/15
Pull request Pull in OpenNet changes on composed-swift/Composed
This PR is being used to diff between the OpenNet fork.
Hopefully other PRs will be merged before this (e.g. https://github.com/composed-swift/Composed/pull/21), which should lead to this PR having no changes and purely to ensure some of the history is not lost.
Pull request Update `sectionOffset(for:)` to return optional on composed-swift/Composed
We've discussed returning -1
not being great previously, but now we have the 2.0
branch we can make this change :)
Pull request Update SwiftPM package syntax in documentation on apple/swift-protobuf
- Tags:
- open-source
Updated to match syntax in README.md.
Maybe these were intentionally left because the package has a minimum tools version of 4.2?
Pull request Cache nib registrations to improve performance on composed-swift/Composed
@bill201207 found that UINib(nibName:bundle:)
is a big part of the poor performance when our app launches.
Ultimately batching updates will help with a lot of things like this, but really that'll just be masking some of the performance issues so it's useful to find issues like this now.
Pull request Merge ComposedLayout and ComposedUI packages on composed-swift/Composed
This adds the ComposedLayout
and ComposedUI
packages, which will close #16.
The base for this is 2.0-beta
, which we can use for testing new changes, which can also break API.
If you go to the repo settings you can (temporarily) set the default branch to 2.0-beta
and we can add a note to the README stating this is the beta release and the stable release is available in the master
branch.
Once merged and these changes are made the READMEs for ComposedLayout
and ComposedUI
repos can be updated to point to this repo and their repos archived.
Pull request Add `FlatSection` on composed-swift/Composed
This is a new type of section that is similar to ComposedSectionProvider
, but rather than flattening each of the children in to a single SectionProvider
it flattens them in to a single Section
.
The ComposedUI
side of this has been updated to support multiple cells per section, with a convenience for FlatSection
that delegates the calls to each of the flattened sections.
This is a breaking change since the protocol requirements have changed. I have set the base of the PR to merge-all-libraries
since that's also a breaking change and this PR relies on those changes.
edit: We've moved to our own fork to allow for more rapid development. The latest changes are in https://github.com/opennetltd/Composed/tree/feature/FlatSection, which will eventually be merged back in to this repo once some of the other PRs/issues have been resolved.
Pull request Use default Xcode version on composed-swift/Composed
In my open source frameworks I usually use the last major Xcode (currently 11.7), latest (currently 12.3) and latest beta (soon to be 12.4), but this project has only been setup for the latest version of Xcode.
If we feel it's good to run the tests across multiple Xcode versions I have created https://github.com/JosephDuffy/update-xcode-version-action, which we can use to keep the versions in-sync with the versions available as part of GitHub actions.
For now I've removed all use a explicit Xcode versions.
Pull request Fix crash switching segmented provider's segment on composed-swift/Composed
Regression introduce in 1.1.1.
Would occur when a segmented provider was the last child of a composed provider and the selected segment changed.
This could have also been fixed in SegmentedSectionProvider
but changing the _currentIndex
after the delegate has been notified (which is closer to what ComposedSectionProvider
does) but we have nothing in the API contract stating this must be done, so really it's an issue with the caching in ComposedSectionProvider
.
Pull request Cache `sections` and `numberOfSection` on composed-swift/Composed
These properties are accessed quite frequently and can be cached with a little extra processing.
This is another finding from screens that have a large number of composed sections.
This and https://github.com/composed-swift/ComposedUI/pull/15 seem to be the main areas of performance issues, although that doesn't mean that once these are working and merged we won't uncover more 😅
Thanks to @bill201207 for their contributions to this change.
Pull request Add collection view batch updates on composed-swift/ComposedUI
The idea of this is that without breaking the API the collection view will batch updates.
Inserting a large number of sections is the main area of performance loss we are currently encountering, because the sections are inserted individually and not batched. This change alone has reduce the initial load time of one our screens (which has 100-150 sections added at once) from 30-45 seconds down to less than a second (at least it is not noticeable).
I had created https://github.com/composed-swift/Composed/pull/17 to try and address this, which has the advantage that it would apply to other view types (e.g. UITableView
), but I believe does not offer the same performance improvements and it is restricted to a single ComposedSectionProvider
.
This is a draft to collect feedback; as you can see there are some TODOs but I think there's enough implemented to provide an overview of the changes that would be required to implement this.
This does not currently work; there are situations that cause the collection NSInternalInconsistencyException', reason: 'Invalid update
error. I have some failing tests that demonstrate what the result should be.
Pull request Add `performBatchUpdates(_:)` function on composed-swift/Composed
When adding a lot of sections (we have a screen which inserts 100~175 on initial load) the performance is quite poor.
Along with the improve-composed-section-provider-performance
branch (which I want to fully validate before making a PR) performing these changes in batch helps a lot.
xcutils Versions v0.2.0 to v0.2.2
- Tags:
- open-source
Partial v1.1.0
Release Notes
- Add support for
builder(for:)
function to aid with building complex type (thanks to @randomeizer) - Support for Xcode 12.1
Pull request Potential fix for invalidation crashes on composed-swift/ComposedUI
As mentioned in https://github.com/composed-swift/ComposedUI/issues/13 and https://github.com/composed-swift/ComposedUI/issues/8 there are some scenarios where the collection view’s data is out-of-sync with the data in composed.
As mentioned in https://github.com/composed-swift/ComposedUI/issues/13 calling layoutIfNeeded
can trigger the data to be in sync again. In this I have added it to mappingWillBeginUpdating(_:)
which appears to solve the problem.
It might be needed in replace(sectionProvider:)
(because reloadData
is called) and/or mappingDidInvalidate(_:)
(for the same reason) but I’m still investigating.
I have validated this fix against https://github.com/composed-swift/ComposedUI/issues/8 and it fixes the crash.
https://github.com/composed-swift/ComposedUI/issues/13 still needs to be investigated and may require layoutIfNeeded
to be called in mappingDidInvalidate
. Marking as a draft until this is checked.
Pull request Set iOS deployment target to 9 for Swift >= 5.3 on cx-org/CombineX
Xcode 12 ships with 5.3 but also drops iOS 8 support. This causes a warning ("The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99.")
Pull request Rewrite delegates to take perform update closures on composed-swift/Composed
This is a major API change so is in a v2 branch. If we agree on a direction we could start adding PRs in to this branch.
This change would enable multiple changes to be applied at once, e.g. by requiring balanced calls to mappingWillBeginUpdating
and mappingDidEndUpdating
and only performing the updates when an equal number of mappingDidEndUpdating
calls have been made. This could be a small performance improvement but would also improve animations.
By adding the performUpdate
closure the changes to the model layer can be applied only when the consumer is expecting them, e.g. for UICollectionView
this would be inside performBatchUpdates
and would fix the existing crashes that occur when performing a change when there are pending layout changes.
Some tests and types have been commented out since this is more of a starting point for a discussion around the API than it is a solid implementation.
This is the closest I can see the API being (although it's still a breaking change) but maybe a bigger change would be better.
The biggest PITA is that the sections need to keep track of "current" data (e.g. what's being displayed by a collection view) and the "pending" data (e.g. what's about to be applied). I don't think this adds any memory overhead but it does add much more to the knowledge required when implementing a section.
Pull request Sort symlinks in order required for unzip on weichsel/ZIPFoundation
- Tags:
- open-source•
- swift•
- zip
Changes proposed in this PR
- Fix extraction order of symlinks
Tests performed
- Existing tests
- Extracting the AltServer download from https://altstore.io/
Further info for the reviewer
This needs more tests to ensure full coverage, but also to prove that this was previously broken and is now fixed.
The added function is public because I'm using it to extract a subset of the entries in the archive that contains symlinks.
Open Issues
#185, possibly #62.
Pull request ComposedSectionProvider fixes on composed-swift/Composed
These were quite hard to track down since the errors that would occur would often be visual and not a crash, although in some scenarios it did seem to trigger a crash.
I think this highlights the need for a much larger test suite.
Sidebar
It also made me question the insert(_:at:)
functions because it's not really clear what the index
is. Should it insert it at the index in the context of the sections and providers (as it does now), or just sections?
For example, with:
- Section A
- Section Provider
- Section B
- Section C
- Section D
- Section E
If I insert a section at index 3 should it look like:
- Section A
- Section Provider
- Section B
- Section C
- New Section
- Section D
- Section E
or
- Section A
- Section Provider
- Section B
- Section C
- Section D
- New Section
- Section E
Pull request Add GitHub actions on composed-swift/ComposedUI
The tests are currently essentially empty but at a minimum this makes sure things compile on Xcode 11.7 and 12.0.
@shaps80 I think this will need updates to the repo settings to enable GitHub Actions.
Pull request Fix swift 5.2 compiling on composed-swift/ComposedUI
Introduced in #9. #12 adds GitHub actions to ensure this doesn't occur again.
Pull request Add convenience funcs to ComposedSectionProvider on composed-swift/Composed
Previously there was no way to get the index of a child or even know if a Section
or SectionProvider
is a child of a ComposedSectionProvider
.
On top of these functions new insert(_:after:)
and insert(_:before:)
have been added for convenience.
Pull request Fix crash when performing update while animating on composed-swift/ComposedUI
The completion
block is called when the animation has completed, but at the end of the updates
block the data has already been updated (from the perspective of the UICollectionView
).
Not calling reset()
and setting defersUpdate = false
could cause crashes e.g. due to changes being applied multiple times.
The best way to recreate this is to have a series of updates occur very close to each other but with the "Slow Animation" setting enabled in the simulator.
This change might also apply to table views, I have not checked.
The crash would often be along the lines of "Tried to delete section at index 11 but there were only 11 sections" or would occur in elementsProvider(for:)
with the error "No UI configuration available for section 11"
when performing a non-data change e.g. a reload of a section
Persist Versions v1.0.0-rc9 to v1.0.0
- 3 releases:
- v1.0.0-rc9•
- v1.0.0-rc10•
- v1.0.0
Pull request Allow multiple cell types per section on composed-swift/ComposedUI
Sometimes it's useful to have multiple different cell types within a single section, for example to use sticky headers or to reduce to need for many layers of composition (which can be tricky to get animation right for).
This isn't a breaking change for consumers.
I think some of the naming should be improved if this were to be merged.
Draft because I want feedback on the impact of the feature itself rather than specifically the code.
Pull request Add HashableByKeyPath and Persist on SwiftPackageIndex/PackageList
- Tags:
- open-source•
- swift•
- spm
The package(s) being submitted are:
Checklist
I have either:
- [x] Run
swift ./validate.swift
.
Or, checked that:
- [ ] The package repositories are publicly accessible.
- [ ] The packages all contain a
Package.swift
file in the root folder. - [ ] The packages are written in Swift 4.0 or later.
- [ ] The packages all contain at least one product (either library or executable).
- [ ] The packages all have at least one release tagged as a semantic version.
- [ ] The packages all output valid JSON from
swift package dump-package
with the latest Swift toolchain. - [ ] The package URLs are all fully specified including
https
and the.git
extension. - [ ] The packages all compile without errors.
Pull request Use HTTPS for packages on composed-swift/Composed-Demo
Xcode does not support ed25519 SSH keys so if a user uses ed25519 keys to authenticate with GitHub the connection will fail. HTTPS does not require authentication (for public repos)
Pull request Use SAMPLE_CODE_DISAMBIGUATOR for easier running on composed-swift/Composed-Demo
Config from https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/avcam_building_a_camera_app was used to make it easier to people checking out the repo to run the sample code. Only the team needs to be changed with this config.
Pull request Fix Xcode 12 warning when depending on Swift package on devicekit/DeviceKit
A copy of Package.swift with swift-tools-version updated to 5.3 and iOS platform updated to iOS 9.
Having this as a separate file prevents breaking backwards compatibility with Swift < 5.3 projects that support iOS 8.
Pull request Fix Xcode 12 warning when depending on Swift package on kishikawakatsumi/KeychainAccess
A copy of Package.swift with swift-tools-version
updated to 5.3 and iOS platform updated to iOS 9.
Having this as a separate file prevents breaking backwards compatibility with Swift < 5.3 projects that support iOS 8.
Persist Versions v1.0.0-rc5 to v1.0.0-rc8
- 4 releases:
- v1.0.0-rc5•
- v1.0.0-rc6•
- v1.0.0-rc7•
- v1.0.0-rc8
Pull request Check for `CollectionCoordinator` rather than self on composed-swift/ComposedUI
Using embedded collection views with each one using a CollectionCoordinator
would cause an infinite loop in responds(to:)
.
Maybe it's better to check in responds(to:)
? I don't know if there are other scenarios this could happen in.
Pull request Fix compilation of tests on composed-swift/Composed
It looks like there's been a breaking API change compared to 1.0.1, albeit a small one.
Pull request Mark `updateDelegate`s as `weak` on composed-swift/Composed
ArraySection.updateDelegate
was already weak and looking at the memory graph this is causing circular references
Pull request Add GitHub actions on composed-swift/Composed
This is a copy/paste from https://github.com/JosephDuffy/Persist/, with a couple of small tweaks:
- Only tests iOS; macOS, tvOS, and watchOS were removed
- Coverage is not uploaded to Codecov; I don't have permission to add the project
- Xcode 11.5 is used; this is the latest stable version
- v2 of the cache action is used; this is the latest stable version
It will do the following:
- Perform a release when a tag starting with
v
is pushedv0*
orv*-
(e.g.v1.1.0-rc1
) will be marked as pre-release
- Build and upload docs to the
gh-pages
branch as part of releases - Run tests against iOS when a commit is pushed
Note that the cache is not as useful as it could be right now; Swift likes to rebuild things based on inodes so the cache is largely (maybe entirely) discarded, but will be useful in a future Swift release.
You'll need to create an orphaned gh-pages
branch for the docs since I don't have permissions. I don't think it needs an initial commit, although maybe you can't push an empty branch? I've never tried.
Pull request Set `updateDelegate` when a provider invalidates on composed-swift/Composed
Basic Section
s were not propagating updates if added via a call to invalidateAll
. This is to address #2.
The issue can be recreated by using a SegmentedSectionProvider
when switching to a segment that contains a Section
(SectionProvider
works I think)
This commit alone is likely not enough to fix this issue; updateDelegate
should probably be set to nil
for removed Section
s, and should probably be set in more places.
Persist v1.0.0-rc4
Release Notes
Improve API for Subscription/Cancellable
Persist v1.0.0-rc3
Release Notes
Add documentation
Persist v1.0.0-rc2
Release Notes
Much better handling of optional values, which also allows for non-optional values
xcutils v0.1.2-rc2
- Tags:
- open-source
Release Notes
Add support for --output
flag to select
subcommand
xcutils v0.1.2-rc1
- Tags:
- open-source
Release Notes
Build docs and attach a release binary to releases
Persist v1.0.0-rc1
Release Notes
Release candidate 1 for 1.0 stable release
Has lots of tests but little documentation. API has changes a lot since initial 0.1.0 but I’m happy with it now. Hopefully it is consistent and (once docs are added) easy to use.
Persist Versions v0.2.1-rc1 to v0.2.2
- 7 releases:
- v0.2.1-rc1•
- v0.2.1-rc3•
- v0.2.1-rc4•
- v0.2.1-rc5•
- v0.2.1-rc6•
- v0.2.1•
- v0.2.2
homebridge-pc-volume Versions v1.0.0 to v1.2.1
Shepherd Versions v0.1.0 to v0.4.1
- Tags:
- open-source
Partial Versions v0.1.0 to v1.0.0
- 7 releases:
- v0.1.0•
- v0.1.1•
- v0.2.0•
- v1.0.0-rc.3•
- v1.0.0-rc.4•
- v1.0.0-rc.5•
- v1.0.0
GatheredKit Versions v0.0.2 to v0.1.1
YetiiLiib 0.2.2
- Tags:
- open-source
Release Notes
Updated App Store URL generation
Fixed error when loading app store from generated URLs Moved logic for generating App Store URL to the AppMetaData struct Improved documentation around App Store URLs
YetiiLiib Versions 0.0.1 to 0.2.1
- Tags:
- open-source