Skip to content

Commit 166550b

Browse files
committed
Pull to refresh table view support added. Index.php is now hidden from the directory listing, that is done server side. Being able to preview text files in other apps is back.
1 parent f94ac49 commit 166550b

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

LANBox/FilesViewController.m

+27-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ - (void)viewDidLoad
6464
clickSound = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];
6565
[clickSound prepareToPlay];
6666

67+
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
68+
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
69+
[self.filesTableView addSubview:refreshControl];
70+
6771
// Detect if the app has ever been used before. If it has then just continue starting up.
6872

6973
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"])
@@ -393,7 +397,21 @@ -(void)setupDirectoryArray
393397
NSString *updatedURLResult = [urlResult stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
394398

395399
[self.directoryArray addObject:[Directory fileName:updatedfilenamestring fileType:typeresult fileURL:updatedURLResult]];
400+
401+
NSLog(@"filename: %@", updatedfilenamestring);
402+
NSLog(@"filetype: %@", typeresult);
403+
NSLog(@"fileurl: %@", updatedURLResult);
404+
396405
}
406+
407+
NSLog(@"array: %@", self.directoryArray);
408+
409+
//NSUInteger indexObject = [self.directoryArray indexOfObject: @"index.php"];
410+
411+
//[self.directoryArray removeObjectAtIndex:indexObject];
412+
413+
[self.directoryArray removeObject:[Directory fileName:@"index.php" fileType:@"php" fileURL:@"http://dev.quade.co/index.php"]];
414+
397415
}
398416

399417

@@ -727,7 +745,6 @@ - (IBAction)openButtonPressed:(id)sender
727745
}
728746
}
729747

730-
// This code is commented out because it's a work in progress.
731748

732749
if ([currentType isEqualToString:@"txt"]) {
733750

@@ -830,4 +847,13 @@ - (void)startClick
830847
[clickSound prepareToPlay];
831848
}
832849

850+
// This method handles the pull to refresh in the table view. It is all defined in the viewDidLoad.
851+
852+
- (void)refresh:(UIRefreshControl *)refreshControl
853+
{
854+
[self applicationDidUpdateDirectory];
855+
[filesTableView reloadData];
856+
[refreshControl endRefreshing];
857+
}
858+
833859
@end

LANBox/en.lproj/MainStoryboard_iPad.storyboard

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,6 @@
632632
<inferredMetricsTieBreakers>
633633
<segue reference="aci-B3-oOU"/>
634634
<segue reference="4Cn-G0-CUy"/>
635-
<segue reference="9cy-wy-76I"/>
635+
<segue reference="SJv-nV-4pX"/>
636636
</inferredMetricsTieBreakers>
637637
</document>

0 commit comments

Comments
 (0)