CleanyModal 开源项目教程

CleanyModal 开源项目教程

CleanyModalSwift UI Kit to present clean modal/alert项目地址:https://gitcode.com/gh_mirrors/cl/CleanyModal

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

CleanyModal 项目的目录结构如下:

CleanyModal/
├── CleanyModal/
│   ├── Assets/
│   │   └── Images.xcassets/
│   ├── Controllers/
│   │   └── CleanyModalViewController.swift
│   ├── Extensions/
│   │   └── UIViewController+CleanyModal.swift
│   ├── Models/
│   │   └── CleanyAlertConfig.swift
│   ├── Views/
│   │   └── CleanyAlertViewController.swift
│   └── CleanyModal.swift
├── Example/
│   ├── Example/
│   │   ├── AppDelegate.swift
│   │   ├── Assets.xcassets/
│   │   ├── Base.lproj/
│   │   ├── Info.plist
│   │   ├── SceneDelegate.swift
│   │   └── ViewController.swift
│   ├── Example.xcodeproj/
│   └── ExampleTests/
├── LICENSE
├── README.md
└── CleanyModal.podspec

目录结构介绍

  • CleanyModal/: 核心代码目录,包含了项目的所有源文件。

    • Assets/: 存放项目所需的资源文件,如图片等。
    • Controllers/: 存放控制器文件,如 CleanyModalViewController.swift
    • Extensions/: 存放扩展文件,如 UIViewController+CleanyModal.swift
    • Models/: 存放模型文件,如 CleanyAlertConfig.swift
    • Views/: 存放视图文件,如 CleanyAlertViewController.swift
    • CleanyModal.swift: 项目的主文件。
  • Example/: 示例项目目录,展示了如何使用 CleanyModal。

    • Example/: 示例项目的源文件。
    • Example.xcodeproj/: 示例项目的 Xcode 工程文件。
    • ExampleTests/: 示例项目的测试文件。
  • LICENSE: 项目的许可证文件。

  • README.md: 项目的说明文档。

  • CleanyModal.podspec: 项目的 CocoaPods 规格文件。

2. 项目的启动文件介绍

CleanyModal 项目的启动文件位于 Example/Example/AppDelegate.swiftExample/Example/SceneDelegate.swift

AppDelegate.swift

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        return true
    }

    // Other methods...
}

SceneDelegate.swift

import UIKit

@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {

    var window: UIWindow?

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
        // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
        // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
        guard let _ = (scene as? UIWindowScene) else { return }
    }

    // Other methods...
}

3. 项目的配置文件介绍

CleanyModal 项目的配置文件主要位于 Example/Example/Info.plist

Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>

CleanyModalSwift UI Kit to present clean modal/alert项目地址:https://gitcode.com/gh_mirrors/cl/CleanyModal

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

井队湛Heath

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

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

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

打赏作者

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

抵扣说明:

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

余额充值