SystemNotification 开源项目教程

SystemNotification 开源项目教程

SystemNotificationSystemNotification is a SwiftUI library that lets you mimic the native iOS system notification. It supports extensive styling, custom views and can be used on all major Apple platforms. 项目地址:https://gitcode.com/gh_mirrors/sy/SystemNotification

1. 项目的目录结构及介绍

SystemNotification 项目的目录结构如下:

SystemNotification/
├── Demo/
│   ├── Demo/
│   └── Fastlane/
├── Resources/
├── Sources/
│   └── SystemNotification/
├── Tests/
│   └── SystemNotificationTests/
├── .gitignore
├── .swiftlint.yml
├── LICENSE
├── Package.swift
├── README.md
├── RELEASE_NOTES.md
└── Version

目录介绍

  • Demo/: 包含演示项目的相关文件。
    • Demo/: 演示项目的主要代码。
    • Fastlane/: 用于自动化部署的 Fastlane 配置文件。
  • Resources/: 项目资源文件。
  • Sources/: 项目源代码。
    • SystemNotification/: SystemNotification SDK 的主要源代码。
  • Tests/: 项目测试代码。
    • SystemNotificationTests/: SystemNotification SDK 的测试代码。
  • .gitignore: Git 忽略文件配置。
  • .swiftlint.yml: SwiftLint 配置文件。
  • LICENSE: 项目许可证文件。
  • Package.swift: Swift 包管理器配置文件。
  • README.md: 项目说明文档。
  • RELEASE_NOTES.md: 版本发布说明。
  • Version: 项目版本文件。

2. 项目的启动文件介绍

SystemNotification 项目的启动文件是 Package.swift,这是一个 Swift 包管理器的配置文件。它定义了项目的名称、依赖关系、目标和产品等信息。

// swift-tools-version:5.3
import PackageDescription

let package = Package(
    name: "SystemNotification",
    platforms: [
        .iOS(.v13),
        .macOS(.v10_15),
        .tvOS(.v13),
        .watchOS(.v6)
    ],
    products: [
        .library(
            name: "SystemNotification",
            targets: ["SystemNotification"]
        )
    ],
    dependencies: [],
    targets: [
        .target(
            name: "SystemNotification",
            dependencies: []
        ),
        .testTarget(
            name: "SystemNotificationTests",
            dependencies: ["SystemNotification"]
        )
    ]
)

启动文件介绍

  • name: 项目名称。
  • platforms: 支持的平台。
  • products: 项目产品,这里是一个库。
  • dependencies: 项目依赖。
  • targets: 项目目标,包括主目标和测试目标。

3. 项目的配置文件介绍

SystemNotification 项目的配置文件主要包括 .swiftlint.ymlPackage.swift

.swiftlint.yml

.swiftlint.yml 是 SwiftLint 的配置文件,用于代码风格和规范的检查。

disabled_rules:
  - line_length
  - trailing_whitespace
  - trailing_comma
  - identifier_name
  - cyclomatic_complexity
  - function_body_length
  - type_body_length
  - file_length
  - nesting
  - todo
  - vertical_whitespace
  - opening_brace
  - closing_brace
  - colon
  - comma
  - semicolon
  - type_name
  - variable_name
  - force_cast
  - force_try
  - force_unwrapping
  - empty_count
  - empty_string
  - empty_enum_arguments
  - empty_parameters
  - empty_parentheses_with_trailing_closure
  - empty_cases
  - empty_struct_contents
  - empty_class_contents
  - empty_enum_contents
  - empty_protocol_contents
  - empty_extension_contents
  - empty_dictionary_contents
  - empty_array_contents
  - empty_set_contents
  - empty_closure_contents
  - empty_function_contents
  - empty_return
  - empty_arguments
  - empty_body
  - empty_result
  - empty_value
  - empty_type
  - empty_name
  - empty_description
  - empty_title
  - empty_message
  - empty_subtitle
  - empty_caption
  - empty_summary

SystemNotificationSystemNotification is a SwiftUI library that lets you mimic the native iOS system notification. It supports extensive styling, custom views and can be used on all major Apple platforms. 项目地址:https://gitcode.com/gh_mirrors/sy/SystemNotification

  • 22
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

卓艾滢Kingsley

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值