mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
changing tags to CONSTANTS and adding detail view logic
This commit is contained in:
parent
9745f25c02
commit
56dcefd1ee
4 changed files with 15 additions and 11 deletions
|
@ -9,6 +9,10 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
#import "BaseViewController.h"
|
||||
|
||||
#define FEED_DETAIL_VIEW_TAG 1000001
|
||||
#define STORY_DETAIL_VIEW_TAG 1000002
|
||||
#define FEED_TITLE_GRADIENT_TAG 100003
|
||||
|
||||
@class NewsBlurViewController;
|
||||
@class FeedDetailViewController;
|
||||
@class FeedsMenuViewController;
|
||||
|
|
|
@ -224,7 +224,7 @@
|
|||
[splitStoryDetailViewController showPopover];
|
||||
NSArray *subviews = [[splitStoryDetailViewController.view subviews] copy];
|
||||
for (UIView *subview in subviews) {
|
||||
if (subview.tag == 14) {
|
||||
if (subview.tag == FEED_DETAIL_VIEW_TAG) {
|
||||
[subview removeFromSuperview];
|
||||
}
|
||||
}
|
||||
|
@ -259,13 +259,13 @@
|
|||
// remove existing feedDetailViewController
|
||||
NSArray *subviews = [[splitStoryDetailViewController.view subviews] copy];
|
||||
for (UIView *subview in subviews) {
|
||||
if (subview.tag == 14) {
|
||||
if (subview.tag == FEED_DETAIL_VIEW_TAG || subview.tag == STORY_DETAIL_VIEW_TAG) {
|
||||
[subview removeFromSuperview];
|
||||
}
|
||||
}
|
||||
[subviews release];
|
||||
|
||||
feedDetailViewController.view.tag = 14;
|
||||
feedDetailViewController.view.tag = FEED_DETAIL_VIEW_TAG;
|
||||
[splitStoryDetailViewController.view addSubview:feedDetailViewController.view];
|
||||
|
||||
[self adjustStoryDetailWebView];
|
||||
|
@ -294,13 +294,13 @@
|
|||
// remove existing feedDetailViewController
|
||||
NSArray *subviews = [[splitStoryDetailViewController.view subviews] copy];
|
||||
for (UIView *subview in subviews) {
|
||||
if (subview.tag == 14) {
|
||||
if (subview.tag == FEED_DETAIL_VIEW_TAG) {
|
||||
[subview removeFromSuperview];
|
||||
}
|
||||
}
|
||||
[subviews release];
|
||||
|
||||
feedDetailViewController.view.tag = 14;
|
||||
feedDetailViewController.view.tag = FEED_DETAIL_VIEW_TAG;
|
||||
[splitStoryDetailViewController.view addSubview:feedDetailViewController.view];
|
||||
|
||||
[self adjustStoryDetailWebView];
|
||||
|
@ -348,7 +348,7 @@
|
|||
// remove existing feedDetailViewController
|
||||
NSArray *subviews = [[splitStoryDetailViewController.view subviews] copy];
|
||||
for (UIView *subview in subviews) {
|
||||
if (subview.tag == 14) {
|
||||
if (subview.tag == FEED_DETAIL_VIEW_TAG) {
|
||||
[subview removeFromSuperview];
|
||||
}
|
||||
}
|
||||
|
@ -396,13 +396,13 @@
|
|||
// With some valid UIView *view:
|
||||
NSArray *subviews = [[splitStoryDetailViewController.view subviews] copy];
|
||||
for (UIView *subview in subviews) {
|
||||
if (subview.tag == 12) {
|
||||
if (subview.tag == STORY_DETAIL_VIEW_TAG) {
|
||||
[subview removeFromSuperview];
|
||||
}
|
||||
}
|
||||
[subviews release];
|
||||
|
||||
storyDetailViewController.view.tag = 12;
|
||||
storyDetailViewController.view.tag = STORY_DETAIL_VIEW_TAG;
|
||||
[splitStoryDetailViewController.view addSubview:storyDetailViewController.view];
|
||||
[self adjustStoryDetailWebView];
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
// if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
|
||||
// NSArray *subviews = [[appDelegate.splitStoryDetailViewController.view subviews] copy];
|
||||
// for (UIView *subview in subviews) {
|
||||
// if (subview.tag == 12) {
|
||||
// if (subview.tag == STORY_DETAIL_VIEW_TAG) {
|
||||
// [subview removeFromSuperview];
|
||||
// }
|
||||
// }
|
||||
|
|
|
@ -235,9 +235,9 @@
|
|||
self.feedTitleGradient = [appDelegate makeFeedTitleGradient:feed
|
||||
withRect:CGRectMake(0, -1, 1024, 21)]; // 1024 hack for self.webView.frame.size.width
|
||||
|
||||
self.feedTitleGradient.tag = 12; // Not attached yet. Remove old gradients, first.
|
||||
self.feedTitleGradient.tag = FEED_TITLE_GRADIENT_TAG; // Not attached yet. Remove old gradients, first.
|
||||
for (UIView *subview in self.webView.subviews) {
|
||||
if (subview.tag == 12) {
|
||||
if (subview.tag == FEED_TITLE_GRADIENT_TAG) {
|
||||
[subview removeFromSuperview];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue