Skip to content

Commit edbd8e7

Browse files
committed
Fix
1 parent a052739 commit edbd8e7

File tree

7 files changed

+280
-252
lines changed

7 files changed

+280
-252
lines changed

Example/Podfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
WRNavigationBar_swift: ec68cfa6759f2f2a3815412ddca899ec2c7b17b5
12+
WRNavigationBar_swift: 2aa357390ecb7e3cc50dffb0b82c338e1dffad63
1313

1414
PODFILE CHECKSUM: b9c9e56e2153483fea864e416272c298196d42b7
1515

Example/Pods/Local Podspecs/WRNavigationBar_swift.podspec.json

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/project.pbxproj

+260-231
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/WRNavigationBar_swift.xcodeproj/project.pbxproj

+6-4
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,12 @@
287287
TargetAttributes = {
288288
607FACCF1AFB9204008FA782 = {
289289
CreatedOnToolsVersion = 6.3.1;
290+
DevelopmentTeam = P3X2725LYY;
290291
LastSwiftMigration = 0900;
291292
};
292293
607FACE41AFB9204008FA782 = {
293294
CreatedOnToolsVersion = 6.3.1;
295+
DevelopmentTeam = P3X2725LYY;
294296
LastSwiftMigration = 0900;
295297
TestTargetID = 607FACCF1AFB9204008FA782;
296298
};
@@ -565,7 +567,7 @@
565567
baseConfigurationReference = 3C739D7B7E47049E273E27D6 /* Pods-WRNavigationBar_swift_Example.debug.xcconfig */;
566568
buildSettings = {
567569
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
568-
DEVELOPMENT_TEAM = "";
570+
DEVELOPMENT_TEAM = P3X2725LYY;
569571
INFOPLIST_FILE = WRNavigationBar_swift/Info.plist;
570572
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
571573
MODULE_NAME = ExampleApp;
@@ -581,7 +583,7 @@
581583
baseConfigurationReference = 1CE6177B91612B092B9820D6 /* Pods-WRNavigationBar_swift_Example.release.xcconfig */;
582584
buildSettings = {
583585
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
584-
DEVELOPMENT_TEAM = "";
586+
DEVELOPMENT_TEAM = P3X2725LYY;
585587
INFOPLIST_FILE = WRNavigationBar_swift/Info.plist;
586588
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
587589
MODULE_NAME = ExampleApp;
@@ -596,7 +598,7 @@
596598
isa = XCBuildConfiguration;
597599
baseConfigurationReference = 95AD45F4B1519FF22CE4A582 /* Pods-WRNavigationBar_swift_Tests.debug.xcconfig */;
598600
buildSettings = {
599-
DEVELOPMENT_TEAM = "";
601+
DEVELOPMENT_TEAM = P3X2725LYY;
600602
FRAMEWORK_SEARCH_PATHS = (
601603
"$(SDKROOT)/Developer/Library/Frameworks",
602604
"$(inherited)",
@@ -619,7 +621,7 @@
619621
isa = XCBuildConfiguration;
620622
baseConfigurationReference = 8A798F447A512F554761A078 /* Pods-WRNavigationBar_swift_Tests.release.xcconfig */;
621623
buildSettings = {
622-
DEVELOPMENT_TEAM = "";
624+
DEVELOPMENT_TEAM = P3X2725LYY;
623625
FRAMEWORK_SEARCH_PATHS = (
624626
"$(SDKROOT)/Developer/Library/Frameworks",
625627
"$(inherited)",

WRNavigationBar_swift.podspec

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ WRNavigationBar which allows you to change NavigationBar's appearance dynamicall
1010
s.homepage = 'https://github.com/wangrui460/WRNavigationBar_swift'
1111
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
1212
s.license = { :type => 'MIT', :file => 'LICENSE' }
13-
s.author = { 'EyreFree' => 'eyrefree@eyrefree.org' }
13+
s.author = { 'wangrui460' => 'wangruidev@gmail.com' }
1414
s.source = { :git => 'https://github.com/wangrui460/WRNavigationBar_swift.git', :tag => s.version.to_s }
1515
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
1616

17+
s.swift_version = "4.2"
1718
s.ios.deployment_target = '8.0'
1819

1920
s.source_files = 'WRNavigationBar_swift/Classes/**/*'

WRNavigationBar_swift/Classes/WRCustomNavigationBar.swift

+8-13
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,15 @@ public extension UIViewController
4646
}
4747
}
4848

49-
class func wr_currentViewController(from fromVC:UIViewController) -> UIViewController
49+
class func wr_currentViewController(from fromVC: UIViewController) -> UIViewController
5050
{
51-
if fromVC.isKind(of: UINavigationController.self) {
52-
let navigationController = fromVC as! UINavigationController
53-
return wr_currentViewController(from: navigationController.viewControllers.last!)
54-
}
55-
else if fromVC.isKind(of: UITabBarController.self) {
56-
let tabBarController = fromVC as! UITabBarController
57-
return wr_currentViewController(from: tabBarController.selectedViewController!)
58-
}
59-
else if fromVC.presentedViewController != nil {
60-
return wr_currentViewController(from:fromVC.presentingViewController!)
61-
}
62-
else {
51+
if let navigationController = fromVC as? UINavigationController, let subViewController = navigationController.viewControllers.last {
52+
return wr_currentViewController(from: subViewController)
53+
} else if let tabBarController = fromVC as? UITabBarController, let subViewController = tabBarController.selectedViewController {
54+
return wr_currentViewController(from: subViewController)
55+
} else if let presentedViewController = fromVC.presentedViewController {
56+
return wr_currentViewController(from: presentedViewController)
57+
} else {
6358
return fromVC
6459
}
6560
}

0 commit comments

Comments
 (0)