马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
iOS-Viper-Architecture 项目教程
iOS-Viper-ArchitectureThis repository contains a detailed sample app that implements VIPER architecture in iOS using libraries and frameworks like Alamofire, AlamofireImage, PKHUD, CoreData etc.项目地点:https://gitcode.com/gh_mirrors/ios/iOS-Viper-Architecture
1. 项目的目次结构及介绍
- iOS-Viper-Architecture/
- ├── Application/
- │ ├── AppDelegate.swift
- │ └── MainWireframe.swift
- ├── Modules/
- │ ├── Home/
- │ │ ├── Contracts/
- │ │ ├── Interactor/
- │ │ ├── Presenter/
- │ │ ├── Protocols/
- │ │ ├── Router/
- │ │ └── View/
- │ └── Detail/
- │ ├── Contracts/
- │ ├── Interactor/
- │ ├── Presenter/
- │ ├── Protocols/
- │ ├── Router/
- │ └── View/
- ├── Resources/
- │ ├── Assets.xcassets
- │ ├── Info.plist
- │ └── LaunchScreen.storyboard
- └── Supporting Files/
- └── main.swift
复制代码 目次结构介绍
- Application: 包罗应用的入口文件和主要配置文件。
- AppDelegate.swift: 应用的入口和生命周期管理。
- MainWireframe.swift: 应用的主要路由和初始化配置。
- Modules: 包罗应用的主要功能模块,每个模块都遵照 VIPER 架构。
- Home: 主页模块。
- Detail: 详情页模块。
- Resources: 包罗应用的资源文件。
- Assets.xcassets: 图片和其他资源。
- Info.plist: 应用的配置文件。
- LaunchScreen.storyboard: 启动屏幕。
- Supporting Files: 包罗应用的支持文件。
2. 项目的启动文件介绍
main.swift
- import UIKit
- UIApplicationMain(
- CommandLine.argc,
- CommandLine.unsafeArgv,
- nil,
- NSStringFromClass(AppDelegate.self)
- )
复制代码 main.swift 是应用的启动文件,负责调用 UIApplicationMain 函数来启动应用,并指定 AppDelegate 作为应用的代理类。
3. 项目的配置文件介绍
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>en</string>
- <key>CFBundleDisplayName</key>
- <string>iOS-Viper-Architecture</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>LSRequiresIPhoneOS</key>
- <true/>
- <key>UILaunchStoryboardName</key>
- <string>LaunchScreen</string>
- <key>UIMainStoryboardFile</key>
- <string>Main</string>
- <key>UIRequiredDeviceCapabilities</key>
- <array>
- <string>armv7</string>
- </array>
- <key>UISupportedInterfaceOrientations</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- <string>UIInterfaceOrientationLandscapeLeft</string>
- <string>UIInterfaceOrientationLandscapeRight</string>
- </array>
- <key>UISupportedInterfaceOrientations~ipad</key>
- <array>
- <string>UIInterfaceOrientationPort
复制代码 iOS-Viper-ArchitectureThis repository contains a detailed sample app that implements VIPER architecture in iOS using libraries and frameworks like Alamofire, AlamofireImage, PKHUD, CoreData etc.项目地点:https://gitcode.com/gh_mirrors/ios/iOS-Viper-Architecture
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |