From b4c80e848fa83f32934231868b924ee9f0bf73cb Mon Sep 17 00:00:00 2001 From: "Yizhuo Xie(Marvin)" Date: Wed, 29 Aug 2018 13:43:29 -0700 Subject: [PATCH] Collapse the menu --- CCDropDownMenu/SyuDropDownMenu.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CCDropDownMenu/SyuDropDownMenu.m b/CCDropDownMenu/SyuDropDownMenu.m index e5f3785..958b115 100644 --- a/CCDropDownMenu/SyuDropDownMenu.m +++ b/CCDropDownMenu/SyuDropDownMenu.m @@ -145,6 +145,14 @@ - (instancetype)initWithNavigationBar:(UINavigationBar *)navigationBar useNaviga return self; } +- (void)collapse { + if(self.isExpanded) { + [self animateForClose]; + [self updateForColor:self.isExpanded?self.inactiveColor:self.activeColor]; + self.expanded = !self.isExpanded; + } +} + #pragma mark - Private methods - (void)commonInitialization { self.titleView = [[UIView alloc] init];