Skip to content

Commit

Permalink
docs: 更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
l1Dan committed Sep 30, 2024
1 parent b534492 commit 83e5454
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 56 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# CHANGELOG.md

## 4.2.5
1、适配 Xcode16、Swift 6

## 4.2.4

Fixed: [手指在屏幕左边边缘往右滑动不能正确跳转下一个页面](https://github.com/l1Dan/NXNavigationExtension/issues/26)

## 4.2.3
Expand Down Expand Up @@ -282,7 +286,7 @@ NXNavigationBar 可以跟随系统导航栏的显示隐藏。虽然不推荐使
## 3.4.2

之前使用 UIViewController 的 `edgesForExtendedLayout` 属性会导致导航栏往下移动,这也就是 `README.md` 文档中提到不要使用 `edgesForExtendedLayout` 属性的原因,现在该问题已经修复。详细信息查看:
[示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController06_WebView.swift)
[示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController06_WebView.swift)

- 修改: README.md 文件;
- 示例代码优化。
Expand Down
36 changes: 18 additions & 18 deletions Documentation/NXNavigationExtensionSwiftUI.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct ContentView: View {

#### 修改返回按钮箭头颜色

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Advanced/View07_UpdateNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Advanced/View07_UpdateNavigationBar.swift)

```swift
Text("Destination")
Expand All @@ -102,7 +102,7 @@ Text("Destination")

#### 修改系统返回按钮文字

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Advanced/View07_UpdateNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Advanced/View07_UpdateNavigationBar.swift)

```swift
Text("Destination")
Expand All @@ -114,7 +114,7 @@ Text("Destination")

#### 修改导航栏标题颜色

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Advanced/View07_UpdateNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Advanced/View07_UpdateNavigationBar.swift)

```swift
Text("Destination")
Expand All @@ -127,7 +127,7 @@ Text("Destination")

**导航栏背景颜色默认使用系统蓝色 `UIColor.systemBlue`,这样处理能够快速辨别框架是否生效,也可以使用以下方式进行重写:**

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View01_BackgroundColor.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View01_BackgroundColor.swift)

```swift
// 全局统一修改
Expand All @@ -143,7 +143,7 @@ Text("Destination")

#### 修改导航栏背景图片

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View02_BackgrounddImage.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View02_BackgrounddImage.swift)

```swift
Text("Destination")
Expand All @@ -154,7 +154,7 @@ Text("Destination")

#### 设置导航栏透明

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View03_Transparent.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View03_Transparent.swift)

```swift
Text("Destination")
Expand All @@ -166,7 +166,7 @@ Text("Destination")

#### 实现系统导航栏模糊效果

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View04_LikeSystemNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View04_LikeSystemNavigationBar.swift)

```swift
Text("Destination")
Expand All @@ -178,7 +178,7 @@ Text("Destination")

#### 设置导航栏底部阴影颜色

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View05_ShadowColor.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View05_ShadowColor.swift)

```swift
Text("Destination")
Expand All @@ -190,7 +190,7 @@ Text("Destination")

#### 设置导航栏底部阴影图片

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View06_ShadowImage.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View06_ShadowImage.swift)

```swift
Text("Destination")
Expand All @@ -202,7 +202,7 @@ Text("Destination")

#### 自定义返回按钮图片

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View07_CustomBackImage.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View07_CustomBackImage.swift)

```swift
Text("Destination")
Expand All @@ -213,7 +213,7 @@ Text("Destination")

#### 自定义返回按钮

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View08_CustomBackView.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View08_CustomBackView.swift)

```swift
Text("Destination")
Expand All @@ -228,7 +228,7 @@ Text("Destination")

#### 禁用右滑手势返回

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Advanced/View01_EdgePopGestureDisable.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Advanced/View01_EdgePopGestureDisable.swift)

```swift
Text("Destination")
Expand All @@ -242,7 +242,7 @@ Text("Destination")

#### 启用全屏右滑手势返回

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View02_FullScreenPopGestureEnable.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View02_FullScreenPopGestureEnable.swift)

- 全局有效

Expand All @@ -262,7 +262,7 @@ Text("Destination")

#### 导航栏返回事件拦截

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View03_BackButtonEventIntercept.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View03_BackButtonEventIntercept.swift)

1. `.callingNXPopMethod`: 调用 `nx_pop` 系列方法返回事件拦截。
2. `.clickBackButton`: 点击返回按钮返回事件拦截。
Expand All @@ -286,7 +286,7 @@ Text("Destination")

#### SwiftUI 路由

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Basic/View08_NavigationRouter.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Basic/View08_NavigationRouter.swift)

```swift
struct DestinationView: View {
Expand Down Expand Up @@ -314,7 +314,7 @@ struct DestinationView: View {

#### 导航栏点击事件穿透到底部

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Advanced/View05_NavigationBarDisable.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Advanced/View05_NavigationBarDisable.swift)

```swift
Text("Destination")
Expand All @@ -325,7 +325,7 @@ Text("Destination")

#### 更新导航栏样式

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Advanced/View07_UpdateNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Advanced/View07_UpdateNavigationBar.swift)

```swift
Button {
Expand All @@ -337,7 +337,7 @@ Button {

#### 长按返回按钮显示菜单功能

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionSwiftUIDemo/SwiftUI/Advanced/View08_NavigationRouter.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/SwiftUI/Advanced/View08_NavigationRouter.swift)

```swift
Text("Destination")
Expand Down
36 changes: 18 additions & 18 deletions Documentation/NXNavigationExtensionUIKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ NXNavigationConfiguration().registerNavigationControllerClasses([UINavigationCon

#### 修改返回按钮箭头颜色

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController07_UpdateNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController07_UpdateNavigationBar.swift)

```swift
override var nx_barTintColor: UIColor? {
Expand All @@ -81,7 +81,7 @@ override var nx_barTintColor: UIColor? {

#### 修改系统返回按钮文字

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController07_UpdateNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController07_UpdateNavigationBar.swift)

```swift
// 需要设置使用系统返回按钮,这样才会有效果
Expand All @@ -96,7 +96,7 @@ override var nx_systemBackButtonTitle: String? {

#### 修改导航栏标题颜色

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController07_UpdateNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController07_UpdateNavigationBar.swift)

```swift
override var nx_titleTextAttributes: [NSAttributedString.Key : Any]? {
Expand All @@ -108,7 +108,7 @@ override var nx_titleTextAttributes: [NSAttributedString.Key : Any]? {

**导航栏背景颜色默认使用系统蓝色 `UIColor.systemBlue`,这样处理能够快速辨别框架是否生效,也可以使用以下方式进行重写:**

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Basic/ViewController01_BackgroundColor.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Basic/ViewController01_BackgroundColor.swift)

```swift
// 全局统一修改(不会覆盖基于视图控制器的修改)
Expand All @@ -123,7 +123,7 @@ override var nx_navigationBarBackgroundColor: UIColor? {

#### 修改导航栏背景图片

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Basic/ViewController02_BackgroundImage.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Basic/ViewController02_BackgroundImage.swift)

```swift
override var nx_navigationBarBackgroundImage: UIImage? {
Expand All @@ -133,7 +133,7 @@ override var nx_navigationBarBackgroundImage: UIImage? {

#### 设置导航栏透明

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Basic/ViewController03_Transparent.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Basic/ViewController03_Transparent.swift)

```swift
override var nx_navigationBarBackgroundColor: UIColor? {
Expand All @@ -148,7 +148,7 @@ override var nx_shadowColor: UIColor? {

#### 实现系统导航栏模糊效果

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Basic/ViewController04_LikeSystemNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Basic/ViewController04_LikeSystemNavigationBar.swift)

```swift
override var nx_navigationBarBackgroundColor: UIColor? {
Expand All @@ -162,7 +162,7 @@ override var nx_useBlurNavigationBar: Bool {

#### 设置导航栏底部阴影颜色

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Basic/ViewController05_ShadowColor.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Basic/ViewController05_ShadowColor.swift)

```swift
override var nx_shadowColor: UIColor? {
Expand All @@ -172,7 +172,7 @@ override var nx_shadowColor: UIColor? {

#### 设置导航栏底部阴影图片

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Basic/ViewController06_ShadowImage.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Basic/ViewController06_ShadowImage.swift)

```swift
override var nx_shadowImage: UIImage? {
Expand All @@ -182,7 +182,7 @@ override var nx_shadowImage: UIImage? {

#### 自定义返回按钮图片

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Basic/ViewController07_CustomBackImage.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Basic/ViewController07_CustomBackImage.swift)

```swift
override var nx_backImage: UIImage? {
Expand All @@ -192,7 +192,7 @@ override var nx_backImage: UIImage? {

#### 自定义返回按钮

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Basic/ViewController08_CustomBackView.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Basic/ViewController08_CustomBackView.swift)

```swift
override var nx_backButtonCustomView: UIView? {
Expand All @@ -206,7 +206,7 @@ override var nx_backButtonCustomView: UIView? {

#### 禁用右滑手势返回

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController01_EdgePopGestureDisable.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController01_EdgePopGestureDisable.swift)

```swift
func nx_navigationTransition(_ transitionViewController: UIViewController, navigationBackAction action: NXNavigationBackAction) -> Bool {
Expand All @@ -219,7 +219,7 @@ func nx_navigationTransition(_ transitionViewController: UIViewController, navig

#### 启用全屏右滑手势返回

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController02_FullScreenPopGestureEnable.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController02_FullScreenPopGestureEnable.swift)

- 局部有效(在所处页面设置)

Expand All @@ -238,7 +238,7 @@ configuration.viewControllerPreferences.enableFullScreenInteractivePopGesture =

#### 设置导航栏隐藏(并不是真的隐藏,只是看起来隐藏了,整个导航栏区域不能处理用户交互)

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController05_NavigationBarDisable.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController05_NavigationBarDisable.swift)

```swift
// 此操作会将导航栏的背景设置为透明、导航栏所在区域的底部能够接收到点击事件、返回按钮也将不存在。
Expand All @@ -251,7 +251,7 @@ override var nx_translucentNavigationBar: Bool {

#### 禁用**系统**导航栏用户交互(NXNavigationBar 可以处理用户交互)

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController09_ScrollChangeNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController09_ScrollChangeNavigationBar.swift)

```swift
override var systemNavigationBarUserInteractionDisabled: Bool {
Expand All @@ -261,7 +261,7 @@ override var systemNavigationBarUserInteractionDisabled: Bool {

#### 更新导航栏样式

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController07_UpdateNavigationBar.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController07_UpdateNavigationBar.swift)

```swift
nx_setNeedsNavigationBarAppearanceUpdate()
Expand All @@ -281,7 +281,7 @@ override var childForStatusBarHidden: UIViewController? {

#### 导航栏返回事件拦截

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController03_BackButtonEventIntercept.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController03_BackButtonEventIntercept.swift)

需要遵守协议 `<NXNavigationTransitionDelegate>`,实现代理方法:

Expand Down Expand Up @@ -341,7 +341,7 @@ func nx_navigationTransition(_ transitionViewController: UIViewController, navig

#### 长按返回按钮显示菜单功能

📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/Shared/UIKit/Advanced/ViewController03_BackButtonEventIntercept.swift)
📝 [示例代码](https://github.com/l1Dan/NXNavigationExtension/blob/main/Examples/NXNavigationExtensionDemo/UIKit/Advanced/ViewController03_BackButtonEventIntercept.swift)

```swift
override var nx_useSystemBackButton: Bool {
Expand Down
Loading

0 comments on commit 83e5454

Please sign in to comment.