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 lifecycle 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 lifecycle methods...
}
ViewController.swift
import UIKit
import LinearProgressBar
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let progressBar = LinearProgressBar()
view.addSubview(progressBar)
progressBar.startAnimating()
}
}
3. 项目的配置文件介绍
LinearProgressBar.podspec
Pod::Spec.new do |spec|
spec.name = "LinearProgressBar"
spec.version = "1.2.0"
spec.summary = "Simple progress bar for iOS."
spec.description = <<-DESC
A simple and customizable progress bar for iOS, written in Swift.
DESC
spec.homepage = "https://github.com/Recouse/LinearProgressBar"
spec.license = { :type => "MIT", :file => "LICENSE" }
spec.author = { "Recouse" => "recouse@gmail.com" }
spec.platform = :ios, "10.0"
spec.source = { :git => "https://github.com/Recouse/LinearProgressBar.git", :tag => "#{spec.version}"
开源项目 LinearProgressBar 使用教程 LinearProgressBarMaterial Linear Progress Bar for your iOS apps项目地址:https://gitcode.com/gh_mirrors/lin/LinearProgressBar 1. 项目的目录结构及介绍LinearProgressBar/├── LinearProgres...