-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeedViewController.m
More file actions
96 lines (69 loc) · 2.37 KB
/
Copy pathFeedViewController.m
File metadata and controls
96 lines (69 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//
// FeedViewController.m
// Week2
//
// Created by Tom Gurka on 6/11/14.
// Copyright (c) 2014 tom. All rights reserved.
//
#import "FeedViewController.h"
#import "MainViewController.h"
@interface FeedViewController ()
@property (weak, nonatomic) IBOutlet UIScrollView *ScrollView;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *FakeLoader;
//Create Fake Load Method
- (void)fakeloadMethod;
//Nav Buttons
- (void)onLeftButton;
- (void)onRightButton;
@end
@implementation FeedViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.navigationItem.title = @"News Feed";
// Configure the left button
UIImage *leftButtonImage = [[UIImage imageNamed:@"navSearch"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithImage:leftButtonImage style:UIBarButtonItemStylePlain target:self action:@selector(onLeftButton)];
self.navigationItem.leftBarButtonItem = leftButton;
// Configure the right button
UIImage *rightButtonImage = [[UIImage imageNamed:@"navFriends"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithImage:rightButtonImage style:UIBarButtonItemStylePlain target:self action:@selector(onRightButton)];
self.navigationItem.rightBarButtonItem = rightButton;
}
// Left Nav Button
- (void)onLeftButton {
}
// Right Nav Button
- (void)onRightButton {
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[_ScrollView setHidden:true];
[self.FakeLoader setHidden:false];
[self.FakeLoader startAnimating];
// Fake Load Timer
[self performSelector:@selector(fakeloadMethod) withObject:nil afterDelay:2];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
//Fake Loader Method
- (void)fakeloadMethod {
NSLog(@"Fake Method Called");
[self.FakeLoader stopAnimating];
[_ScrollView setHidden:false];
[self.FakeLoader setHidden:true];
}
@end