So I want a pretty basic 3D touch setup. On my main UI, I have a 2 option segmented control and I basically want to have one option of it selected upon open when 3DQuickActionA is used, and the other option when 3DTouchQuickActionB is used.
I've looked at other questions on this site, and one suggested I use:
- (void)handleShortCutItem:(UIApplicationShortcutItem *)shortcutItem {
if([shortcutItem.type isEqualToString:@"3DQuickActionA"]){
self.quote_opt.selectedSegmentIndex = 0; }
if([shortcutItem.type isEqualToString:@"3DQuickActionB"]){
self.quote_opt.selectedSegmentIndex = 1; }
}
where quote_opt is the name of my segmented control.
However, this doesn't work. My app launches ok, but just has whatever the last value of quote_opt was as the current option-- the 3D touch actions do nothing. I'm sure I'm missing something, but I don't know what. Does something need to go in viewdidload?
Any advice would be appreciated, and I'm happy to post whatever other portions of code/answer any other questions needed to solve the problem.
Thank you!
quote_opt
seems like a switch, are you sure it's already loaded? Maybe you could raise a flag in handleShortcutItem then after loading the view, you could select segment index accordingly. – Arianearianie