-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
87 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...BarTransition.xcodeproj/xcshareddata/xcschemes/KMNavigationBarTransition-Example.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1200" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "CDA3726E1C3907CE00E39A6D" | ||
BuildableName = "KMNavigationBarTransition-Example.app" | ||
BlueprintName = "KMNavigationBarTransition-Example" | ||
ReferencedContainer = "container:KMNavigationBarTransition.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "CDA3726E1C3907CE00E39A6D" | ||
BuildableName = "KMNavigationBarTransition-Example.app" | ||
BlueprintName = "KMNavigationBarTransition-Example" | ||
ReferencedContainer = "container:KMNavigationBarTransition.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "CDA3726E1C3907CE00E39A6D" | ||
BuildableName = "KMNavigationBarTransition-Example.app" | ||
BlueprintName = "KMNavigationBarTransition-Example" | ||
ReferencedContainer = "container:KMNavigationBarTransition.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57e0c19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大兄弟这是什么奇淫思路 学习一下😂
57e0c19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
主要是看了下 iOS 14
_isInnerNavigationBarOfNestedNavigationController
的实现,else 分支里是拿_accessibility_navigationController._outermostNavigationController.navigationBar.topItem
和customNavigationBar.topItem
做比较,然后两个都是 nil,所以返回了 YES。结合这个方法的意图,我觉得问题出在没有判空。57e0c19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大哥🐂🍺,
昨天和我的小伙伴讨论了很久这个问题的排查思路和根据你提供的方法去找线索,感觉有点收获,多向优秀的人学习自己才能变优秀哈哈😄。
感谢。
57e0c19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大佬过奖了,互相学习。🤝
57e0c19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段话意思是_accessibility_navigationController._outermostNavigationController.navigationBar.topItem 和 customNavigationBar.topItem 两个都是 nil,iOS14系统返回了NO。但其实两个都是 nil时也要返回YES的,对吗?
57e0c19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iOS 14 在 navigation bar 布局的时候多了个判断
_isInnerNavigationBarOfNestedNavigationController
,这个方法得返回 NO,这样 navigation bar 的 subviews 才会加载。然后由于
_accessibility_navigationController._outermostNavigationController.navigationBar.topItem
和customNavigationBar.topItem
都是 nil,指针比较返回了 YES,最终导致自定义 navigation bar 的 subviews 没有被加载。然后结合这个方法命名的含义,既然
accessibilityNavigationController
返回的是 nil,那这个方法就应该返回 NO 才对,所以我认为是苹果的 bug,没有判空。57e0c19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请问这个源码是在哪里能看到>_<
57e0c19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
逆向出来的。