मुझे मिला कि मुझे this question में क्या चाहिए था।
मूल रूप से आप एक UITabBarControllerDelegate
और कि अधिक टैब के अंदर प्रदर्शित किया जाता है नेविगेशन नियंत्रक के लिए एक UINavigationControllerDelegate
की स्थापना की। इसके बाद आप यह पता लगाते हैं कि उपयोगकर्ता दृश्यमान टैब में से एक या "अधिक" टैब को स्पर्श करता है या नहीं।
संपादित
इसके अलावा
, सीधे तालिका कि "अधिक" नेविगेशन नियंत्रक के भीतर दिखाई दे रहा है हेरफेर करने के लिए, आप एक "मैन-इन-द-मिडल" तालिका दृश्य प्रतिनिधि, कि करने के लिए कॉल को बीच में रोक सेट कर सकते हैं मूल प्रतिनिधि। अंदर didSelectViewController
नीचे से कोड देखें:
if (viewController == tabBarController.moreNavigationController && tabBarController.moreNavigationController.delegate == nil) {
// here we replace the "More" tab table delegate with our own implementation
// this allows us to replace viewControllers seamlessly
UITableView *view = (UITableView *)self.tabBarController.moreNavigationController.topViewController.view;
self.originalDelegate = view.delegate;
view.delegate = self;
}
उसके बाद, आप जो कुछ भी आप, प्रतिनिधि तरीकों के अंदर की तरह है जब तक कि आप अन्य प्रतिनिधि में एक ही तरीके का फोन करने के लिए स्वतंत्र हैं (मैं वास्तव में जो तरीकों की जाँच मूल प्रतिनिधि उत्तर देता है, और लागू किया गया एकमात्र प्रतिनिधि तरीका didSelectRow:forIndexPath:
है)। नीचे एक उदाहरण देखें:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// this is the delegate for the "More" tab table
// it intercepts any touches and replaces the selected view controller if needed
// then, it calls the original delegate to preserve the behavior of the "More" tab
// do whatever here
// and call the original delegate afterwards
[self.originalDelegate tableView: tableView didSelectRowAtIndexPath: indexPath];
}
मैंने इसे भी समझने की कोशिश की है। जब तक वे अधिक टैप करते हैं, तब तक मुझे यह पता चल सकता है कि वे अधिक देखने वाले नियंत्रक से कौन से व्यू कंट्रोलर का चयन करते हैं, गैर-सार्वजनिक एपीआई कॉल का उपयोग करने की आवश्यकता है। –
@ ग्रेग, मेरा उत्तर देखें। – Shade