Skip to content

Commit 1643afc

Browse files
committed
tabBar fix , podfile fix
1 parent ff0dfce commit 1643afc

File tree

4 files changed

+48
-95
lines changed

4 files changed

+48
-95
lines changed

NJDouYu/NJDouYu.xcodeproj/project.pbxproj

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@
207207
58B36C1120AAFD8200915868 /* Frameworks */,
208208
58B36C1220AAFD8200915868 /* Resources */,
209209
F12B7AECA45FC8A1AD4A715E /* [CP] Embed Pods Frameworks */,
210-
295036422D05024FA373F88E /* [CP] Copy Pods Resources */,
211210
);
212211
buildRules = (
213212
);
@@ -226,8 +225,6 @@
226225
58B36C2420AAFD8200915868 /* Sources */,
227226
58B36C2520AAFD8200915868 /* Frameworks */,
228227
58B36C2620AAFD8200915868 /* Resources */,
229-
31DE935952F4536E4200F43E /* [CP] Embed Pods Frameworks */,
230-
094534B6611F4FB2F5E2E241 /* [CP] Copy Pods Resources */,
231228
);
232229
buildRules = (
233230
);
@@ -247,8 +244,6 @@
247244
58B36C2F20AAFD8200915868 /* Sources */,
248245
58B36C3020AAFD8200915868 /* Frameworks */,
249246
58B36C3120AAFD8200915868 /* Resources */,
250-
818B324E63FBDA22677F7A8F /* [CP] Embed Pods Frameworks */,
251-
06A8E6A6AADF795DCDA73DBC /* [CP] Copy Pods Resources */,
252247
);
253248
buildRules = (
254249
);
@@ -335,66 +330,6 @@
335330
/* End PBXResourcesBuildPhase section */
336331

337332
/* Begin PBXShellScriptBuildPhase section */
338-
06A8E6A6AADF795DCDA73DBC /* [CP] Copy Pods Resources */ = {
339-
isa = PBXShellScriptBuildPhase;
340-
buildActionMask = 2147483647;
341-
files = (
342-
);
343-
inputPaths = (
344-
);
345-
name = "[CP] Copy Pods Resources";
346-
outputPaths = (
347-
);
348-
runOnlyForDeploymentPostprocessing = 0;
349-
shellPath = /bin/sh;
350-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NJDouYuUITests/Pods-NJDouYuUITests-resources.sh\"\n";
351-
showEnvVarsInLog = 0;
352-
};
353-
094534B6611F4FB2F5E2E241 /* [CP] Copy Pods Resources */ = {
354-
isa = PBXShellScriptBuildPhase;
355-
buildActionMask = 2147483647;
356-
files = (
357-
);
358-
inputPaths = (
359-
);
360-
name = "[CP] Copy Pods Resources";
361-
outputPaths = (
362-
);
363-
runOnlyForDeploymentPostprocessing = 0;
364-
shellPath = /bin/sh;
365-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NJDouYuTests/Pods-NJDouYuTests-resources.sh\"\n";
366-
showEnvVarsInLog = 0;
367-
};
368-
295036422D05024FA373F88E /* [CP] Copy Pods Resources */ = {
369-
isa = PBXShellScriptBuildPhase;
370-
buildActionMask = 2147483647;
371-
files = (
372-
);
373-
inputPaths = (
374-
);
375-
name = "[CP] Copy Pods Resources";
376-
outputPaths = (
377-
);
378-
runOnlyForDeploymentPostprocessing = 0;
379-
shellPath = /bin/sh;
380-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NJDouYu/Pods-NJDouYu-resources.sh\"\n";
381-
showEnvVarsInLog = 0;
382-
};
383-
31DE935952F4536E4200F43E /* [CP] Embed Pods Frameworks */ = {
384-
isa = PBXShellScriptBuildPhase;
385-
buildActionMask = 2147483647;
386-
files = (
387-
);
388-
inputPaths = (
389-
);
390-
name = "[CP] Embed Pods Frameworks";
391-
outputPaths = (
392-
);
393-
runOnlyForDeploymentPostprocessing = 0;
394-
shellPath = /bin/sh;
395-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NJDouYuTests/Pods-NJDouYuTests-frameworks.sh\"\n";
396-
showEnvVarsInLog = 0;
397-
};
398333
3DF45AA19FB9EEE620EC16A8 /* [CP] Check Pods Manifest.lock */ = {
399334
isa = PBXShellScriptBuildPhase;
400335
buildActionMask = 2147483647;
@@ -413,21 +348,6 @@
413348
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
414349
showEnvVarsInLog = 0;
415350
};
416-
818B324E63FBDA22677F7A8F /* [CP] Embed Pods Frameworks */ = {
417-
isa = PBXShellScriptBuildPhase;
418-
buildActionMask = 2147483647;
419-
files = (
420-
);
421-
inputPaths = (
422-
);
423-
name = "[CP] Embed Pods Frameworks";
424-
outputPaths = (
425-
);
426-
runOnlyForDeploymentPostprocessing = 0;
427-
shellPath = /bin/sh;
428-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NJDouYuUITests/Pods-NJDouYuUITests-frameworks.sh\"\n";
429-
showEnvVarsInLog = 0;
430-
};
431351
877C833CAECBC0D3EB568E68 /* [CP] Check Pods Manifest.lock */ = {
432352
isa = PBXShellScriptBuildPhase;
433353
buildActionMask = 2147483647;

NJDouYu/NJDouYu/Classes/Main/NJTabBarController.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,28 @@
99
import UIKit
1010
import NJKit
1111

12-
class NJTabBarController: UITabBarController {
12+
public let kNJTabBarControllerDidSelectViewControllerNotification = "kNJTabBarControllerDidSelectViewControllerNotification"
13+
14+
class NJTabBarController: UITabBarController, UITabBarControllerDelegate {
1315

1416
override func viewDidLoad() {
1517
super.viewDidLoad()
18+
self.delegate = self
1619
addChildVcs()
1720
}
21+
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
22+
NotificationCenter.default.post(name: NSNotification.Name(rawValue: kNJTabBarControllerDidSelectViewControllerNotification), object: self, userInfo: ["viewController": viewController])
23+
}
24+
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
25+
return true
26+
}
1827
}
1928

2029
extension NJTabBarController {
2130
private func addChildVcs() -> Void {
31+
addChildVC(childController: NJTrendsViewController(), tabBartitle: "关注", image: "btn_live_normal", selImage: "btn_live_selected")
2232
addChildVC(childController: NJHomeViewController(), tabBartitle: "首页", image: "btn_home_normal", selImage: "btn_home_selected")
2333
addChildVC(childController: NJCategoryViewController(), tabBartitle: "分类", image: "btn_home_normal", selImage: "btn_home_selected")
24-
addChildVC(childController: NJTrendsViewController(), tabBartitle: "关注", image: "btn_live_normal", selImage: "btn_live_selected")
2534
addChildVC(childController: NJFishBarViewController(), tabBartitle: "鱼吧", image: "btn_live_normal", selImage: "btn_live_selected")
2635
addChildVC(childController: NJMeViewController(tableViewStyle: UITableViewStyle.grouped), tabBartitle: "我的", image: "btn_user_normal", selImage: "btn_user_selected")
2736
}
@@ -32,6 +41,8 @@ extension NJTabBarController {
3241
childController.tabBarItem.titlePositionAdjustment = UIOffset(horizontal: 0, vertical: -3);
3342
tabBar.unselectedItemTintColor = UIColor.lightGray
3443
tabBar.tintColor = UIColor.orange
44+
// 背景色
45+
// tabBar.barTintColor = UIColor.white
3546
addChildViewController(NJNavigationController(rootViewController: childController))
3647
}
3748
}

NJDouYu/NJDouYu/NJAppDelegate.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import UIKit
1010
import NJKit
11+
import NJMediator
1112

1213
@UIApplicationMain
1314
class NJAppDelegate: UIResponder, UIApplicationDelegate {
@@ -25,8 +26,15 @@ class NJAppDelegate: UIResponder, UIApplicationDelegate {
2526

2627
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
2728

29+
var shouldOpen = true
2830

29-
return true;
31+
_ = NJMediator.sharedMediator.perform(url: url) { (result: [String: AnyObject]?) in
32+
if result?["error"] != nil {
33+
shouldOpen = false
34+
}
35+
}
36+
37+
return shouldOpen
3038
}
3139
}
3240

NJDouYu/Podfile

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,37 @@ pod 'SDWebImage'
1010

1111
end
1212

13-
def njspec_pods
13+
def develop_local_pods
14+
pod 'NJKit', :path => '../../NJKit/'
15+
pod 'NJMediator', :path => '../../NJMediator/'
16+
pod 'DYTrends', :path => '../../DYTrends/'
17+
pod 'NJMediator_DYTrends', :path => '../../NJMediator_DYTrends/'
18+
end
19+
20+
def release_remote_pods
1421

15-
source 'https://github.com/NJHu/NJSpecs.git' # NJ 私有源
1622
pod 'NJKit'
17-
#pod 'NJKit', :path => '../../NJKit/'
18-
# pod 'DYTrends', :git => 'https://github.com/njhu/DYTrends.git', :branch => 'master'
23+
# pod 'NJKit', :git => 'https://github.com/njhu/NJKit.git'
24+
1925
pod 'DYTrends'
20-
#pod 'DYTrends', :path => '../../DYTrends/'
26+
# pod 'DYTrends', :git => 'https://github.com/njhu/DYTrends.git', :branch => 'master'
27+
2128
pod 'NJMediator_DYTrends'
22-
#pod 'NJMediator_DYTrends', :path => '../../NJMediator_DYTrends/'
23-
#pod 'DYIJKPlayerComponent', :git => '[email protected]:douyu-ios/DYIJKPlayerComponent.git', :commit => '610ec07e465c19a83e9a41d7dacfaa55b4248750' #'0.1.4' # 播放器组件
24-
#pod 'DYDanmakuDebug', '2.8.8' , :configuration => 'Debug' # 弹幕库 debug
25-
#pod 'DYDanmaku', '2.8.8', :configuration => 'Release' # 弹幕库 release
26-
#pod 'DYGambleBusinessKit', :path => '../DYGambleBusinessKit/'
27-
#pod 'DYStarMagicBusinessKit','0.1.2'
28-
# pod 'NJKit', :git => 'https://github.com/njhu/NJKit.git'
29+
end
30+
31+
def njspec_pods
32+
33+
source 'https://github.com/NJHu/NJSpecs.git' # NJ 私有源
34+
35+
#develop_local_pods
36+
37+
release_remote_pods
38+
39+
#pod 'xxx', :git => '[email protected]:douyu-ios/DYIJKPlayerComponent.git', :commit => '610ec07e465c19a83e9a41d7dacfaa55b4248750' #'0.1.4' # 播放器组件
2940

41+
#pod 'DYDanmakuDebug', '2.8.8' , :configuration => 'Debug' # 弹幕库 debug
42+
#pod 'DYDanmaku', '2.8.8', :configuration => 'Release' # 弹幕库 release
43+
#pod 'DYStarMagicBusinessKit','0.1.2'
3044
end
3145

3246

0 commit comments

Comments
 (0)