Navigation buttons not showing properly in Fair -> Artist details
See original GitHub issueIn Fair -> Artists -> Artist detail, buttons linking to artwork and “Artist at Artsy” look like this:
The ARNavigationButton
s are directly added to the stackView
, which is different from all other places that use ARNavigationButton
. Seems like the common usage is to add the button in a ARNavigationButtonsViewController
and then add the view to stackView
. (For example, the “More Info” button in Artwork). In fact, the only other place I could find that is using ARNavigationButton
directly is ARArtistViewController
, which was replaced by an Emission component.
As a test, I changed the Artist at Artsy button to use ARNavigationButtonsViewController
:
- (void)addArtistOnArtsyButton
{
NSString *title = NSStringWithFormat(@"%@ on Artsy", self.artist.name);
NSArray *buttonDescription = @[ @{
ARNavigationButtonClassKey : ARNavigationButton.class,
ARNavigationButtonPropertiesKey : @{
ar_keypath(ARNavigationButton.new, title) : title
},
ARNavigationButtonHandlerKey : ^(UIButton *sender) {
UIViewController *viewController = [ARSwitchBoard.sharedInstance loadArtistWithID:self.artist.artistID inFair:nil];
[self.navigationController pushViewController:viewController animated:ARPerformWorkAsynchronously];
}
}];
self.artistOnArtsyVC = [[ARNavigationButtonsViewController alloc] init];
[self.artistOnArtsyVC addButtonDescriptions:buttonDescription unique:YES];
self.artistOnArtsyVC.view.tag = ARFairArtistOnArtsy;
[self.view.stackView addSubview:self.artistOnArtsyVC.view withTopMargin:@"20" sideMargin:@"40"];
}
which fixed the issue (and the button still works 😄):
For the button that links to an artwork however, I am not sure how to proceed. It would require having an ARNavigationButtonsViewController
for each artwork, which makes me think that maybe the whole thing should live in its own view controller (button, image and description). This is a bit of extra work, so I’d like to confirm the approach is good before starting on it.
On a side note, I tried a few things to make the buttons to show properly without needing ARNavigationButtonsViewController
, but no success. Curious to know if I missed an easier solution 🤔
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top GitHub Comments
@pedrovereza Awesome and thanks so much 🙌
@orta Cool, the developer extra thing really makes life easier, thanks!
I’ll go ahead with trying to combine the “artwork to show” details into its own view controller. Aiming to have something before the end of next week.