ios - How best to open the desired controller via 3D Touch? -


i want ask proper implementation of 3d touch. example there uiviewcontroller, loads different each other depending on data being openly application. if usual, shows same data, if in 3d touch, other. i've done through nsuserdefaults kept variable, is, if normal start false, if in 3d touch true. more nsnotificationcenter. worked, not correct implementation of task. how best do that?

please try following code open detail view using 3d touch.

iboutlet uibutton *btndetail;

    #pragma mark - previewing delegate     - (uiviewcontroller *)previewingcontext:(id <uiviewcontrollerpreviewing>)previewingcontext viewcontrollerforlocation:(cgpoint)location     {         uiviewcontroller *detailvc = [self.storyboard instantiateviewcontrollerwithidentifier:@"detail"];         detailvc.preferredcontentsize = cgsizemake(0.0, 568.0);         previewingcontext.sourcerect = self.btndetail.frame;         return detailvc;     }      - (void)previewingcontext:(id <uiviewcontrollerpreviewing>)previewingcontext commitviewcontroller:(uiviewcontroller *)viewcontrollertocommit{         [self showviewcontroller:viewcontrollertocommit sender:self];     } 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

Redirect to a HTTPS version using .htaccess -