Commit f16b5b2b authored by 曹云霄's avatar 曹云霄

caoyunxiao

parent 1aef5cbb
//
// ClientViewController.h
// Lighting
//
// Created by 曹云霄 on 16/4/28.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface ClientViewController : BaseViewController
@end
//
// ClientViewController.m
// Lighting
//
// Created by 曹云霄 on 16/4/28.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ClientViewController.h"
@interface ClientViewController ()
@end
@implementation ClientViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor redColor];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(100, 100, 100, 100);
button.backgroundColor = [UIColor blackColor];
[self.view addSubview:button];
[button addTarget:self action:@selector(Click) forControlEvents:UIControlEventTouchUpInside];
}
- (void)Click
{
RightViewController *right = [[RightViewController alloc]init];
[self.navigationController pushViewController:right animated: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.
}
*/
@end
//
// LoginViewController.h
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface LoginViewController : BaseViewController
@end
//
// LoginViewController.m
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "LoginViewController.h"
#import "CustomTabbarController.h"
#import "AppDelegate.h"
@interface LoginViewController ()
@property (weak, nonatomic) IBOutlet UIButton *loginButton;
@property (nonatomic,strong) MMDrawerController *drawerController;
@end
@implementation LoginViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
#pragma mark -登陆
- (IBAction)LoginButtonClick:(UIButton *)sender {
CustomTabbarController *customtabbar = [[CustomTabbarController alloc]init];
RightViewController *rightVC = [[RightViewController alloc]init];
self.drawerController = [[MMDrawerController alloc]initWithCenterViewController:customtabbar rightDrawerViewController:rightVC];
[self.drawerController setMaximumRightDrawerWidth:RightWidth];
[self.drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];
[self.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
SHARED_APPDELEGATE.window.rootViewController = self.drawerController;
}
- (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.
}
*/
@end
//
// RightViewController.h
// Lighting
//
// Created by 曹云霄 on 16/4/28.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface RightViewController : BaseViewController
@end
//
// RightViewController.m
// Lighting
//
// Created by 曹云霄 on 16/4/28.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "RightViewController.h"
@interface RightViewController ()
@end
@implementation RightViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor blueColor];
}
- (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.
}
*/
@end
//
// ShoppingViewController.h
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface ShoppingViewController : BaseViewController
@end
//
// ShoppingViewController.m
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ShoppingViewController.h"
@interface ShoppingViewController ()
@end
@implementation ShoppingViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (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.
}
*/
@end
//
// CustomTabbarController.h
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CustomTabbarController : UITabBarController
@end
//
// CustomTabbarController.m
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomTabbarController.h"
#import "Toolview.h"
#import "ClientViewController.h"
@interface CustomTabbarController ()
@end
@implementation CustomTabbarController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.tabBar.frame = CGRectMake(Zero, Zero, ScreenWidth, NavigationHeight);
Toolview *toolview = [[Toolview alloc]initWithFrame:CGRectMake(Zero, Zero, ScreenWidth, NavigationHeight)];
[self.tabBar addSubview:toolview];
ClientViewController *client = [[ClientViewController alloc]init];
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:client];
NSArray *arr = @[nav];
self.viewControllers = arr;
}
- (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.
}
*/
@end
//
// Toolview.h
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface Toolview : UIView
@end
//
// Toolview.m
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "Toolview.h"
#import "CustomButton.h"
@implementation Toolview
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
self.backgroundColor = kTCColor(239, 239, 239);
[self uiConfigAction];
}
return self;
}
#define ButtonWIDTH 100 //按钮宽度
#define Buttoninterval 20//按钮间隔
#define ButtonRIGHT 54//按钮高度
#pragma mark -布局
- (void)uiConfigAction
{
for (int i=1; i<5; i++) {
CustomButton *button = [CustomButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(ScreenWidth-(i*ButtonWIDTH + Buttoninterval*(i-1)), 10, ButtonWIDTH, ButtonRIGHT);
[button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[button setTitle:@"购物车" forState:UIControlStateNormal];
[button setImage:TCImage(@"qq") forState:UIControlStateNormal];
[self addSubview:button];
}
}
@end
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Lighting.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Lighting.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
//
// AppDelegate.h
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;
@end
//
// AppDelegate.m
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AppDelegate.h"
#import "LoginViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[self SetIQKeyboardManager];
[self RootViewcontroller];
return YES;
}
#pragma mark -设置根视图
- (void)RootViewcontroller
{
UIStoryboard *story = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
LoginViewController *login = [story instantiateViewControllerWithIdentifier:@"Login"];
self.window.rootViewController = login;
}
#pragma mark - 键盘
- (void)SetIQKeyboardManager
{
IQKeyboardManager *manager = [IQKeyboardManager sharedManager];
manager.enable = YES;
manager.shouldResignOnTouchOutside = YES;
manager.enableAutoToolbar = YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
[self saveContext];
}
#pragma mark - Core Data stack
@synthesize managedObjectContext = _managedObjectContext;
@synthesize managedObjectModel = _managedObjectModel;
@synthesize persistentStoreCoordinator = _persistentStoreCoordinator;
- (NSURL *)applicationDocumentsDirectory {
// The directory the application uses to store the Core Data store file. This code uses a directory named "----------.Lighting" in the application's documents directory.
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}
- (NSManagedObjectModel *)managedObjectModel {
// The managed object model for the application. It is a fatal error for the application not to be able to find and load its model.
if (_managedObjectModel != nil) {
return _managedObjectModel;
}
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Lighting" withExtension:@"momd"];
_managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
return _managedObjectModel;
}
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
// The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it.
if (_persistentStoreCoordinator != nil) {
return _persistentStoreCoordinator;
}
// Create the coordinator and store
_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Lighting.sqlite"];
NSError *error = nil;
NSString *failureReason = @"There was an error creating or loading the application's saved data.";
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) {
// Report any error we got.
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
dict[NSLocalizedDescriptionKey] = @"Failed to initialize the application's saved data";
dict[NSLocalizedFailureReasonErrorKey] = failureReason;
dict[NSUnderlyingErrorKey] = error;
error = [NSError errorWithDomain:@"YOUR_ERROR_DOMAIN" code:9999 userInfo:dict];
// Replace this with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
return _persistentStoreCoordinator;
}
- (NSManagedObjectContext *)managedObjectContext {
// Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.)
if (_managedObjectContext != nil) {
return _managedObjectContext;
}
NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
if (!coordinator) {
return nil;
}
_managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
[_managedObjectContext setPersistentStoreCoordinator:coordinator];
return _managedObjectContext;
}
#pragma mark - Core Data Saving support
- (void)saveContext {
NSManagedObjectContext *managedObjectContext = self.managedObjectContext;
if (managedObjectContext != nil) {
NSError *error = nil;
if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) {
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
}
}
@end
{
"images" : [
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Login View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController storyboardIdentifier="Login" id="BYZ-38-t0r" customClass="LoginViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="507" height="768"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="140048947-1" id="CQr-RC-S14">
<rect key="frame" x="0.0" y="0.0" width="507" height="768"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</imageView>
<view contentMode="scaleToFill" id="4F7-r1-Ukj">
<rect key="frame" x="79" y="228" width="350" height="311"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" id="tiS-xO-6mX">
<rect key="frame" x="0.0" y="0.0" width="350" height="49"/>
<autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="登陆" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="ggb-vy-8UV">
<rect key="frame" x="132" y="14" width="86" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.40784313725490196" green="0.40784313725490196" blue="0.40784313725490196" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.93725490196078431" alpha="1" colorSpace="calibratedRGB"/>
</view>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入用户名" textAlignment="natural" minimumFontSize="17" id="3P4-Yx-LJL">
<rect key="frame" x="15" y="67.5" width="320" height="40"/>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.93725490196078431" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入密码" textAlignment="natural" minimumFontSize="17" id="2FB-xf-XVJ">
<rect key="frame" x="15" y="114.5" width="320" height="40"/>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.93725490196078431" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入经销商代码" textAlignment="natural" minimumFontSize="17" id="Ch8-53-VkU">
<rect key="frame" x="15" y="161" width="320" height="40"/>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.93725490196078431" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="gRP-i4-Dn9">
<rect key="frame" x="15" y="218.5" width="320" height="40"/>
<color key="backgroundColor" red="0.56470588235294117" green="0.75686274509803919" blue="0.19607843137254902" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="登陆"/>
<connections>
<action selector="LoginButtonClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="gUs-Ze-FsT"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="iPad-1/2"/>
<connections>
<outlet property="loginButton" destination="gRP-i4-Dn9" id="fwF-Vw-I96"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="187.5" y="426"/>
</scene>
</scenes>
<resources>
<image name="140048947-1" width="900" height="900"/>
</resources>
</document>
{
"images" : [
{
"idiom" : "universal",
"filename" : "140048947-1.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "140049313-1.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "140049343-1.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "1451383435.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?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>NSAppTransportSecurity</key>
<dict/>
<key>NSAllowsArbitraryLoads</key>
<true/>
<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>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
<?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>_XCCurrentVersionName</key>
<string>Lighting.xcdatamodel</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model name="Test1.xcdatamodel" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="1" systemVersion="11A491" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
<elements/>
</model>
\ No newline at end of file
//
// main.m
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
PODS:
- AFNetworking (3.1.0):
- AFNetworking/NSURLSession (= 3.1.0)
- AFNetworking/Reachability (= 3.1.0)
- AFNetworking/Security (= 3.1.0)
- AFNetworking/Serialization (= 3.1.0)
- AFNetworking/UIKit (= 3.1.0)
- AFNetworking/NSURLSession (3.1.0):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (3.1.0)
- AFNetworking/Security (3.1.0)
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- IQKeyboardManager (4.0.2)
- Masonry (0.6.4)
- MBProgressHUD (0.9.2)
- MJExtension (3.0.10)
- MJRefresh (3.1.0)
- MMDrawerController (0.6.0):
- MMDrawerController/Core (= 0.6.0)
- MMDrawerController/MMDrawerBarButtonItem (= 0.6.0)
- MMDrawerController/MMDrawerVisualStates (= 0.6.0)
- MMDrawerController/Subclass (= 0.6.0)
- MMDrawerController/Core (0.6.0)
- MMDrawerController/MMDrawerBarButtonItem (0.6.0):
- MMDrawerController/Core
- MMDrawerController/MMDrawerVisualStates (0.6.0):
- MMDrawerController/Core
- MMDrawerController/Subclass (0.6.0):
- MMDrawerController/Core
- SDWebImage (3.7.5):
- SDWebImage/Core (= 3.7.5)
- SDWebImage/Core (3.7.5)
- SVProgressHUD (2.0.3)
DEPENDENCIES:
- AFNetworking (~> 3.1.0)
- IQKeyboardManager (~> 4.0.0)
- Masonry (~> 0.6.4)
- MBProgressHUD (~> 0.9.2)
- MJExtension (~> 3.0.10)
- MJRefresh (~> 3.1.0)
- MMDrawerController (~> 0.6.0)
- SDWebImage (~> 3.7.5)
- SVProgressHUD (~> 2.0.3)
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
IQKeyboardManager: 2341089c4ae25fa2fa82ce356a259fcd267dc6b6
Masonry: 281802d04d787ea2973179ee8bcb50500579ede2
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548
MJRefresh: 743e6404967d1c2c688472ea3ecfde247d872db4
MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0
SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461
SVProgressHUD: b0830714205bea1317ea1a2ebc71e5633af334d4
COCOAPODS: 0.39.0
//
// BaseViewController.h
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BaseViewController : UIViewController
/**
* 结束刷新
*
* @param TableView Tableview
*/
- (void)endRefreshingForTableView:(UIScrollView *)TableView;
/**
* MBProgressHUD等待视图
*/
- (void)CreateMBProgressHUDLoding:(NSString *)ShowText;
/**
* 移除MBProgressHUD等待视图
*/
- (void)RemoveMBProgressHUDLoding:(NSString *)Endstring;
/**
* 渐隐提示框待回调Block
*/
- (void)SHOWPrompttext:(NSString *)Text ComcpleteBlock:(void(^)())completed;
@end
//
// BaseViewController.m
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface BaseViewController ()
@property (nonatomic,strong) MBProgressHUD*TCHud;
@end
@implementation BaseViewController
/**
* 创建MBProgressHUD对象
*
* @return MBProgressHUD
*/
- (MBProgressHUD *)TCHud
{
if (_TCHud == nil) {
_TCHud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
}
return _TCHud;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark -渐隐提示框回调
- (void)SHOWPrompttext:(NSString *)Text ComcpleteBlock:(void(^)())completed
{
MBProgressHUD *hud = [[MBProgressHUD alloc]initWithView:self.view];
hud.labelText = Text;
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeText;
hud.removeFromSuperViewOnHide = YES;
[hud hide:YES afterDelay:2.0f];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (completed) {
completed();
}
});
}
#pragma mark -显示MBProgressHUD等待视图
- (void)CreateMBProgressHUDLoding:(NSString *)ShowText
{
if(ShowText==nil)
{
ShowText = @"加载中";
}
self.TCHud.labelText = ShowText;
self.TCHud.animationType = MBProgressHUDAnimationZoom;
self.TCHud.mode = MBProgressHUDModeIndeterminate;
self.TCHud.activityIndicatorColor = [UIColor redColor];
self.TCHud.removeFromSuperViewOnHide = YES;
}
#pragma mark -移除MBProgressHUD等待视图
- (void)RemoveMBProgressHUDLoding:(NSString *)Endstring;
{
if (Endstring != nil) {
self.TCHud.labelText = Endstring;
}
[self.TCHud hide:YES afterDelay:1];
self.TCHud = nil;
}
#pragma mark -结束MJRfresh刷新
- (void)endRefreshingForTableView:(UIScrollView *)TableView
{
if (TableView.mj_header.isRefreshing) {
[TableView.mj_header endRefreshing];
}
else if (TableView.mj_footer.isRefreshing)
{
[TableView.mj_footer endRefreshing];
}
}
@end
//
// CustomButton.h
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CustomButton : UIButton
@end
//
// CustomButton.m
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomButton.h"
#define WIDTH self.frame.size.width
@implementation CustomButton
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
self.titleLabel.font = [UIFont systemFontOfSize:13];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
}
return self;
}
- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
return CGRectMake((WIDTH-30)/2, 0, 30, 30);
}
- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
return CGRectMake(2, 33, WIDTH, 20);
}
@end
//
// PrefixHeader.pch
// Lighting
//
// Created by 曹云霄 on 16/4/27.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#ifndef PrefixHeader_pch
#define PrefixHeader_pch
#import "MBProgressHUD.h"
#import "MJRefresh.h"
#import "MMDrawerController.h"
#import "RightViewController.h"
#import "IQKeyboardManager.h"
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
/**
* AppDelegate代理
*/
#define SHARED_APPDELEGATE ((AppDelegate *)([UIApplication sharedApplication].delegate))
/**
* 屏幕的物理高度
*/
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
/**
* 导航栏高度
*/
#define NavigationHeight 64
/**
* 屏幕的物理宽度
*/
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
/**
* 定义UIImage对象
*/
#define TCImage(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]
/**
* AppDelegate代理
*/
#define SHARED_APPDELEGATE ((AppDelegate *)([UIApplication sharedApplication].delegate))
/**
* 屏幕的物理高度
*/
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
/**
* 屏幕的物理宽度
*/
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
/**
* 定义UIImage对象
*/
#define TCImage(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]
/**
* 获取RGB颜色
*/
#define kTCColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
/**
* 右侧菜单宽度
*/
#define RightWidth 200
/**
* 0
*/
#define Zero 0
#endif /* PrefixHeader_pch */
platform:ios,'9.0'
pod 'MBProgressHUD', '~> 0.9.2'
pod 'SVProgressHUD', '~> 2.0.3'
pod 'IQKeyboardManager', '~> 4.0.0'
pod 'MMDrawerController', '~> 0.6.0'
pod 'MJExtension', '~> 3.0.10'
pod 'Masonry', '~> 0.6.4'
pod 'MJRefresh', '~> 3.1.0'
pod 'SDWebImage', '~> 3.7.5'
pod 'AFNetworking', '~> 3.1.0'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment