Initial commit

This commit is contained in:
ifish
2017-08-15 16:59:01 +08:00
commit bdc83e07ef
5766 changed files with 423223 additions and 0 deletions
@@ -0,0 +1,22 @@
//
// BaseVIewContorller.h
// Ifish
//
// Created by imac on 15/9/28.
// Copyright © 2015年 imac. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BaseVIewContorller : UIViewController
@property(nonatomic,strong)UIBarButtonItem*back;
@property(nonatomic,strong)UIButton*bakbutton;
@property(nonatomic,strong)UIBarButtonItem*rightItem;
@property(nonatomic,strong)UIButton*rightButton;
- (void)addTitleViewWithTitle:(NSString *)title;
-(void)initNav;
-(void)showTitle:(NSString*)title messsage:(NSString*)message;
@end
@@ -0,0 +1,178 @@
//
// BaseVIewContorller.m
// Ifish
//
// Created by imac on 15/9/28.
// Copyright © 2015年 imac. All rights reserved.
//
#import "BaseVIewContorller.h"
#import "AppDelegate.h"
#import "UINavigationBar+Background.h"
@interface BaseVIewContorller ()
@end
@implementation BaseVIewContorller
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initNav];
self.view.backgroundColor = TABLE_BACKGROUD_COLOR;
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController.navigationBar resetBackgroundImage];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
}
- (void)addTitleViewWithTitle:(NSString *)title{
UILabel*labe=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 60, 44)];
labe.text=title;
labe.textAlignment=NSTextAlignmentCenter;
labe.textColor=[UIColor whiteColor];
labe.font = [UIFont systemFontOfSize:19];
self.navigationItem.titleView=labe;
}
-(void)initNav{
// 1. 可以改变全栈back按钮 图片 60*60 @2x像素
// UIImage *backImage = [UIImage imageNamed:@"leftItem"];
// [[UIBarButtonItem appearance] setBackButtonBackgroundImage:[backImage resizableImageWithCapInsets:UIEdgeInsetsMake(0,0,0,0)] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
// [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0,-60) forBarMetrics:UIBarMetricsDefault];// UIBarButtonItem *backItem=[[UIBarButtonItem alloc]init];
// backItem.title=@"";
// backItem.image=[UIImage imageNamed:@"leftItem"];
// self.navigationItem.backBarButtonItem=backItem;
_bakbutton = [UIButton buttonWithType:UIButtonTypeCustom];
_bakbutton.frame = CGRectMake(0,0,48,44);
[_bakbutton setImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal];
[_bakbutton addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside];
_back=[[UIBarButtonItem alloc] initWithCustomView:_bakbutton];
self.navigationItem.leftBarButtonItem=_back;
}
-(void)goBackAction{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
-(void)showTitle:(NSString*)title messsage:(NSString*)message{
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:title message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil];
NSTimeInterval dismissSeconds=1.0;
[alert show];
[self performSelector:@selector(dismissAlert:) withObject:alert afterDelay:dismissSeconds];
// UIAlertController *alertContorller=[UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
// UIAlertAction*cancleAction=[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
//
// UIAlertAction *sureAction=[UIAlertAction actionWithTitle:@"好的" style:UIAlertActionStyleDefault handler:nil];
// [alertContorller addAction:cancleAction];
// [alertContorller addAction:sureAction];
// [self presentViewController:alertContorller animated:YES completion:nil];
}
-(void)dismissAlert:(UIAlertView*)alertView{
[alertView dismissWithClickedButtonIndex:[alertView cancelButtonIndex] animated:YES];
}
-(void)creatMyindicaterView{
// _indicatorView=[[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
// // _indicatorView.center=CGPointMake(kScreenSize.width/2, kScreenSize.height/2+100);
// //[_indicatorView startAnimating];
// _indicatorView.frame=CGRectMake(kScreenSize.width/2-20,kScreenSize.height/2-20,40, 40);
// // _indicatorView.backgroundColor=[UIColor lightGrayColor];
// [self.view addSubview:_indicatorView];
}
#pragma mark - 竖屏时,显示状态栏
-(BOOL)prefersStatusBarHidden
{
return NO;
}
//白色状态栏
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
#pragma mark - 屏幕Autorotate
-(BOOL)shouldAutorotate{
return YES;
}
#pragma mark 屏幕支持的旋转方向
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface {
return (interface == UIInterfaceOrientationPortrait || interface == UIInterfaceOrientationLandscapeRight);
}
//
#ifdef IOS6
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
- (BOOL)shouldAutorotate {
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeRight;
}
#endif
//
#pragma mark 支持哪些方向
-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskLandscapeRight;
}
#pragma mark 一开始希望的屏幕方向
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationPortrait;
}
#pragma mark - 屏幕旋转
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
{
}
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
}
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
}
}
@end
@@ -0,0 +1,19 @@
//
// ClearNavBaseViewController.h
// Ifish
//
// Created by imac on 17/3/14.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ClearNavBaseViewController : UIViewController
@property(nonatomic,strong)UIBarButtonItem*back;
@property(nonatomic,strong)UIButton*bakbutton;
@property(nonatomic,strong)UIBarButtonItem*rightItem;
@property(nonatomic,strong)UIButton*rightButton;
- (void)addTitleViewWithTitle:(NSString *)title;
@end
@@ -0,0 +1,151 @@
//
// ClearNavBaseViewController.m
// Ifish
//
// Created by imac on 17/3/14.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import "ClearNavBaseViewController.h"
#import "UINavigationBar+Background.h"
@interface ClearNavBaseViewController ()
@end
@implementation ClearNavBaseViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = TABLE_BACKGROUD_COLOR;
[self initNav];
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController.navigationBar setClearNav];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
}
- (void)addTitleViewWithTitle:(NSString *)title{
UILabel*labe=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 60, 44)];
labe.text=title;
labe.textAlignment=NSTextAlignmentCenter;
labe.textColor=[UIColor whiteColor];
labe.font = [UIFont systemFontOfSize:19];
self.navigationItem.titleView=labe;
}
-(void)initNav{
// 1. 可以改变全栈back按钮 图片 60*60 @2x像素
_bakbutton = [UIButton buttonWithType:UIButtonTypeCustom];
_bakbutton.frame = CGRectMake(0,0,48,44);
[_bakbutton setImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal];
[_bakbutton addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside];
_back=[[UIBarButtonItem alloc] initWithCustomView:_bakbutton];
self.navigationItem.leftBarButtonItem=_back;
}
-(void)goBackAction{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - 竖屏时,显示状态栏
//白色导航黑色状态栏
-(BOOL)prefersStatusBarHidden
{
return NO;
}
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleDefault;
}
#pragma mark - 屏幕Autorotate
-(BOOL)shouldAutorotate{
return YES;
}
#pragma mark 屏幕支持的旋转方向
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface {
return (interface == UIInterfaceOrientationPortrait || interface == UIInterfaceOrientationLandscapeRight);
}
//
#ifdef IOS6
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
- (BOOL)shouldAutorotate {
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeRight;
}
#endif
//
#pragma mark 支持哪些方向
-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskLandscapeRight;
}
#pragma mark 一开始希望的屏幕方向
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationPortrait;
}
#pragma mark - 屏幕旋转
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
{
}
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
}
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@@ -0,0 +1,22 @@
//
// FatherController.h
// Ifish
//
// Created by imac on 15/10/29.
// Copyright © 2015年 imac. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FatherController : UITableViewController
@property(nonatomic,strong)UIBarButtonItem*back;
@property(nonatomic,strong)UIButton*bakbutton;
@property(nonatomic,strong)UIBarButtonItem*rightItem;
@property(nonatomic,strong)UIButton*rightButton;
-(void)showTitle:(NSString*)title messsage:(NSString*)message;
- (void)addTitleViewWithTitle:(NSString *)title;
-(void)goBackAction;
@end
@@ -0,0 +1,91 @@
//
// FatherController.m
// Ifish
//
// Created by imac on 15/10/29.
// Copyright © 2015年 imac. All rights reserved.
//
#import "FatherController.h"
@interface FatherController ()
@end
@implementation FatherController
- (void)viewDidLoad {
[super viewDidLoad];
[self setNav];
}
-(void)setNav{
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(2, 5,47, 44);
[btn setBackgroundImage:[UIImage imageNamed:@"arrow_l"] forState:UIControlStateNormal];
[btn addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside];
UIBarButtonItem*back=[[UIBarButtonItem alloc]initWithCustomView:btn];
self.navigationItem.leftBarButtonItem=back;
}
- (void)addTitleViewWithTitle:(NSString *)title{
UILabel*labe=[[UILabel alloc]initWithFrame:CGRectMake(0, 0,100, 44)];
labe.text=title;
labe.textAlignment=NSTextAlignmentCenter;
labe.textColor=[UIColor whiteColor];
labe.font = [UIFont systemFontOfSize:19];
self.navigationItem.titleView=labe;
}
-(void)goBackAction{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 0;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 0;
}
- (BOOL)prefersStatusBarHidden
{
return NO;
}
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
-(void)showTitle:(NSString*)title messsage:(NSString*)message{
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:title message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil];
NSTimeInterval dismissSeconds=2.0;
[alert show];
[self performSelector:@selector(dismissAlert:) withObject:alert afterDelay:dismissSeconds];
// UIAlertController *alertContorller=[UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
// UIAlertAction*cancleAction=[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
//
// UIAlertAction *sureAction=[UIAlertAction actionWithTitle:@"好的" style:UIAlertActionStyleDefault handler:nil];
// [alertContorller addAction:cancleAction];
// [alertContorller addAction:sureAction];
// [self presentViewController:alertContorller animated:YES completion:nil];
}
-(void)dismissAlert:(UIAlertView*)alertView{
[alertView dismissWithClickedButtonIndex:[alertView cancelButtonIndex] animated:YES];
}
@end
@@ -0,0 +1,19 @@
//
// WhiteNavBaseViewController.h
// Ifish
//
// Created by imac on 17/2/10.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WhiteNavBaseViewController : UIViewController
@property(nonatomic,strong)UIBarButtonItem*back;
@property(nonatomic,strong)UIButton*bakbutton;
@property(nonatomic,strong)UIBarButtonItem*rightItem;
@property(nonatomic,strong)UIButton*rightButton;
- (void)addTitleViewWithTitle:(NSString *)title;
@end
@@ -0,0 +1,150 @@
//
// WhiteNavBaseViewController.m
// Ifish
//
// Created by imac on 17/2/10.
// Copyright © 2017年 lianlian. All rights reserved.
//
#import "WhiteNavBaseViewController.h"
#import "UINavigationBar+Background.h"
@interface WhiteNavBaseViewController ()
@end
@implementation WhiteNavBaseViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
[self initNav];
// Do any additional setup after loading the view.
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController.navigationBar setWhiteNav];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
}
- (void)addTitleViewWithTitle:(NSString *)title{
UILabel*labe=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 60, 44)];
labe.text=title;
labe.textAlignment=NSTextAlignmentCenter;
labe.textColor=[UIColor blackColor];
labe.font = [UIFont systemFontOfSize:19];
self.navigationItem.titleView=labe;
}
-(void)initNav{
// 1. 可以改变全栈back按钮 图片 60*60 @2x像素
_bakbutton = [UIButton buttonWithType:UIButtonTypeCustom];
_bakbutton.frame = CGRectMake(0,0,48,44);
[_bakbutton setImage:[UIImage imageNamed:@"arrow_b"] forState:UIControlStateNormal];
[_bakbutton addTarget: self action: @selector(goBackAction) forControlEvents: UIControlEventTouchUpInside];
_back=[[UIBarButtonItem alloc] initWithCustomView:_bakbutton];
self.navigationItem.leftBarButtonItem=_back;
}
-(void)goBackAction{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
#pragma mark - 竖屏时,显示状态栏
//白色导航黑色状态栏
-(BOOL)prefersStatusBarHidden
{
return NO;
}
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleDefault;
}
#pragma mark - 屏幕Autorotate
-(BOOL)shouldAutorotate{
return YES;
}
#pragma mark 屏幕支持的旋转方向
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface {
return (interface == UIInterfaceOrientationPortrait || interface == UIInterfaceOrientationLandscapeRight);
}
//
#ifdef IOS6
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
- (BOOL)shouldAutorotate {
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeRight;
}
#endif
//
#pragma mark 支持哪些方向
-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskLandscapeRight;
}
#pragma mark 一开始希望的屏幕方向
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationPortrait;
}
#pragma mark - 屏幕旋转
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
{
}
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
}
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
}
}
@end