Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
Opple-iOS
Commits
5cfe3c55
Commit
5cfe3c55
authored
Mar 31, 2017
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化AppDelegate代码
parent
28cdf6b5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
30 deletions
+97
-30
project.pbxproj
Lighting.xcodeproj/project.pbxproj
+14
-0
AppDelegate.m
Lighting/AppDelegate.m
+5
-30
ToolHelper.h
Tools/ToolHelper/ToolHelper.h
+13
-0
ToolHelper.m
Tools/ToolHelper/ToolHelper.m
+65
-0
No files found.
Lighting.xcodeproj/project.pbxproj
View file @
5cfe3c55
...
@@ -303,6 +303,7 @@
...
@@ -303,6 +303,7 @@
29E384CB1CE9B0BB00888199
/* HotCollectionViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E384CA1CE9B0BB00888199
/* HotCollectionViewCell.m */
;
};
29E384CB1CE9B0BB00888199
/* HotCollectionViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E384CA1CE9B0BB00888199
/* HotCollectionViewCell.m */
;
};
29E384D11CE9C65700888199
/* SearchViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E384D01CE9C65700888199
/* SearchViewController.m */
;
};
29E384D11CE9C65700888199
/* SearchViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E384D01CE9C65700888199
/* SearchViewController.m */
;
};
29E47BD41E8E0C49004D0D00
/* UIButton+Title_Image.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E47BD31E8E0C49004D0D00
/* UIButton+Title_Image.m */
;
};
29E47BD41E8E0C49004D0D00
/* UIButton+Title_Image.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E47BD31E8E0C49004D0D00
/* UIButton+Title_Image.m */
;
};
29E47BE01E8E42F2004D0D00
/* ToolHelper.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E47BDF1E8E42F2004D0D00
/* ToolHelper.m */
;
};
29E9443D1DE3E0D0007CD26C
/* prizeDetailsTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E9443C1DE3E0D0007CD26C
/* prizeDetailsTableViewCell.m */
;
};
29E9443D1DE3E0D0007CD26C
/* prizeDetailsTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E9443C1DE3E0D0007CD26C
/* prizeDetailsTableViewCell.m */
;
};
29E944421DE3EC7C007CD26C
/* PrizeMainViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E944411DE3EC7C007CD26C
/* PrizeMainViewController.m */
;
};
29E944421DE3EC7C007CD26C
/* PrizeMainViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E944411DE3EC7C007CD26C
/* PrizeMainViewController.m */
;
};
29E944461DE3EFFE007CD26C
/* PrizeListCollectionViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E944451DE3EFFE007CD26C
/* PrizeListCollectionViewCell.m */
;
};
29E944461DE3EFFE007CD26C
/* PrizeListCollectionViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29E944451DE3EFFE007CD26C
/* PrizeListCollectionViewCell.m */
;
};
...
@@ -915,6 +916,8 @@
...
@@ -915,6 +916,8 @@
29E384D01CE9C65700888199
/* SearchViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
SearchViewController.m
;
sourceTree
=
"<group>"
;
};
29E384D01CE9C65700888199
/* SearchViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
SearchViewController.m
;
sourceTree
=
"<group>"
;
};
29E47BD21E8E0C49004D0D00
/* UIButton+Title_Image.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"UIButton+Title_Image.h"
;
sourceTree
=
"<group>"
;
};
29E47BD21E8E0C49004D0D00
/* UIButton+Title_Image.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"UIButton+Title_Image.h"
;
sourceTree
=
"<group>"
;
};
29E47BD31E8E0C49004D0D00
/* UIButton+Title_Image.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"UIButton+Title_Image.m"
;
sourceTree
=
"<group>"
;
};
29E47BD31E8E0C49004D0D00
/* UIButton+Title_Image.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"UIButton+Title_Image.m"
;
sourceTree
=
"<group>"
;
};
29E47BDE1E8E42F2004D0D00
/* ToolHelper.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ToolHelper.h
;
sourceTree
=
"<group>"
;
};
29E47BDF1E8E42F2004D0D00
/* ToolHelper.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ToolHelper.m
;
sourceTree
=
"<group>"
;
};
29E9443B1DE3E0D0007CD26C
/* prizeDetailsTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
prizeDetailsTableViewCell.h
;
sourceTree
=
"<group>"
;
};
29E9443B1DE3E0D0007CD26C
/* prizeDetailsTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
prizeDetailsTableViewCell.h
;
sourceTree
=
"<group>"
;
};
29E9443C1DE3E0D0007CD26C
/* prizeDetailsTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
prizeDetailsTableViewCell.m
;
sourceTree
=
"<group>"
;
};
29E9443C1DE3E0D0007CD26C
/* prizeDetailsTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
prizeDetailsTableViewCell.m
;
sourceTree
=
"<group>"
;
};
29E944401DE3EC7C007CD26C
/* PrizeMainViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
PrizeMainViewController.h
;
sourceTree
=
"<group>"
;
};
29E944401DE3EC7C007CD26C
/* PrizeMainViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
PrizeMainViewController.h
;
sourceTree
=
"<group>"
;
};
...
@@ -1166,6 +1169,7 @@
...
@@ -1166,6 +1169,7 @@
2928F7DE1CD085430036D761
/* Tools */
=
{
2928F7DE1CD085430036D761
/* Tools */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
29E47BDD1E8E42E4004D0D00
/* ToolHelper */
,
29A4197F1E812E5E0064E958
/* Location */
,
29A4197F1E812E5E0064E958
/* Location */
,
293221511E6FA1F900DD4980
/* Resource */
,
293221511E6FA1F900DD4980
/* Resource */
,
2985345D1DD4B0100023BBAE
/* AirPrint */
,
2985345D1DD4B0100023BBAE
/* AirPrint */
,
...
@@ -2628,6 +2632,15 @@
...
@@ -2628,6 +2632,15 @@
path
=
view
;
path
=
view
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
29E47BDD1E8E42E4004D0D00
/* ToolHelper */
=
{
isa
=
PBXGroup
;
children
=
(
29E47BDE1E8E42F2004D0D00
/* ToolHelper.h */
,
29E47BDF1E8E42F2004D0D00
/* ToolHelper.m */
,
);
path
=
ToolHelper
;
sourceTree
=
"<group>"
;
};
29E9443E1DE3EBE9007CD26C
/* GuideMain */
=
{
29E9443E1DE3EBE9007CD26C
/* GuideMain */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
...
@@ -3216,6 +3229,7 @@
...
@@ -3216,6 +3229,7 @@
29B3EE711DCE16130065FCCF
/* LuckyDrawViewController.m in Sources */
,
29B3EE711DCE16130065FCCF
/* LuckyDrawViewController.m in Sources */
,
293164031DCE3F780075129D
/* UsedDrawTableViewCell.m in Sources */
,
293164031DCE3F780075129D
/* UsedDrawTableViewCell.m in Sources */
,
29360C2F1CDDC47E002A5D89
/* ScreeningView.m in Sources */
,
29360C2F1CDDC47E002A5D89
/* ScreeningView.m in Sources */
,
29E47BE01E8E42F2004D0D00
/* ToolHelper.m in Sources */
,
29A7A69F1DED1A9600B04272
/* prizeOrderDetailsModel.m in Sources */
,
29A7A69F1DED1A9600B04272
/* prizeOrderDetailsModel.m in Sources */
,
2985AEA21CE72F1500704C91
/* NSDictionary+ZXPUnicode.m in Sources */
,
2985AEA21CE72F1500704C91
/* NSDictionary+ZXPUnicode.m in Sources */
,
29498C601D053B7C004FA79B
/* ShoppingBagTableViewCell.m in Sources */
,
29498C601D053B7C004FA79B
/* ShoppingBagTableViewCell.m in Sources */
,
...
...
Lighting/AppDelegate.m
View file @
5cfe3c55
...
@@ -9,8 +9,7 @@
...
@@ -9,8 +9,7 @@
#import "AppDelegate.h"
#import "AppDelegate.h"
#import "LoginViewController.h"
#import "LoginViewController.h"
#import "DeviceDirectionManager.h"
#import "DeviceDirectionManager.h"
#import "UMMobClick/MobClick.h"
#import "ToolHelper.h"
#import <Bugly/Bugly.h>
@interface
AppDelegate
()
<
JPUSHRegisterDelegate
>
@interface
AppDelegate
()
<
JPUSHRegisterDelegate
>
...
@@ -22,11 +21,8 @@
...
@@ -22,11 +21,8 @@
-
(
BOOL
)
application
:(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:(
NSDictionary
*
)
launchOptions
{
-
(
BOOL
)
application
:(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:(
NSDictionary
*
)
launchOptions
{
// Override point for customization after application launch.
// Override point for customization after application launch.
[
Bugly
startWithAppId
:
@"900033734"
];
[
self
setUMShare
];
[
self
detectionNetwork
];
[
self
detectionNetwork
];
[
self
setIQKeyboardManager
];
[
self
rootViewcontroller
];
[
self
RootViewcontroller
];
[
self
setUpJPush
:
launchOptions
];
[
self
setUpJPush
:
launchOptions
];
return
YES
;
return
YES
;
}
}
...
@@ -70,7 +66,7 @@
...
@@ -70,7 +66,7 @@
return
result
;
return
result
;
}
}
#pragma mark -设置根视图
#pragma mark -设置根视图
-
(
void
)
R
ootViewcontroller
-
(
void
)
r
ootViewcontroller
{
{
LoginViewController
*
login
=
[[
BaseViewController
getMainStoryboardClass
]
instantiateViewControllerWithIdentifier
:
@"Login"
];
LoginViewController
*
login
=
[[
BaseViewController
getMainStoryboardClass
]
instantiateViewControllerWithIdentifier
:
@"Login"
];
self
.
window
.
rootViewController
=
login
;
self
.
window
.
rootViewController
=
login
;
...
@@ -84,15 +80,7 @@
...
@@ -84,15 +80,7 @@
[[
SDImageCache
sharedImageCache
]
setValue
:
nil
forKey
:
@"memCache"
];
[[
SDImageCache
sharedImageCache
]
setValue
:
nil
forKey
:
@"memCache"
];
}
}
#pragma mark - 键盘
-
(
void
)
setIQKeyboardManager
{
IQKeyboardManager
*
manager
=
[
IQKeyboardManager
sharedManager
];
[[
IQKeyboardManager
sharedManager
]
setKeyboardDistanceFromTextField
:
0
];
manager
.
enable
=
YES
;
manager
.
shouldResignOnTouchOutside
=
YES
;
manager
.
enableAutoToolbar
=
NO
;
}
#pragma mark -检测网络的可连接性
#pragma mark -检测网络的可连接性
...
@@ -130,20 +118,7 @@
...
@@ -130,20 +118,7 @@
}];
}];
}
}
#pragma mark - 友盟
-
(
void
)
setUMShare
{
[
MobClick
setLogEnabled
:
YES
];
// 友盟分享初始化
[
UMSocialData
setAppKey
:
@"574bc8fee0f55a4edb001078"
];
// 设置微信AppId、appSecret,分享url
[
UMSocialWechatHandler
setWXAppId
:
@"wxab385878d9441f23"
appSecret
:
@"58b85af13973bdf597fa807208ac0dff "
url
:
@"http://www.umeng.com/social"
];
// 设置微博的AppKey、appSecret,分享url
[
UMSocialSinaSSOHandler
openNewSinaSSOWithAppKey
:
@"1111393286"
secret
:
@"5d011c05122b5539ec9592372f944d3c"
RedirectURL
:
@"http://sns.whalecloud.com/sina2/callback"
];
UMConfigInstance
.
appKey
=
@"574bc8fee0f55a4edb001078"
;
UMConfigInstance
.
channelId
=
@"蒲公英"
;
[
MobClick
startWithConfigure
:
UMConfigInstance
];
}
#pragma mark -更新通知
#pragma mark -更新通知
...
...
Tools/ToolHelper/ToolHelper.h
0 → 100644
View file @
5cfe3c55
//
// ToolHelper.h
// Lighting
//
// Created by 曹云霄 on 2017/3/31.
// Copyright © 2017年 上海勾芒科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface
ToolHelper
:
NSObject
@end
Tools/ToolHelper/ToolHelper.m
0 → 100644
View file @
5cfe3c55
//
// ToolHelper.m
// Lighting
//
// Created by 曹云霄 on 2017/3/31.
// Copyright © 2017年 上海勾芒科技有限公司. All rights reserved.
//
#import "ToolHelper.h"
#import "UMMobClick/MobClick.h"
#import <Bugly/Bugly.h>
@implementation
ToolHelper
+
(
void
)
load
{
[[
self
class
]
setUpUMShare
];
[[
self
class
]
setUpBugly
];
[[
self
class
]
setKeyboard
];
}
#pragma mark - 友盟
+
(
void
)
setUpUMShare
{
[
MobClick
setLogEnabled
:
YES
];
// 友盟分享初始化
[
UMSocialData
setAppKey
:
@"574bc8fee0f55a4edb001078"
];
// 设置微信AppId、appSecret,分享url
[
UMSocialWechatHandler
setWXAppId
:
@"wxab385878d9441f23"
appSecret
:
@"58b85af13973bdf597fa807208ac0dff "
url
:
@"http://www.umeng.com/social"
];
// 设置微博的AppKey、appSecret,分享url
[
UMSocialSinaSSOHandler
openNewSinaSSOWithAppKey
:
@"1111393286"
secret
:
@"5d011c05122b5539ec9592372f944d3c"
RedirectURL
:
@"http://sns.whalecloud.com/sina2/callback"
];
UMConfigInstance
.
appKey
=
@"574bc8fee0f55a4edb001078"
;
UMConfigInstance
.
channelId
=
@"蒲公英"
;
[
MobClick
startWithConfigure
:
UMConfigInstance
];
}
#pragma mark - Bugly
+
(
void
)
setUpBugly
{
[
Bugly
startWithAppId
:
@"900033734"
];
}
#pragma mark - 键盘
+
(
void
)
setKeyboard
{
IQKeyboardManager
*
manager
=
[
IQKeyboardManager
sharedManager
];
[[
IQKeyboardManager
sharedManager
]
setKeyboardDistanceFromTextField
:
0
];
manager
.
enable
=
YES
;
manager
.
shouldResignOnTouchOutside
=
YES
;
manager
.
enableAutoToolbar
=
NO
;
}
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment