├── Screenshots
├── hud-dark.gif
├── hud-light.gif
├── activity-indicator-hud-dark.gif
└── activity-indicator-hud-light.gif
├── Examples
└── HUDExample
│ ├── HUDExample
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ ├── AccentColor.colorset
│ │ │ └── Contents.json
│ │ ├── iOS-14.2-wallpaper-LAke-The-Cliff.imageset
│ │ │ ├── iOS-14.2-wallpaper-LAke-The-Cliff-Dark-Mode.jpg
│ │ │ ├── iOS-14.2-wallpaper-LAke-The-Cliff-Light-Mode.jpg
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── SceneDelegate.swift
│ ├── AppDelegate.swift
│ ├── ViewController.swift
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ └── Info.plist
│ └── HUDExample.xcodeproj
│ ├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ ├── xcshareddata
│ └── xcschemes
│ │ └── HUDExample.xcscheme
│ └── project.pbxproj
├── .gitignore
├── Package.swift
├── .swiftpm
└── xcode
│ └── package.xcworkspace
│ └── xcshareddata
│ └── IDEWorkspaceChecks.plist
├── Sources
└── HUD
│ ├── Views
│ ├── ActivityIndicatorHUDView.swift
│ ├── HUDView.swift
│ └── _HUDView.swift
│ ├── HUD
│ ├── HUDProtocol.swift
│ ├── ActivityIndicatorHUD.swift
│ └── HUD.swift
│ └── UIWindow+HUD.swift
├── LICENSE
└── README.md
/Screenshots/hud-dark.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/li-bei/HUD/HEAD/Screenshots/hud-dark.gif
--------------------------------------------------------------------------------
/Screenshots/hud-light.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/li-bei/HUD/HEAD/Screenshots/hud-light.gif
--------------------------------------------------------------------------------
/Screenshots/activity-indicator-hud-dark.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/li-bei/HUD/HEAD/Screenshots/activity-indicator-hud-dark.gif
--------------------------------------------------------------------------------
/Screenshots/activity-indicator-hud-light.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/li-bei/HUD/HEAD/Screenshots/activity-indicator-hud-light.gif
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | /.build
3 | /Packages
4 | /*.xcodeproj
5 | xcuserdata/
6 | DerivedData/
7 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/SceneDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
4 | var window: UIWindow?
5 | }
6 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.3
2 |
3 | import PackageDescription
4 |
5 | let package = Package(
6 | name: "HUD",
7 | platforms: [.iOS(.v13)],
8 | products: [.library(name: "HUD", targets: ["HUD"])],
9 | targets: [.target(name: "HUD")]
10 | )
11 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/Assets.xcassets/iOS-14.2-wallpaper-LAke-The-Cliff.imageset/iOS-14.2-wallpaper-LAke-The-Cliff-Dark-Mode.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/li-bei/HUD/HEAD/Examples/HUDExample/HUDExample/Assets.xcassets/iOS-14.2-wallpaper-LAke-The-Cliff.imageset/iOS-14.2-wallpaper-LAke-The-Cliff-Dark-Mode.jpg
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/Assets.xcassets/iOS-14.2-wallpaper-LAke-The-Cliff.imageset/iOS-14.2-wallpaper-LAke-The-Cliff-Light-Mode.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/li-bei/HUD/HEAD/Examples/HUDExample/HUDExample/Assets.xcassets/iOS-14.2-wallpaper-LAke-The-Cliff.imageset/iOS-14.2-wallpaper-LAke-The-Cliff-Light-Mode.jpg
--------------------------------------------------------------------------------
/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | @main
4 | final class AppDelegate: UIResponder, UIApplicationDelegate {
5 | func application(
6 | _ application: UIApplication,
7 | configurationForConnecting connectingSceneSession: UISceneSession,
8 | options: UIScene.ConnectionOptions
9 | ) -> UISceneConfiguration {
10 | UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sources/HUD/Views/ActivityIndicatorHUDView.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | final class ActivityIndicatorHUDView: _HUDView {
4 | init(hud: ActivityIndicatorHUD) {
5 | super.init(hud: hud)
6 | }
7 |
8 | override func setUpStackViewArrangedSubviews(for hud: HUDProtocol) {
9 | let activityIndicatorView = UIActivityIndicatorView(style: .large)
10 | activityIndicatorView.startAnimating()
11 | stackView.addArrangedSubview(activityIndicatorView)
12 |
13 | super.setUpStackViewArrangedSubviews(for: hud)
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sources/HUD/HUD/HUDProtocol.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | protocol HUDProtocol: AnyObject {
4 | var title: String? { get }
5 |
6 | var message: String? { get }
7 |
8 | var blurEffectStyle: UIBlurEffect.Style { get }
9 |
10 | var blocksUserInteraction: Bool { get }
11 |
12 | var view: UIView? { get set }
13 |
14 | func makeHUDView() -> UIView
15 | }
16 |
17 | // MARK: -
18 |
19 | extension HUD: HUDProtocol {
20 | func makeHUDView() -> UIView {
21 | HUDView(hud: self)
22 | }
23 | }
24 |
25 | // MARK: -
26 |
27 | extension ActivityIndicatorHUD: HUDProtocol {
28 | func makeHUDView() -> UIView {
29 | ActivityIndicatorHUDView(hud: self)
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Sources/HUD/HUD/ActivityIndicatorHUD.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | public final class ActivityIndicatorHUD {
4 | public let title: String?
5 |
6 | public let message: String?
7 |
8 | public let blurEffectStyle: UIBlurEffect.Style
9 |
10 | public let blocksUserInteraction: Bool
11 |
12 | weak var view: UIView?
13 |
14 | public init(
15 | title: String? = nil,
16 | message: String? = nil,
17 | blurEffectStyle: UIBlurEffect.Style = .systemThinMaterial,
18 | blocksUserInteraction: Bool = true
19 | ) {
20 | self.title = title
21 | self.message = message
22 | self.blurEffectStyle = blurEffectStyle
23 | self.blocksUserInteraction = blocksUserInteraction
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sources/HUD/HUD/HUD.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | public final class HUD {
4 | public let image: UIImage?
5 |
6 | public let title: String?
7 |
8 | public let message: String?
9 |
10 | public let blurEffectStyle: UIBlurEffect.Style
11 |
12 | public let blocksUserInteraction: Bool
13 |
14 | weak var view: UIView?
15 |
16 | public init(
17 | image: UIImage? = nil,
18 | title: String? = nil,
19 | message: String? = nil,
20 | blurEffectStyle: UIBlurEffect.Style = .systemThinMaterial,
21 | blocksUserInteraction: Bool = false
22 | ) {
23 | self.image = image
24 | self.title = title
25 | self.message = message
26 | self.blurEffectStyle = blurEffectStyle
27 | self.blocksUserInteraction = blocksUserInteraction
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Bei Li
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/Assets.xcassets/iOS-14.2-wallpaper-LAke-The-Cliff.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "iOS-14.2-wallpaper-LAke-The-Cliff-Light-Mode.jpg",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "appearances" : [
10 | {
11 | "appearance" : "luminosity",
12 | "value" : "dark"
13 | }
14 | ],
15 | "filename" : "iOS-14.2-wallpaper-LAke-The-Cliff-Dark-Mode.jpg",
16 | "idiom" : "universal",
17 | "scale" : "1x"
18 | },
19 | {
20 | "idiom" : "universal",
21 | "scale" : "2x"
22 | },
23 | {
24 | "appearances" : [
25 | {
26 | "appearance" : "luminosity",
27 | "value" : "dark"
28 | }
29 | ],
30 | "idiom" : "universal",
31 | "scale" : "2x"
32 | },
33 | {
34 | "idiom" : "universal",
35 | "scale" : "3x"
36 | },
37 | {
38 | "appearances" : [
39 | {
40 | "appearance" : "luminosity",
41 | "value" : "dark"
42 | }
43 | ],
44 | "idiom" : "universal",
45 | "scale" : "3x"
46 | }
47 | ],
48 | "info" : {
49 | "author" : "xcode",
50 | "version" : 1
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # HUD
2 |
3 | A modern HUD inspired by Apple Music and Apple Podcasts.
4 |
5 | Appearance | Light | Dark
6 | ---------------------- | ------------------------------------------------- | ------------------------------------------------
7 | HUD |  | 
8 | Activity Indicator HUD |  | 
9 |
10 |
11 | ## Requirements
12 |
13 | - iOS 13+
14 |
15 | ## Installation
16 |
17 | You can install HUD via Swift Package Manager. For Xcode, please check this [documentation](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app).
18 |
19 | ## How to Use
20 |
21 | ### HUD
22 |
23 | ```swift
24 | import HUD
25 |
26 | let window: UIWindow = ...
27 |
28 | let hud = HUD(
29 | image: UIImage(systemName: "heart"),
30 | title: "Loved",
31 | message: "This is a beautiful HUD."
32 | )
33 | window.show(hud)
34 | ```
35 |
36 | ### Activity Indicator HUD
37 |
38 | ```swift
39 | import HUD
40 |
41 | let window: UIWindow = ...
42 |
43 | let hud = ActivityIndicatorHUD()
44 | window.show(hud)
45 | ```
46 |
--------------------------------------------------------------------------------
/Sources/HUD/Views/HUDView.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | final class HUDView: _HUDView {
4 | public init(hud: HUD) {
5 | super.init(hud: hud)
6 | }
7 |
8 | override func setUpStackViewArrangedSubviews(for hud: HUDProtocol) {
9 | guard let hud = hud as? HUD else {
10 | return
11 | }
12 |
13 | if let image = hud.image {
14 | stackView.addArrangedSubview(ImageView(image: image))
15 | }
16 |
17 | super.setUpStackViewArrangedSubviews(for: hud)
18 | }
19 | }
20 |
21 | // MARK: -
22 |
23 | private final class ImageView: View {
24 | private let imageView: UIImageView = {
25 | let imageView = UIImageView()
26 | imageView.preferredSymbolConfiguration = UIImage.SymbolConfiguration(pointSize: 108)
27 | return imageView
28 | }()
29 |
30 | init(image: UIImage) {
31 | super.init(frame: .zero)
32 | imageView.image = image
33 | addSubview(imageView)
34 | let size = imageView.sizeThatFits(UIView.layoutFittingExpandedSize)
35 | NSLayoutConstraint.activate([
36 | widthAnchor.constraint(equalToConstant: size.width),
37 | heightAnchor.constraint(equalToConstant: size.height),
38 | ])
39 | }
40 |
41 | override func layoutSubviews() {
42 | super.layoutSubviews()
43 | imageView.frame = bounds
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/ViewController.swift:
--------------------------------------------------------------------------------
1 | import HUD
2 | import UIKit
3 |
4 | final class ViewController: UIViewController {
5 | override func viewDidLoad() {
6 | super.viewDidLoad()
7 |
8 | navigationItem.rightBarButtonItem = UIBarButtonItem(
9 | barButtonSystemItem: .add,
10 | target: self,
11 | action: #selector(showHUD)
12 | )
13 |
14 | let backgroundImageView = UIImageView(image: UIImage(named: "iOS-14.2-wallpaper-LAke-The-Cliff"))
15 | backgroundImageView.contentMode = .scaleAspectFill
16 | backgroundImageView.translatesAutoresizingMaskIntoConstraints = false
17 | view.addSubview(backgroundImageView)
18 | NSLayoutConstraint.activate([
19 | backgroundImageView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
20 | backgroundImageView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
21 | backgroundImageView.topAnchor.constraint(equalTo: view.topAnchor),
22 | backgroundImageView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
23 | ])
24 | }
25 |
26 | @objc
27 | private func showHUD() {
28 | let style: [UIBlurEffect.Style] = [.dark, .systemChromeMaterial, .systemMaterial, .systemMaterialLight, .systemMaterialDark]
29 | let hud = HUD(
30 | image: UIImage(systemName: "heart"),
31 | title: "Loved",
32 | message: "This is a beautiful HUD.",
33 | blurEffectStyle: style.randomElement() ?? .systemThinMaterial
34 | )
35 | view.window?.show(hud)
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "scale" : "2x",
6 | "size" : "20x20"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "scale" : "3x",
11 | "size" : "20x20"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "scale" : "2x",
16 | "size" : "29x29"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "scale" : "3x",
21 | "size" : "29x29"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "scale" : "2x",
26 | "size" : "40x40"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "scale" : "3x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "scale" : "2x",
36 | "size" : "60x60"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "scale" : "3x",
41 | "size" : "60x60"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "scale" : "1x",
46 | "size" : "20x20"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "scale" : "2x",
51 | "size" : "20x20"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "scale" : "1x",
56 | "size" : "29x29"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "scale" : "2x",
61 | "size" : "29x29"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "scale" : "1x",
66 | "size" : "40x40"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "scale" : "2x",
71 | "size" : "40x40"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "scale" : "1x",
76 | "size" : "76x76"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "scale" : "2x",
81 | "size" : "76x76"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "scale" : "2x",
86 | "size" : "83.5x83.5"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "scale" : "1x",
91 | "size" : "1024x1024"
92 | }
93 | ],
94 | "info" : {
95 | "author" : "xcode",
96 | "version" : 1
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UIApplicationSceneManifest
24 |
25 | UIApplicationSupportsMultipleScenes
26 |
27 | UISceneConfigurations
28 |
29 | UIWindowSceneSessionRoleApplication
30 |
31 |
32 | UISceneConfigurationName
33 | Default Configuration
34 | UISceneDelegateClassName
35 | $(PRODUCT_MODULE_NAME).SceneDelegate
36 | UISceneStoryboardFile
37 | Main
38 |
39 |
40 |
41 |
42 | UIApplicationSupportsIndirectInputEvents
43 |
44 | UILaunchStoryboardName
45 | LaunchScreen
46 | UIMainStoryboardFile
47 | Main
48 | UIRequiredDeviceCapabilities
49 |
50 | armv7
51 |
52 | UISupportedInterfaceOrientations
53 |
54 | UIInterfaceOrientationPortrait
55 | UIInterfaceOrientationLandscapeLeft
56 | UIInterfaceOrientationLandscapeRight
57 |
58 | UISupportedInterfaceOrientations~ipad
59 |
60 | UIInterfaceOrientationPortrait
61 | UIInterfaceOrientationPortraitUpsideDown
62 | UIInterfaceOrientationLandscapeLeft
63 | UIInterfaceOrientationLandscapeRight
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample.xcodeproj/xcshareddata/xcschemes/HUDExample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
45 |
51 |
52 |
53 |
54 |
60 |
62 |
68 |
69 |
70 |
71 |
73 |
74 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Sources/HUD/UIWindow+HUD.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | public enum HUDHidingStrategy {
4 | case afterTimeInterval(TimeInterval)
5 | case never
6 | }
7 |
8 | // MARK: -
9 |
10 | extension UIWindow {
11 | public func show(
12 | _ hud: HUD,
13 | animated: Bool = true,
14 | hidingStrategy: HUDHidingStrategy = .afterTimeInterval(2)
15 | ) {
16 | show(
17 | hud as HUDProtocol,
18 | animated: animated,
19 | hidingStrategy: hidingStrategy
20 | )
21 | }
22 |
23 | public func show(
24 | _ hud: ActivityIndicatorHUD,
25 | animated: Bool = true,
26 | hidingStrategy: HUDHidingStrategy = .never
27 | ) {
28 | show(
29 | hud as HUDProtocol,
30 | animated: animated,
31 | hidingStrategy: hidingStrategy
32 | )
33 | }
34 |
35 | public func hide(_ hud: HUD, animated: Bool = true) {
36 | hide(hud as HUDProtocol, animated: animated)
37 | }
38 |
39 | public func hide(_ hud: ActivityIndicatorHUD, animated: Bool = true) {
40 | hide(hud as HUDProtocol, animated: animated)
41 | }
42 | }
43 |
44 | // MARK: -
45 |
46 | extension UIWindow {
47 | private func show(
48 | _ hud: HUDProtocol,
49 | animated: Bool,
50 | hidingStrategy: HUDHidingStrategy
51 | ) {
52 | guard hud.view == nil else {
53 | return
54 | }
55 |
56 | let hudView = hud.makeHUDView()
57 | addSubview(hudView)
58 | NSLayoutConstraint.activate([
59 | hudView.leadingAnchor.constraint(equalTo: leadingAnchor),
60 | hudView.trailingAnchor.constraint(equalTo: trailingAnchor),
61 | hudView.topAnchor.constraint(equalTo: topAnchor),
62 | hudView.bottomAnchor.constraint(equalTo: bottomAnchor),
63 | ])
64 |
65 | if animated {
66 | hudView.alpha = 0
67 | hudView.transform = .scaled
68 | startAnimation {
69 | hudView.alpha = 1
70 | hudView.transform = .identity
71 | }
72 | }
73 |
74 | switch hidingStrategy {
75 | case .afterTimeInterval(let timeInterval):
76 | DispatchQueue.main.asyncAfter(deadline: .now() + timeInterval) { [weak self] in
77 | self?.hide(hud, animated: animated)
78 | }
79 | case .never:
80 | break
81 | }
82 | }
83 |
84 | private func hide(_ hud: HUDProtocol, animated: Bool) {
85 | guard let hudView = hud.view else {
86 | return
87 | }
88 |
89 | if animated {
90 | startAnimation {
91 | hudView.alpha = 0
92 | hudView.transform = .scaled
93 | } completion: {
94 | hudView.removeFromSuperview()
95 | }
96 | } else {
97 | hudView.removeFromSuperview()
98 | }
99 | }
100 |
101 | private func startAnimation(_ animations: @escaping () -> Void, completion: (() -> Void)? = nil) {
102 | let animator = UIViewPropertyAnimator(duration: 0.25, dampingRatio: 1, animations: animations)
103 | if let completion = completion {
104 | animator.addCompletion { _ in completion() }
105 | }
106 | animator.startAnimation()
107 | }
108 | }
109 |
110 | // MARK: -
111 |
112 | extension CGAffineTransform {
113 | fileprivate static var scaled: CGAffineTransform { CGAffineTransform(scaleX: 0.9, y: 0.9) }
114 | }
115 |
--------------------------------------------------------------------------------
/Sources/HUD/Views/_HUDView.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 |
3 | class View: UIView {
4 | public override init(frame: CGRect) {
5 | super.init(frame: frame)
6 | }
7 |
8 | @available(*, unavailable)
9 | public required init?(coder: NSCoder) {
10 | fatalError()
11 | }
12 | }
13 |
14 | // MARK: -
15 |
16 | class _HUDView: View {
17 | private let blurEffect: UIBlurEffect
18 |
19 | private lazy var blurEffectView: UIVisualEffectView = {
20 | let visualEffectView = UIVisualEffectView(effect: blurEffect)
21 | visualEffectView.clipsToBounds = true
22 | visualEffectView.layer.cornerRadius = 9
23 | visualEffectView.layer.cornerCurve = .continuous
24 | visualEffectView.translatesAutoresizingMaskIntoConstraints = false
25 | return visualEffectView
26 | }()
27 |
28 | private lazy var vibrancyEffectView: UIVisualEffectView = {
29 | let visualEffectView = UIVisualEffectView(effect: UIVibrancyEffect(blurEffect: blurEffect))
30 | visualEffectView.contentView.layoutMargins = UIEdgeInsets(top: 25, left: 25, bottom: 25, right: 25)
31 | visualEffectView.translatesAutoresizingMaskIntoConstraints = false
32 | return visualEffectView
33 | }()
34 |
35 | let stackView: UIStackView = {
36 | let stackView = UIStackView()
37 | stackView.alignment = .center
38 | stackView.axis = .vertical
39 | stackView.spacing = UIStackView.spacingUseSystem
40 | stackView.translatesAutoresizingMaskIntoConstraints = false
41 | return stackView
42 | }()
43 |
44 | public init(hud: HUDProtocol) {
45 | assert(hud.view == nil)
46 |
47 | blurEffect = UIBlurEffect(style: hud.blurEffectStyle)
48 |
49 | super.init(frame: .zero)
50 |
51 | isUserInteractionEnabled = hud.blocksUserInteraction
52 | translatesAutoresizingMaskIntoConstraints = false
53 |
54 | setUpSubviews()
55 | setUpConstraints()
56 | setUpStackViewArrangedSubviews(for: hud)
57 |
58 | hud.view = self
59 | }
60 |
61 | private func setUpSubviews() {
62 | addSubview(blurEffectView)
63 | blurEffectView.contentView.addSubview(vibrancyEffectView)
64 | vibrancyEffectView.contentView.addSubview(stackView)
65 | }
66 |
67 | private func setUpConstraints() {
68 | let blurEffectViewHeightConstraint = blurEffectView.heightAnchor.constraint(equalToConstant: 250)
69 | blurEffectViewHeightConstraint.priority = .defaultLow
70 |
71 | let margins = vibrancyEffectView.contentView.layoutMarginsGuide
72 |
73 | NSLayoutConstraint.activate([
74 | blurEffectView.widthAnchor.constraint(equalToConstant: 250),
75 | blurEffectView.heightAnchor.constraint(greaterThanOrEqualToConstant: 250),
76 | blurEffectViewHeightConstraint,
77 | blurEffectView.centerXAnchor.constraint(equalTo: centerXAnchor),
78 | blurEffectView.centerYAnchor.constraint(equalTo: centerYAnchor),
79 |
80 | vibrancyEffectView.leadingAnchor.constraint(equalTo: blurEffectView.contentView.leadingAnchor),
81 | vibrancyEffectView.trailingAnchor.constraint(equalTo: blurEffectView.contentView.trailingAnchor),
82 | vibrancyEffectView.topAnchor.constraint(equalTo: blurEffectView.contentView.topAnchor),
83 | vibrancyEffectView.bottomAnchor.constraint(equalTo: blurEffectView.contentView.bottomAnchor),
84 |
85 | stackView.leadingAnchor.constraint(equalTo: margins.leadingAnchor),
86 | stackView.trailingAnchor.constraint(equalTo: margins.trailingAnchor),
87 | stackView.topAnchor.constraint(greaterThanOrEqualTo: margins.topAnchor),
88 | stackView.bottomAnchor.constraint(lessThanOrEqualTo: margins.bottomAnchor),
89 | stackView.centerYAnchor.constraint(equalTo: vibrancyEffectView.contentView.centerYAnchor),
90 | ])
91 | }
92 |
93 | func setUpStackViewArrangedSubviews(for hud: HUDProtocol) {
94 | if let title = hud.title {
95 | let titlelabel = UILabel()
96 | titlelabel.font = UIFont.systemFont(ofSize: 22, weight: .semibold)
97 | titlelabel.numberOfLines = 0
98 | titlelabel.text = title
99 | titlelabel.textAlignment = .center
100 | titlelabel.textColor = .secondaryLabel
101 | stackView.addArrangedSubview(titlelabel)
102 | }
103 | if let message = hud.message {
104 | let messagelabel = UILabel()
105 | messagelabel.font = UIFont.preferredFont(forTextStyle: .callout).withSize(16)
106 | messagelabel.numberOfLines = 0
107 | messagelabel.text = message
108 | messagelabel.textAlignment = .center
109 | messagelabel.textColor = .secondaryLabel
110 | stackView.addArrangedSubview(messagelabel)
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/Examples/HUDExample/HUDExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 52;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 8C67879F263BF8F000B89E03 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C67879E263BF8F000B89E03 /* AppDelegate.swift */; };
11 | 8C6787A1263BF8F000B89E03 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C6787A0263BF8F000B89E03 /* SceneDelegate.swift */; };
12 | 8C6787A3263BF8F000B89E03 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C6787A2263BF8F000B89E03 /* ViewController.swift */; };
13 | 8C6787A6263BF8F000B89E03 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8C6787A4263BF8F000B89E03 /* Main.storyboard */; };
14 | 8C6787A8263BF8F100B89E03 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8C6787A7263BF8F100B89E03 /* Assets.xcassets */; };
15 | 8C6787AB263BF8F100B89E03 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8C6787A9263BF8F100B89E03 /* LaunchScreen.storyboard */; };
16 | 8C6787B5263BF92600B89E03 /* HUD in Frameworks */ = {isa = PBXBuildFile; productRef = 8C6787B4263BF92600B89E03 /* HUD */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXFileReference section */
20 | 8C67879B263BF8F000B89E03 /* HUDExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HUDExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
21 | 8C67879E263BF8F000B89E03 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
22 | 8C6787A0263BF8F000B89E03 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
23 | 8C6787A2263BF8F000B89E03 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
24 | 8C6787A5263BF8F000B89E03 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
25 | 8C6787A7263BF8F100B89E03 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
26 | 8C6787AA263BF8F100B89E03 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
27 | 8C6787AC263BF8F100B89E03 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
28 | 8C6787B2263BF90F00B89E03 /* HUD */ = {isa = PBXFileReference; lastKnownFileType = folder; name = HUD; path = ../..; sourceTree = ""; };
29 | /* End PBXFileReference section */
30 |
31 | /* Begin PBXFrameworksBuildPhase section */
32 | 8C678798263BF8F000B89E03 /* Frameworks */ = {
33 | isa = PBXFrameworksBuildPhase;
34 | buildActionMask = 2147483647;
35 | files = (
36 | 8C6787B5263BF92600B89E03 /* HUD in Frameworks */,
37 | );
38 | runOnlyForDeploymentPostprocessing = 0;
39 | };
40 | /* End PBXFrameworksBuildPhase section */
41 |
42 | /* Begin PBXGroup section */
43 | 8C678792263BF8F000B89E03 = {
44 | isa = PBXGroup;
45 | children = (
46 | 8C6787B2263BF90F00B89E03 /* HUD */,
47 | 8C67879D263BF8F000B89E03 /* HUDExample */,
48 | 8C67879C263BF8F000B89E03 /* Products */,
49 | 8C6787B3263BF92600B89E03 /* Frameworks */,
50 | );
51 | sourceTree = "";
52 | };
53 | 8C67879C263BF8F000B89E03 /* Products */ = {
54 | isa = PBXGroup;
55 | children = (
56 | 8C67879B263BF8F000B89E03 /* HUDExample.app */,
57 | );
58 | name = Products;
59 | sourceTree = "";
60 | };
61 | 8C67879D263BF8F000B89E03 /* HUDExample */ = {
62 | isa = PBXGroup;
63 | children = (
64 | 8C67879E263BF8F000B89E03 /* AppDelegate.swift */,
65 | 8C6787A0263BF8F000B89E03 /* SceneDelegate.swift */,
66 | 8C6787A2263BF8F000B89E03 /* ViewController.swift */,
67 | 8C6787A4263BF8F000B89E03 /* Main.storyboard */,
68 | 8C6787A7263BF8F100B89E03 /* Assets.xcassets */,
69 | 8C6787A9263BF8F100B89E03 /* LaunchScreen.storyboard */,
70 | 8C6787AC263BF8F100B89E03 /* Info.plist */,
71 | );
72 | path = HUDExample;
73 | sourceTree = "";
74 | };
75 | 8C6787B3263BF92600B89E03 /* Frameworks */ = {
76 | isa = PBXGroup;
77 | children = (
78 | );
79 | name = Frameworks;
80 | sourceTree = "";
81 | };
82 | /* End PBXGroup section */
83 |
84 | /* Begin PBXNativeTarget section */
85 | 8C67879A263BF8F000B89E03 /* HUDExample */ = {
86 | isa = PBXNativeTarget;
87 | buildConfigurationList = 8C6787AF263BF8F100B89E03 /* Build configuration list for PBXNativeTarget "HUDExample" */;
88 | buildPhases = (
89 | 8C678797263BF8F000B89E03 /* Sources */,
90 | 8C678798263BF8F000B89E03 /* Frameworks */,
91 | 8C678799263BF8F000B89E03 /* Resources */,
92 | );
93 | buildRules = (
94 | );
95 | dependencies = (
96 | );
97 | name = HUDExample;
98 | packageProductDependencies = (
99 | 8C6787B4263BF92600B89E03 /* HUD */,
100 | );
101 | productName = HUDExample;
102 | productReference = 8C67879B263BF8F000B89E03 /* HUDExample.app */;
103 | productType = "com.apple.product-type.application";
104 | };
105 | /* End PBXNativeTarget section */
106 |
107 | /* Begin PBXProject section */
108 | 8C678793263BF8F000B89E03 /* Project object */ = {
109 | isa = PBXProject;
110 | attributes = {
111 | LastSwiftUpdateCheck = 1250;
112 | LastUpgradeCheck = 1250;
113 | TargetAttributes = {
114 | 8C67879A263BF8F000B89E03 = {
115 | CreatedOnToolsVersion = 12.5;
116 | };
117 | };
118 | };
119 | buildConfigurationList = 8C678796263BF8F000B89E03 /* Build configuration list for PBXProject "HUDExample" */;
120 | compatibilityVersion = "Xcode 9.3";
121 | developmentRegion = en;
122 | hasScannedForEncodings = 0;
123 | knownRegions = (
124 | en,
125 | Base,
126 | );
127 | mainGroup = 8C678792263BF8F000B89E03;
128 | productRefGroup = 8C67879C263BF8F000B89E03 /* Products */;
129 | projectDirPath = "";
130 | projectRoot = "";
131 | targets = (
132 | 8C67879A263BF8F000B89E03 /* HUDExample */,
133 | );
134 | };
135 | /* End PBXProject section */
136 |
137 | /* Begin PBXResourcesBuildPhase section */
138 | 8C678799263BF8F000B89E03 /* Resources */ = {
139 | isa = PBXResourcesBuildPhase;
140 | buildActionMask = 2147483647;
141 | files = (
142 | 8C6787AB263BF8F100B89E03 /* LaunchScreen.storyboard in Resources */,
143 | 8C6787A8263BF8F100B89E03 /* Assets.xcassets in Resources */,
144 | 8C6787A6263BF8F000B89E03 /* Main.storyboard in Resources */,
145 | );
146 | runOnlyForDeploymentPostprocessing = 0;
147 | };
148 | /* End PBXResourcesBuildPhase section */
149 |
150 | /* Begin PBXSourcesBuildPhase section */
151 | 8C678797263BF8F000B89E03 /* Sources */ = {
152 | isa = PBXSourcesBuildPhase;
153 | buildActionMask = 2147483647;
154 | files = (
155 | 8C6787A3263BF8F000B89E03 /* ViewController.swift in Sources */,
156 | 8C67879F263BF8F000B89E03 /* AppDelegate.swift in Sources */,
157 | 8C6787A1263BF8F000B89E03 /* SceneDelegate.swift in Sources */,
158 | );
159 | runOnlyForDeploymentPostprocessing = 0;
160 | };
161 | /* End PBXSourcesBuildPhase section */
162 |
163 | /* Begin PBXVariantGroup section */
164 | 8C6787A4263BF8F000B89E03 /* Main.storyboard */ = {
165 | isa = PBXVariantGroup;
166 | children = (
167 | 8C6787A5263BF8F000B89E03 /* Base */,
168 | );
169 | name = Main.storyboard;
170 | sourceTree = "";
171 | };
172 | 8C6787A9263BF8F100B89E03 /* LaunchScreen.storyboard */ = {
173 | isa = PBXVariantGroup;
174 | children = (
175 | 8C6787AA263BF8F100B89E03 /* Base */,
176 | );
177 | name = LaunchScreen.storyboard;
178 | sourceTree = "";
179 | };
180 | /* End PBXVariantGroup section */
181 |
182 | /* Begin XCBuildConfiguration section */
183 | 8C6787AD263BF8F100B89E03 /* Debug */ = {
184 | isa = XCBuildConfiguration;
185 | buildSettings = {
186 | ALWAYS_SEARCH_USER_PATHS = NO;
187 | CLANG_ANALYZER_NONNULL = YES;
188 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
189 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
190 | CLANG_CXX_LIBRARY = "libc++";
191 | CLANG_ENABLE_MODULES = YES;
192 | CLANG_ENABLE_OBJC_ARC = YES;
193 | CLANG_ENABLE_OBJC_WEAK = YES;
194 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
195 | CLANG_WARN_BOOL_CONVERSION = YES;
196 | CLANG_WARN_COMMA = YES;
197 | CLANG_WARN_CONSTANT_CONVERSION = YES;
198 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
199 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
200 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
201 | CLANG_WARN_EMPTY_BODY = YES;
202 | CLANG_WARN_ENUM_CONVERSION = YES;
203 | CLANG_WARN_INFINITE_RECURSION = YES;
204 | CLANG_WARN_INT_CONVERSION = YES;
205 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
206 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
207 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
208 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
209 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
210 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
211 | CLANG_WARN_STRICT_PROTOTYPES = YES;
212 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
213 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
214 | CLANG_WARN_UNREACHABLE_CODE = YES;
215 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
216 | COPY_PHASE_STRIP = NO;
217 | DEBUG_INFORMATION_FORMAT = dwarf;
218 | ENABLE_STRICT_OBJC_MSGSEND = YES;
219 | ENABLE_TESTABILITY = YES;
220 | GCC_C_LANGUAGE_STANDARD = gnu11;
221 | GCC_DYNAMIC_NO_PIC = NO;
222 | GCC_NO_COMMON_BLOCKS = YES;
223 | GCC_OPTIMIZATION_LEVEL = 0;
224 | GCC_PREPROCESSOR_DEFINITIONS = (
225 | "DEBUG=1",
226 | "$(inherited)",
227 | );
228 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
229 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
230 | GCC_WARN_UNDECLARED_SELECTOR = YES;
231 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
232 | GCC_WARN_UNUSED_FUNCTION = YES;
233 | GCC_WARN_UNUSED_VARIABLE = YES;
234 | IPHONEOS_DEPLOYMENT_TARGET = 14.5;
235 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
236 | MTL_FAST_MATH = YES;
237 | ONLY_ACTIVE_ARCH = YES;
238 | SDKROOT = iphoneos;
239 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
240 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
241 | };
242 | name = Debug;
243 | };
244 | 8C6787AE263BF8F100B89E03 /* Release */ = {
245 | isa = XCBuildConfiguration;
246 | buildSettings = {
247 | ALWAYS_SEARCH_USER_PATHS = NO;
248 | CLANG_ANALYZER_NONNULL = YES;
249 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
250 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
251 | CLANG_CXX_LIBRARY = "libc++";
252 | CLANG_ENABLE_MODULES = YES;
253 | CLANG_ENABLE_OBJC_ARC = YES;
254 | CLANG_ENABLE_OBJC_WEAK = YES;
255 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
256 | CLANG_WARN_BOOL_CONVERSION = YES;
257 | CLANG_WARN_COMMA = YES;
258 | CLANG_WARN_CONSTANT_CONVERSION = YES;
259 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
260 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
261 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
262 | CLANG_WARN_EMPTY_BODY = YES;
263 | CLANG_WARN_ENUM_CONVERSION = YES;
264 | CLANG_WARN_INFINITE_RECURSION = YES;
265 | CLANG_WARN_INT_CONVERSION = YES;
266 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
267 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
268 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
269 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
270 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
271 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
272 | CLANG_WARN_STRICT_PROTOTYPES = YES;
273 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
274 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
275 | CLANG_WARN_UNREACHABLE_CODE = YES;
276 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
277 | COPY_PHASE_STRIP = NO;
278 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
279 | ENABLE_NS_ASSERTIONS = NO;
280 | ENABLE_STRICT_OBJC_MSGSEND = YES;
281 | GCC_C_LANGUAGE_STANDARD = gnu11;
282 | GCC_NO_COMMON_BLOCKS = YES;
283 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
284 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
285 | GCC_WARN_UNDECLARED_SELECTOR = YES;
286 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
287 | GCC_WARN_UNUSED_FUNCTION = YES;
288 | GCC_WARN_UNUSED_VARIABLE = YES;
289 | IPHONEOS_DEPLOYMENT_TARGET = 14.5;
290 | MTL_ENABLE_DEBUG_INFO = NO;
291 | MTL_FAST_MATH = YES;
292 | SDKROOT = iphoneos;
293 | SWIFT_COMPILATION_MODE = wholemodule;
294 | SWIFT_OPTIMIZATION_LEVEL = "-O";
295 | VALIDATE_PRODUCT = YES;
296 | };
297 | name = Release;
298 | };
299 | 8C6787B0263BF8F100B89E03 /* Debug */ = {
300 | isa = XCBuildConfiguration;
301 | buildSettings = {
302 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
303 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
304 | CODE_SIGN_STYLE = Automatic;
305 | DEVELOPMENT_TEAM = S3YV5363RF;
306 | INFOPLIST_FILE = HUDExample/Info.plist;
307 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
308 | LD_RUNPATH_SEARCH_PATHS = (
309 | "$(inherited)",
310 | "@executable_path/Frameworks",
311 | );
312 | PRODUCT_BUNDLE_IDENTIFIER = me.libei.HUDExample;
313 | PRODUCT_NAME = "$(TARGET_NAME)";
314 | SWIFT_VERSION = 5.0;
315 | TARGETED_DEVICE_FAMILY = "1,2";
316 | };
317 | name = Debug;
318 | };
319 | 8C6787B1263BF8F100B89E03 /* Release */ = {
320 | isa = XCBuildConfiguration;
321 | buildSettings = {
322 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
323 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
324 | CODE_SIGN_STYLE = Automatic;
325 | DEVELOPMENT_TEAM = S3YV5363RF;
326 | INFOPLIST_FILE = HUDExample/Info.plist;
327 | IPHONEOS_DEPLOYMENT_TARGET = 13.0;
328 | LD_RUNPATH_SEARCH_PATHS = (
329 | "$(inherited)",
330 | "@executable_path/Frameworks",
331 | );
332 | PRODUCT_BUNDLE_IDENTIFIER = me.libei.HUDExample;
333 | PRODUCT_NAME = "$(TARGET_NAME)";
334 | SWIFT_VERSION = 5.0;
335 | TARGETED_DEVICE_FAMILY = "1,2";
336 | };
337 | name = Release;
338 | };
339 | /* End XCBuildConfiguration section */
340 |
341 | /* Begin XCConfigurationList section */
342 | 8C678796263BF8F000B89E03 /* Build configuration list for PBXProject "HUDExample" */ = {
343 | isa = XCConfigurationList;
344 | buildConfigurations = (
345 | 8C6787AD263BF8F100B89E03 /* Debug */,
346 | 8C6787AE263BF8F100B89E03 /* Release */,
347 | );
348 | defaultConfigurationIsVisible = 0;
349 | defaultConfigurationName = Release;
350 | };
351 | 8C6787AF263BF8F100B89E03 /* Build configuration list for PBXNativeTarget "HUDExample" */ = {
352 | isa = XCConfigurationList;
353 | buildConfigurations = (
354 | 8C6787B0263BF8F100B89E03 /* Debug */,
355 | 8C6787B1263BF8F100B89E03 /* Release */,
356 | );
357 | defaultConfigurationIsVisible = 0;
358 | defaultConfigurationName = Release;
359 | };
360 | /* End XCConfigurationList section */
361 |
362 | /* Begin XCSwiftPackageProductDependency section */
363 | 8C6787B4263BF92600B89E03 /* HUD */ = {
364 | isa = XCSwiftPackageProductDependency;
365 | productName = HUD;
366 | };
367 | /* End XCSwiftPackageProductDependency section */
368 | };
369 | rootObject = 8C678793263BF8F000B89E03 /* Project object */;
370 | }
371 |
--------------------------------------------------------------------------------