Conversation
|
Thank you for your commit. It very useful for me to develop with DGCharts on Mac! It's strange that your PR fixing the bug has not been merged for a long time. |
|
@liuxuan30 Hi, I found the same issue with Marker View and xib on Mac when I was developing. #5023 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Link 🔗
#5023
Goals ⚽
Make
MarkerViewwork in MacOS, and add an example of it into the MacOS sample app.Implementation Details 🚧
MarkerViewdidSetinchartViewproperty, which calls a new functiondidAddToChart(_:).didAddToChart(_:)only does anything in OSX. It adds theMarkerViewas an off-screen subview of thechartView's containing view. This is necessary because theMarkerViewwould not render in OSX without it having been added to a view already. See this SO answer for more context.viewFromXib(in:)to returnSelfrather thanMarkerViewso that subclasses will return as their own type rather than the base class.viewFromXib(in:)to find the first instance ofSelfin the loaded objects from the xib rather than assuming that the first object in that array was the one we'd be looking for. In MacOS this was a problem because the view was often second in the xib's loaded objects rather than the first.viewFromXib(in:), setwantsLayerto true for the resulting view, which was also necessary to render the view duringdraw(context:point:)as referenced in previous StackOverflow answer.Testing Details 🔍
RadarMarkerViewMacin the MacOS sample app, which is nearly identical to theRadarMarkerViewin the iOS sample app.RadarMarkerViewMacas the marker in the MacOS sample'sRadarDemoViewController.RadarDemoViewControllerdisplayed the marker as expected.