Skip to content

Commit

Permalink
Updated Examples app
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Escrig Ventura committed Mar 2, 2016
1 parent 9b364a2 commit 9fe92d4
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 101 deletions.
19 changes: 19 additions & 0 deletions Example/MEVFloatingButton/MEVAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,29 @@ @implementation MEVAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Status bar
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
statusBar.backgroundColor = [UIColor colorWithRed:33/255.0f green:194/255.0f blue:103/255.0f alpha:1];
}

// Navigation bar appearance (background and title)
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil]];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:43/255.0f green:204/255.0f blue:113/255.0f alpha:1]];
[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
[[UINavigationBar appearance] setBackgroundColor:[UIColor colorWithRed:43/255.0f green:204/255.0f blue:113/255.0f alpha:1]];


MEVViewController *viewController = [[MEVViewController alloc] init];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:viewController];
[self.window makeKeyAndVisible];



return YES;
}

Expand Down
9 changes: 6 additions & 3 deletions Example/MEVFloatingButton/MEVExample1ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ - (void)viewDidLoad {
button.displayMode = MEVFloatingButtonDisplayModeAlways;
button.position = MEVFloatingButtonPositionBottomRight;
button.image = [UIImage imageNamed:@"Icon1"];
button.imageColor = [UIColor blackColor];
button.backgroundColor = [UIColor redColor];
button.outlineColor = [UIColor blackColor];
button.imageColor = [UIColor colorWithRed:44/255.0f green:62/255.0f blue:80/255.0f alpha:1];
button.backgroundColor = [UIColor colorWithRed:65/255.0f green:131/255.0f blue:215/255.0f alpha:1];
button.outlineColor = [UIColor colorWithRed:44/255.0f green:62/255.0f blue:80/255.0f alpha:1];
button.outlineWidth = 3.0f;
button.imagePadding = 20.0f;
button.horizontalOffset = -30.0f;
Expand All @@ -42,6 +42,7 @@ - (void)viewDidLoad {
[self.tableView setFloatingButtonView:button];
[self.tableView setFloatingButtonDelegate:self];

[self.tableView setBackgroundColor:[UIColor colorWithRed:236/255.0f green:236/255.0f blue:236/255.0f alpha:1]];
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellIdentifier];
}

Expand All @@ -64,7 +65,9 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
[cell setBackgroundColor:[UIColor colorWithRed:236/255.0f green:236/255.0f blue:236/255.0f alpha:1]];
cell.textLabel.text = [NSString stringWithFormat:@"Cell section [%zd] row [%zd]", indexPath.section, indexPath.row];
cell.textLabel.textColor = [UIColor colorWithRed:44/255.0f green:62/255.0f blue:80/255.0f alpha:1];
return cell;
}

Expand Down
5 changes: 4 additions & 1 deletion Example/MEVFloatingButton/MEVExample2ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (void)viewDidLoad {
button.displayMode = MEVFloatingButtonDisplayModeWhenScrolling;
button.animationType = MEVFloatingButtonAnimationNone;
button.position = MEVFloatingButtonPositionBottomLeft;
button.backgroundColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.9];
button.backgroundColor = [UIColor colorWithRed:233/255.0f green:212/255.0f blue:96/255.0f alpha:0.9];
button.horizontalOffset = 30.0f;
button.verticalOffset = -30.0f;
button.image = [UIImage imageNamed:@"Icon2"];
Expand All @@ -35,6 +35,7 @@ - (void)viewDidLoad {
[self.tableView setFloatingButtonView:button];
[self.tableView setFloatingButtonDelegate:self];

[self.tableView setBackgroundColor:[UIColor colorWithRed:236/255.0f green:236/255.0f blue:236/255.0f alpha:1]];
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellIdentifier];
}

Expand All @@ -54,7 +55,9 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
[cell setBackgroundColor:[UIColor colorWithRed:236/255.0f green:236/255.0f blue:236/255.0f alpha:1]];
cell.textLabel.text = [NSString stringWithFormat:@"Cell section [%zd] row [%zd]", indexPath.section, indexPath.row];
cell.textLabel.textColor = [UIColor colorWithRed:44/255.0f green:62/255.0f blue:80/255.0f alpha:1];
return cell;
}

Expand Down
20 changes: 12 additions & 8 deletions Example/MEVFloatingButton/MEVExample3ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@ - (void)viewDidLoad {

MEVFloatingButton *button = [[MEVFloatingButton alloc] init];
button.animationType = MEVFloatingButtonAnimationFromBottom;
button.displayMode = MEVFloatingButtonDisplayModeAlways;
button.displayMode = MEVFloatingButtonDisplayModeWhenScrolling;
button.position = MEVFloatingButtonPositionBottomCenter;
button.image = [UIImage imageNamed:@"Icon6"];
button.imageColor = [UIColor cyanColor];
button.backgroundColor = [UIColor magentaColor];
button.outlineColor = [UIColor cyanColor];
button.image = [UIImage imageNamed:@"Icon0"];
button.imageColor = [UIColor groupTableViewBackgroundColor];
button.backgroundColor = [UIColor colorWithRed:236/255.0f green:100/255.0f blue:75/255.0f alpha:1];
button.outlineColor = [UIColor darkGrayColor];
button.outlineWidth = 0.0f;
button.rounded = YES;
button.imagePadding = 15.0f;
button.imagePadding = 10.0f;
button.horizontalOffset = 20.0f;
button.verticalOffset = -30.0f;
button.rounded = YES;
button.hideWhenScrollToTop = YES;
[self.tableView setFloatingButtonView:button];
[self.tableView setFloatingButtonDelegate:self];

[self.tableView setBackgroundColor:[UIColor colorWithRed:236/255.0f green:236/255.0f blue:236/255.0f alpha:1]];
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellIdentifier];
}

Expand All @@ -56,7 +58,9 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
[cell setBackgroundColor:[UIColor colorWithRed:236/255.0f green:236/255.0f blue:236/255.0f alpha:1]];
cell.textLabel.text = [NSString stringWithFormat:@"Cell section [%zd] row [%zd]", indexPath.section, indexPath.row];
cell.textLabel.textColor = [UIColor colorWithRed:44/255.0f green:62/255.0f blue:80/255.0f alpha:1];
return cell;
}

Expand All @@ -73,7 +77,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath

- (void)floatingButton:(UIScrollView *)scrollView didTapButton:(UIButton *)button {
NSLog(@"didTapButton");
[self.navigationController popViewControllerAnimated:YES];
[self.tableView setContentOffset:CGPointMake(0, -self.tableView.contentInset.top) animated:YES];
}

- (void)floatingButtonWillAppear:(UIScrollView *)scrollView {
Expand Down
8 changes: 4 additions & 4 deletions Example/MEVFloatingButton/MEVExample4ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ - (void)viewDidLoad {
button.displayMode = MEVFloatingButtonDisplayModeAlways;
button.position = MEVFloatingButtonPositionBottomRight;
button.image = [UIImage imageNamed:@"Icon3"];
button.imageColor = [UIColor greenColor];
button.backgroundColor = [UIColor purpleColor];
button.outlineColor = [UIColor darkGrayColor];
button.imageColor = [UIColor colorWithRed:43/255.0f green:204/255.0f blue:113/255.0f alpha:1];
button.backgroundColor = [UIColor colorWithRed:154/255.0f green:18/255.0f blue:197/255.0f alpha:1];
button.outlineWidth = 0.0f;
button.imagePadding = 15.0f;
button.horizontalOffset = -30.0f;
Expand Down Expand Up @@ -65,6 +64,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.textLabel.text = [NSString stringWithFormat:@"Cell section [%zd] row [%zd]", indexPath.section, indexPath.row];
cell.textLabel.textColor = [UIColor colorWithRed:44/255.0f green:62/255.0f blue:80/255.0f alpha:1];
return cell;
}

Expand All @@ -81,7 +81,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath

- (void)floatingButton:(UIScrollView *)scrollView didTapButton:(UIButton *)button {
NSLog(@"didTapButton");
[self.tableView setContentOffset:CGPointMake(0, -self.tableView.contentInset.top) animated:YES];
[self dismissViewControllerAnimated:YES completion:nil];
}

- (void)floatingButtonWillAppear:(UIScrollView *)scrollView {
Expand Down
86 changes: 44 additions & 42 deletions Example/MEVFloatingButton/MEVFloatingButton-Info.plist
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
49 changes: 6 additions & 43 deletions Example/MEVFloatingButton/MEVViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,9 @@ - (void)viewDidLoad
{
[super viewDidLoad];


self.title = @"MEVFloatingButton";

MEVFloatingButton *button = [[MEVFloatingButton alloc] init];
button.animationType = MEVFloatingButtonAnimationFromBottom;
button.displayMode = MEVFloatingButtonDisplayModeWhenScrolling;
button.position = MEVFloatingButtonPositionBottomCenter;
button.image = [UIImage imageNamed:@"Icon0"];
button.imageColor = [UIColor groupTableViewBackgroundColor];
button.backgroundColor = [UIColor darkGrayColor];
button.outlineColor = [UIColor darkGrayColor];
button.outlineWidth = 0.0f;
button.imagePadding = 20.0f;
button.horizontalOffset = 20.0f;
button.verticalOffset = -30.0f;
button.rounded = YES;
button.hideWhenScrollToTop = YES;
[self.tableView setFloatingButtonView:button];
[self.tableView setFloatingButtonDelegate:self];


[self.tableView setBackgroundColor:[UIColor colorWithRed:236/255.0f green:236/255.0f blue:236/255.0f alpha:1]];
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellIdentifier];

}
Expand All @@ -64,13 +47,15 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 40;
return 4;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.textLabel.text = [NSString stringWithFormat:@"Example [%zd]", indexPath.row];
[cell setBackgroundColor:[UIColor colorWithRed:236/255.0f green:236/255.0f blue:236/255.0f alpha:1]];
cell.textLabel.text = [NSString stringWithFormat:@"Example %zd", indexPath.row+1];
cell.textLabel.textColor = [UIColor colorWithRed:44/255.0f green:62/255.0f blue:80/255.0f alpha:1];
return cell;
}

Expand Down Expand Up @@ -105,28 +90,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
}


#pragma mark - MEScrollToTopDelegate Methods

- (void)floatingButton:(UIScrollView *)scrollView didTapButton:(UIButton *)button {
NSLog(@"didTapButton");
[self.tableView setContentOffset:CGPointMake(0, -self.tableView.contentInset.top) animated:YES];
}

- (void)floatingButtonWillAppear:(UIScrollView *)scrollView {
NSLog(@"floatingButtonWillAppear");
}

- (void)floatingButtonDidAppear:(UIScrollView *)scrollView {
NSLog(@"floatingButtonDidAppear");
}

- (void)floatingButtonWillDisappear:(UIScrollView *)scrollView {
NSLog(@"floatingButtonWillDisappear");
}

- (void)floatingButtonDidDisappear:(UIScrollView *)scrollView; {
NSLog(@"floatingButtonDidDisappear");
}


@end

0 comments on commit 9fe92d4

Please sign in to comment.