Skip to content

Maintenance: Use class extensions where appropriate#1428

Open
wutschel wants to merge 13 commits intoxbmc:masterfrom
wutschel:util_extension
Open

Maintenance: Use class extensions where appropriate#1428
wutschel wants to merge 13 commits intoxbmc:masterfrom
wutschel:util_extension

Conversation

@wutschel
Copy link
Copy Markdown
Collaborator

Description

Closes #1350.

This PR reworks the Utilities class and introduces several extensions for UILabel, UIView, UIImageView, UIColor, UIImage and NSString. Some existing extensions were moved there as well, and the dedicated files for these extension got removed (image resizing and SHA256 methods).

Summary for release notes

Maintenance: Use class extensions where appropriate

@wutschel
Copy link
Copy Markdown
Collaborator Author

@kambala-decapitator, I would like to get this one in once the open PRs got merged. Following the latest approach to introduce extensions, I will migrate this PR to also introduce dedicated / reuse existing extension files. This would cause merge conflicts with the current open PRs, so I will wait. But you might want to have at this one already.

@wutschel wutschel marked this pull request as ready for review March 28, 2026 09:01
Comment thread XBMC Remote/Utilities.m Outdated
Comment thread XBMC Remote/Utilities.m Outdated
Comment thread XBMC Remote/Utilities.h Outdated
Comment thread XBMC Remote/Utilities.m Outdated
Comment thread XBMC Remote/Utilities.m Outdated
Comment thread XBMC Remote/Utilities.m Outdated
@wutschel
Copy link
Copy Markdown
Collaborator Author

wutschel commented Apr 4, 2026

Resolved the conflict. When you're generally fine with this, I will squash most of it into 1 commit per class extension and move the extension into dedicated .h/.m files, following the way it was recently done for the other changes.

Comment thread XBMC Remote/Utilities.m Outdated
@kambala-decapitator
Copy link
Copy Markdown
Collaborator

please fix build

@wutschel
Copy link
Copy Markdown
Collaborator Author

wutschel commented Apr 5, 2026

please fix build

Fixed, was not seeing this locally as this PR needed another rebase. Good to redo the extension now?

@wutschel
Copy link
Copy Markdown
Collaborator Author

wutschel commented Apr 5, 2026

This was quite some nasty work. Now squashed commits into a single commit per class extension and reworked the whole implementation to use dedicated files for the class extensions. This added quite some changes to the xcode project file and many new imports to other classes.
While reviewing I came across some issues which I addressed in two fixup commits -- kept them to clearly show the difference in the implementation. In addition, I decided to remove the unused class extension ImageWithUIView.

@wutschel
Copy link
Copy Markdown
Collaborator Author

wutschel commented Apr 6, 2026

Found another bug in the actors table and migrated few more frame changes to the newly introduced extensions. Reviewed this twice now after the final changes, should be good if you also agree. In this case, I would do a final squashing.

@kambala-decapitator
Copy link
Copy Markdown
Collaborator

many new imports to other classes

Like I said before, you could add extension imports to the pch

@wutschel
Copy link
Copy Markdown
Collaborator Author

wutschel commented Apr 6, 2026

Like I said before, you could add extension imports to the pch

Let me try that. I was only thinking of adding the extensions themselves to the pch and dropped it.

wutschel added 4 commits April 6, 2026 19:03
Prepares moving rounded corner implementations for UIImageView and UIImage into separate class extensions.
@wutschel
Copy link
Copy Markdown
Collaborator Author

wutschel commented Apr 6, 2026

Here we go, looks cleaner to me, also added commit to include the other extensions via the pch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create convenience methods to update frame

2 participants