Skip to content

Commit 59210b2

Browse files
author
Joey Lorich
committed
Merge in menu resize
2 parents 752a25d + 543139f commit 59210b2

4 files changed

Lines changed: 237 additions & 4 deletions

File tree

EasyReader/Application/Controllers/Menu/EZRMenuSearchController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
#import "EZRSearchBar.h"
1011

1112
typedef NS_ENUM(NSUInteger, EZRSearchState) {
1213
kEZRSearchStateStartedSearching,
@@ -25,6 +26,7 @@ extern NSString * const kEZRFeedSearchStateChangedNotification;
2526
*/
2627
@interface EZRMenuSearchController : NSObject <UISearchBarDelegate>
2728

29+
2830
/**
2931
* Cancels a search, clears the search text, hides the keyboard
3032
*/

EasyReader/Application/Controllers/Menu/EZRMenuViewController.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,19 @@ @interface EZRMenuViewController ()
4040
/// The current feeds provider
4141
@property (nonatomic, strong) EZRCurrentFeedsProvider *currentFeedsProvider;
4242

43+
/// Height Menu to modify
44+
@property (nonatomic, weak) IBOutlet NSLayoutConstraint *menuHeight;
45+
4346
@end
4447

4548

4649
@implementation EZRMenuViewController
4750
{
4851
/// Is the user currently searching
4952
BOOL searching;
53+
54+
/// A temporary store for the menu height since it's made small when the keyboard shows
55+
CGFloat originalMenuHeight;
5056
}
5157

5258
#pragma mark - UIViewController Lifecycle methods
@@ -96,13 +102,19 @@ - (void)searchStateChanged:(NSNotification *)notification {
96102

97103
switch (event) {
98104
case kEZRSearchStateStartedSearching:
105+
{
106+
originalMenuHeight = self.menuHeight.constant;
107+
99108
self.tableView_menu.dataSource = self.searchFeedDataSource;
109+
self.menuHeight.constant = originalMenuHeight - 216;
100110
break;
101-
111+
}
102112
case kEZRSearchStateStoppedSearching:
113+
{
103114
self.tableView_menu.dataSource = self.userFeedDataSource;
115+
self.menuHeight.constant = originalMenuHeight;
104116
break;
105-
117+
}
106118
case kEZRSearchStateResultsAvailable:
107119
// Do nothing, just need to realod
108120
break;

EasyReader/Application/Views/Main_iPhone.storyboard

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13C1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="Hgn-0q-Z1W">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="Hgn-0q-Z1W">
33
<dependencies>
44
<deployment defaultVersion="1792" identifier="iOS"/>
55
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
@@ -217,6 +217,9 @@
217217
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
218218
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
219219
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
220+
<constraints>
221+
<constraint firstAttribute="height" constant="568" id="Q3P-BD-mqw"/>
222+
</constraints>
220223
<color key="sectionIndexBackgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
221224
<view key="tableHeaderView" contentMode="scaleToFill" id="Nnv-Cw-nbp">
222225
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
@@ -307,13 +310,13 @@
307310
<constraints>
308311
<constraint firstAttribute="trailing" secondItem="14d-Nx-0xr" secondAttribute="trailing" id="2ek-R2-wR0"/>
309312
<constraint firstItem="14d-Nx-0xr" firstAttribute="top" secondItem="C4i-F3-dmc" secondAttribute="bottom" id="6yU-gL-jQ1"/>
310-
<constraint firstItem="s5I-Ee-yuh" firstAttribute="top" secondItem="14d-Nx-0xr" secondAttribute="bottom" id="OvM-WD-RTl"/>
311313
<constraint firstItem="14d-Nx-0xr" firstAttribute="leading" secondItem="6fH-J0-YTO" secondAttribute="leading" id="RBu-zY-A5b"/>
312314
</constraints>
313315
</view>
314316
<nil key="simulatedStatusBarMetrics"/>
315317
<nil key="simulatedTopBarMetrics"/>
316318
<connections>
319+
<outlet property="menuHeight" destination="Q3P-BD-mqw" id="CUd-ac-fpj"/>
317320
<outlet property="searchBar" destination="6U4-aC-Dql" id="5As-xt-K3v"/>
318321
<outlet property="searchFeedDataSource" destination="Kyf-fs-6tv" id="UKM-0P-nBF"/>
319322
<outlet property="tableView_menu" destination="14d-Nx-0xr" id="V1g-Kc-z5U"/>

Pods/Pods.xcodeproj/xcuserdata/jlorich.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 216 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)