Commit c3aaab718a419e5349b30a52c1c295b20dc3274b
1 parent
a64ef776
no message
Showing
4 changed files
with
20 additions
and
9 deletions
CNLiveIntegralModule.podspec
| @@ -62,7 +62,7 @@ TODO: 网家家-积分模块. | @@ -62,7 +62,7 @@ TODO: 网家家-积分模块. | ||
| 62 | end | 62 | end |
| 63 | 63 | ||
| 64 | s.resource_bundles = { | 64 | s.resource_bundles = { |
| 65 | - 'CNLiveIntegralModule' => ['CNLiveIntegralModule/Assets/CNLiveIntegralModule.xcassets'] | 65 | + 'CNLiveIntegralModule' => ['CNLiveIntegralModule/Assets/CNLiveIntegralModule.xcassets','CNLiveIntegralModule/Assets/gold_whereabouts.mp3'] |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | # s.public_header_files = 'Pod/Classes/**/*.h' | 68 | # s.public_header_files = 'Pod/Classes/**/*.h' |
CNLiveIntegralModule/Assets/gold_whereabouts.mp3
0 → 100755
No preview for this file type
CNLiveIntegralModule/Classes/Tools/CNLiveGoldWhereaboutsView.m
| @@ -107,7 +107,11 @@ | @@ -107,7 +107,11 @@ | ||
| 107 | // [audioSession setActive:YES error:nil]; | 107 | // [audioSession setActive:YES error:nil]; |
| 108 | // } | 108 | // } |
| 109 | // } | 109 | // } |
| 110 | - NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"gold_whereabouts" ofType:@"mp3"]]; | 110 | + |
| 111 | + NSBundle *bundle = [NSBundle bundleForClass:[self class]]; | ||
| 112 | + NSURL *bundleUrl = [bundle URLForResource:@"CNLiveIntegralModule" withExtension:@"bundle"]; | ||
| 113 | + NSBundle *targetBundle = [NSBundle bundleWithURL:bundleUrl]; | ||
| 114 | + NSURL *url = [NSURL fileURLWithPath:[targetBundle pathForResource:@"gold_whereabouts" ofType:@"mp3"]]; | ||
| 111 | __block AVAudioPlayer *soundPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:nil]; | 115 | __block AVAudioPlayer *soundPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:nil]; |
| 112 | if (!(sounds && [sounds isEqualToString:@"1"])) {//0有声音 | 116 | if (!(sounds && [sounds isEqualToString:@"1"])) {//0有声音 |
| 113 | soundPlayer.volume = 0.5;//0.0~1.0之间 | 117 | soundPlayer.volume = 0.5;//0.0~1.0之间 |
Example/CNLiveIntegralModule/CNLIVEAppDelegate.m
| @@ -9,21 +9,28 @@ | @@ -9,21 +9,28 @@ | ||
| 9 | #import "CNLIVEAppDelegate.h" | 9 | #import "CNLIVEAppDelegate.h" |
| 10 | #import "CNLiveEnvironment.h" | 10 | #import "CNLiveEnvironment.h" |
| 11 | #import "CNLiveTaskListController.h" | 11 | #import "CNLiveTaskListController.h" |
| 12 | +#import "CNLiveGoldWhereaboutsView.h" | ||
| 12 | 13 | ||
| 13 | @implementation CNLIVEAppDelegate | 14 | @implementation CNLIVEAppDelegate |
| 14 | 15 | ||
| 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions |
| 16 | { | 17 | { |
| 17 | // Override point for customization after application launch. | 18 | // Override point for customization after application launch. |
| 18 | - [CNLiveEnvironmentManager setEnvironment:CNLiveDebugAppStore]; | ||
| 19 | - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | ||
| 20 | - CNLiveTaskListController *vc = [[CNLiveTaskListController alloc] init]; | ||
| 21 | - // vc.jump_URL = @"http://www.baidu.com"; | ||
| 22 | - UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; | 19 | + |
| 20 | + [CNLiveEnvironmentManager setEnvironment:CNLiveDebugAppStore]; | ||
| 21 | + | ||
| 22 | + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | ||
| 23 | + | ||
| 24 | + CNLiveTaskListController *vc = [[CNLiveTaskListController alloc] init]; | ||
| 25 | + | ||
| 26 | + UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; | ||
| 23 | 27 | ||
| 24 | - self.window.rootViewController = nav;//设置根视图控制器 | ||
| 25 | 28 | ||
| 26 | - [self.window makeKeyAndVisible]; | 29 | + self.window.rootViewController = nav;//设置根视图控制器 |
| 30 | + | ||
| 31 | + | ||
| 32 | + [self.window makeKeyAndVisible]; | ||
| 33 | + [CNLiveGoldWhereaboutsView showGoldWhereaboutsViewWithDesc:@"asd" delegate:self]; | ||
| 27 | return YES; | 34 | return YES; |
| 28 | } | 35 | } |
| 29 | 36 |