[iOS] Using SplitController + search button added

This commit is contained in:
Kirill Zhdanovich 2013-08-07 15:45:16 +03:00
parent bcd179603c
commit c1d069b9a4
3 changed files with 19 additions and 3 deletions

View file

@ -1,13 +1,16 @@
#import "AppDelegate.h"
#import "ArticleVC.h"
#import "IPadSplitVC.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
ArticleVC * table = [[ArticleVC alloc] initWithStyle:UITableViewStylePlain];
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:table];
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad)
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[[ArticleVC alloc] initWithStyle:UITableViewStylePlain]];
else
self.window.rootViewController = [[IPadSplitVC alloc] init];
[self.window makeKeyAndVisible];
return YES;
}

View file

@ -1,4 +1,11 @@
#import <UIKit/UIKit.h>
@interface ArticleVC : UITableViewController <UISearchBarDelegate, UITableViewDelegate>
@protocol ArticleDelegate <NSObject>
-(void)selectHtmlPageUrl:(NSString *)url;
@end
@interface ArticleVC : UITableViewController <UISearchBarDelegate, UITableViewDelegate>
@property (nonatomic, assign) id <ArticleDelegate> delegate;
//uses on start of application
-(NSString *)getDefaultArticle;
@end

View file

@ -94,6 +94,7 @@
GuideVC * vc = [[GuideVC alloc] init];
[vc loadPage:[NSString stringWithUTF8String:info->m_url.c_str()]];
[self.navigationController pushViewController:vc animated:YES];
[self.delegate selectHtmlPageUrl:[NSString stringWithUTF8String:info->m_url.c_str()]];
}
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
@ -118,4 +119,9 @@
return &m_infos[index];
}
-(NSString *)getDefaultArticle
{
return [NSString stringWithUTF8String:m_infos[0].m_url.c_str()];
}
@end