Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions TableView/HomeViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{

IBOutlet UITextView *homeText;
__weak IBOutlet NSLayoutConstraint *homeTextBottomConstraint;
}
- (void)checkForWIFIConnection;

Expand Down
4 changes: 4 additions & 0 deletions TableView/HomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ - (void)viewDidLoad
[super viewDidLoad];

[self checkReachability];

if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
homeTextBottomConstraint.constant = 0; // This constraint is only needed on iOS 7.
}
}

-(void)viewDidAppear:(BOOL)animated{
Expand Down
5 changes: 3 additions & 2 deletions TableView/HomeViewController.xib
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4510" systemVersion="12E55" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4510" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<deployment defaultVersion="1552" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="HomeViewController">
<connections>
<outlet property="homeText" destination="50" id="63"/>
<outlet property="homeTextBottomConstraint" destination="KZ3-RV-UVq" id="g58-bZ-ycv"/>
<outlet property="view" destination="1" id="3"/>
</connections>
</placeholder>
Expand Down
6 changes: 5 additions & 1 deletion TableView/MasterViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
[aSearchBar resignFirstResponder];
isFiltered = NO;
aSearchBar.backgroundColor = [UIColor lightGrayColor];
[self.tableView setContentOffset:CGPointMake(0,-20) animated:YES];
if (floor(NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1)) {
[self.tableView setContentOffset:CGPointMake(0, 44) animated:YES];
} else {
[self.tableView setContentOffset:CGPointMake(0,-20) animated:YES];
}
[self.tableView reloadData];
}

Expand Down
2 changes: 1 addition & 1 deletion TableView/SecondDetailViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
IBOutlet UITextView *runnersInfo;
IBOutlet UIPickerView *secondPicker;
NSUInteger selectedRow;

CGRect runnersInfoOriginalFrame;

}
@property (strong, nonatomic) UIView *myView;
Expand Down
21 changes: 19 additions & 2 deletions TableView/SecondDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ - (void)viewDidLoad
self.navigationItem.rightBarButtonItem = addButton;
addButton.tintColor = [UIColor colorWithRed:(25/255.0) green:(200/250.0) blue:(110/255.0) alpha:1];


runnersInfoOriginalFrame = CGRectMake(0, 216, 320, 238);
}

- (void)viewWillDisappear:(BOOL)animated {
[runnersInfo scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
}

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
Expand Down Expand Up @@ -199,7 +202,21 @@ - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
return [[self.run.videoLinks objectForKey:@"PickerItems"] count];
int numberOfVideoLinks = [[self.run.videoLinks objectForKey:@"PickerItems"] count];

if (numberOfVideoLinks == 1) {
pickerView.hidden = YES;
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
runnersInfo.frame = self.view.frame;
} else {
runnersInfo.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 44 - 49 - 20); // In iOS 7; the navigation bar (44 points), tab bar (49 points) and status bar (20 points) are considered areas that can display content. Modifying the frame of the text view to not be blocked by any of these.
}
} else if (numberOfVideoLinks > 1) {
pickerView.hidden = NO;
runnersInfo.frame = runnersInfoOriginalFrame;
}

return numberOfVideoLinks;
}

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
Expand Down