Aperture 开源项目教程
ApertureRecord the screen on macOS项目地址:https://gitcode.com/gh_mirrors/ap/Aperture
1. 项目的目录结构及介绍
Aperture 项目的目录结构如下:
Aperture/
├── .github/
│ └── workflows/
├── Aperture/
│ ├── Assets/
│ ├── Controllers/
│ ├── Models/
│ ├── Views/
│ ├── AppDelegate.swift
│ ├── Info.plist
│ └── Main.storyboard
├── ApertureCLI/
│ ├── Sources/
│ ├── Package.swift
│ └── README.md
├── Documentation/
│ └── README.md
├── Tests/
│ ├── ApertureTests/
│ └── ApertureCLITests/
├── .gitignore
├── .swift-version
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
└── SECURITY.md
目录结构介绍
.github/workflows/
: 存放 GitHub Actions 的工作流配置文件。Aperture/
: 项目的主要代码目录,包含应用的资源、控制器、模型和视图。ApertureCLI/
: 命令行工具的代码目录。Documentation/
: 项目文档目录。Tests/
: 测试代码目录。.gitignore
: Git 忽略文件配置。.swift-version
: 指定 Swift 版本。CODE_OF_CONDUCT.md
: 行为准则。CONTRIBUTING.md
: 贡献指南。LICENSE
: 许可证文件。README.md
: 项目主文档。SECURITY.md
: 安全指南。
2. 项目的启动文件介绍
Aperture 项目的启动文件是 Aperture/AppDelegate.swift
。这个文件是 iOS 应用的入口点,负责应用的生命周期管理。
import Cocoa
@main
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
}
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
}
启动文件介绍
AppDelegate.swift
: 包含应用的启动和终止逻辑。applicationDidFinishLaunching(_:)
: 应用启动后调用的方法。applicationWillTerminate(_:)
: 应用终止前调用的方法。
3. 项目的配置文件介绍
Aperture 项目的配置文件主要是 Aperture/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>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSRequiresAquaSystemAppearance</key>
ApertureRecord the screen on macOS项目地址:https://gitcode.com/gh_mirrors/ap/Aperture