Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for macOS (AppKit) using the NSUI package #29

Merged
merged 16 commits into from
Feb 14, 2024

Conversation

martindufort
Copy link
Contributor

Here's my pull request to add AppKit support using NSUI.

Sorry this is a rather large PR.
I would be happy to discuss changes and modifications with you.
There are still some elements that are in process but I would rather submit it now and then continue moving forward after approval.

If you feel this is going too far from your original approach, let me know so we can collaborate and make this work.

I also updated the example PillView app which was not demonstrating the usage.
I can PR this one also after thes changes are approved.

--- Changes ---

--- In Process ---

  • Position of pillView with offset from edge (top, bottom)
  • Vertically centering of messages within pill if height is customized

Directly derive PillView from UXView
Add ability to specify a custom font to display the pill message
Ensure pillView is centered within the container view
Add ability to specify a different message when `completeTask` is called
Comment out Hashable conformance because this is coming for free by dericing from UXView
Rework initializer structure to use convenience init
Fix issue where pillView was not removed from the view hierarchy when dismissed
WIP: Add PillAnimation structure to allow pill to be animated from the bottom or from the top
Add extensions to NSUI
Derive PillBox directly from NSUIView instead of using containment
Comment out Conformance as no longer needed
Support AppKit for PillView transition
Allow specification to sticky timeout for showError()
Allow specification of a default Font for PillView
Allow capability to update the showTask() message while in process
Properly center the pillView into the container view using simple autoresizing masks
Extend NSUIColor to get light and dark color scheme
@Awesomeplayer165
Copy link
Owner

Awesomeplayer165 commented Jan 4, 2024

sorry, just getting back from break. What's your plan with the "In-Process" (progress?) features. Do you want to finish those first or add those later?

Since it seems so, I'll review this soon.. Thanks for the contributions!

@martindufort
Copy link
Contributor Author

My primary objective was to send this PR early so you are OK with the direction and the inclusion of NSUI.
There are still elements not working properly especially for the iOS version.

I will, hopefully, correct those this week and push more commits to complete the PR.
Let me know if you have questions.

@martindufort
Copy link
Contributor Author

Preview of the updated PillView working on iOS + Catalyst
Only thing left to do is the PillPosition (bottom, top, offset) but I would rather close this PR and work on this in a new one.

Let me know...
https://github.com/Awesomeplayer165/PillboxView/assets/28934641/111fc710-aa83-444a-85b6-d15d1e848841
https://github.com/Awesomeplayer165/PillboxView/assets/28934641/edbdab92-e416-4fea-834f-e4d92cdfd4c6

… pillView heights

Ensure font size does not exceed PillView height
Rename files to start with Pill*
@martindufort
Copy link
Contributor Author

Don't hesitate to ping me if you need help with this PR review.
In my fork, I have disabled your 'iOS starter workflow' to ensure everything runs correctly.

Copy link
Owner

@Awesomeplayer165 Awesomeplayer165 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Awesomeplayer165 Awesomeplayer165 merged commit 971e784 into Awesomeplayer165:main Feb 14, 2024
2 of 3 checks passed
@martindufort
Copy link
Contributor Author

Super. I will move forward with the PR that allows positioning the PillView either at the top or the bottom.

That function is already working on my side.

@Awesomeplayer165
Copy link
Owner

Sounds good. Maybe adding more padding to keep it inside safe areas would be nice. Thanks!

@martindufort
Copy link
Contributor Author

I was thinking of adding the property fromSafeAreaTopEdge? and fromSafeAreaBottomEdge? to the PillPosition structure. And then use the containing view safeAreaLayoutGuide to do the positioning.

And because a safeArea does not exist on macOS, those are optionals.

LMK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants