Repository: apegroup/APESuperHUD Branch: master Commit: 7a94bfdcd78c Files: 36 Total size: 106.3 KB Directory structure: gitextract_owcjc1_j/ ├── .gitignore ├── .swift-version ├── APESuperHUD.podspec ├── APESuperHUD.xcodeproj/ │ ├── project.pbxproj │ ├── project.xcworkspace/ │ │ └── contents.xcworkspacedata │ └── xcshareddata/ │ └── xcschemes/ │ └── APESuperHUD.xcscheme ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Demo/ │ ├── APESuperHUDDemo/ │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets/ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── apegroup.imageset/ │ │ │ │ └── Contents.json │ │ │ └── spark.imageset/ │ │ │ └── Contents.json │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── ViewController.swift │ └── APESuperHUDDemo.xcodeproj/ │ ├── project.pbxproj │ └── project.xcworkspace/ │ └── contents.xcworkspacedata ├── LICENSE ├── Package.swift ├── README.md ├── Resources/ │ ├── APESuperHUD.xib │ └── FrameworkMedia.xcassets/ │ ├── Contents.json │ ├── checkmark_icon.imageset/ │ │ └── Contents.json │ ├── email_icon.imageset/ │ │ └── Contents.json │ ├── happy_face_icon.imageset/ │ │ └── Contents.json │ ├── info_icon.imageset/ │ │ └── Contents.json │ └── sad_face_icon.imageset/ │ └── Contents.json ├── Source/ │ ├── APESuperHUD.h │ ├── APESuperHUD.swift │ ├── HUDStyle.swift │ └── HudAppearance.swift ├── SupportFiles/ │ └── Info.plist └── Tests/ ├── APESuperHUDTests.swift └── Info.plist ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Xcode # # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore ## Build generated build/ DerivedData ## Various settings *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata ## Other *.DS_Store *.xccheckout *.moved-aside *.xcuserstate *.xcscmblueprint ## Obj-C/Swift specific *.hmap *.ipa ## Playgrounds timeline.xctimeline playground.xcworkspace # Swift Package Manager # # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. # Packages/ .build/ # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control # # Pods/ # Carthage # # Add this line if you want to avoid checking in source code from Carthage dependencies. # Carthage/Checkouts Carthage/Build # fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the # screenshots whenever they are needed. # For more information about the recommended setup visit: # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md fastlane/report.xml fastlane/screenshots ================================================ FILE: .swift-version ================================================ +4.1 ================================================ FILE: APESuperHUD.podspec ================================================ Pod::Spec.new do |s| s.name = "APESuperHUD" s.summary = "A simple way to display a HUD with a message or progress information in your application." s.version = "2.0.1" s.homepage = "https://github.com/apegroup/APESuperHUD" s.license = 'MIT' s.author = { "apegroup AB" => "support@apegroup.com" } s.source = { :git => "https://github.com/apegroup/APESuperHUD.git", :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/apegroup' s.platform = :ios, '9.0' s.requires_arc = true s.source_files = 'Source/**/*' s.resources = ['Resources/**/*'] s.frameworks = 'UIKit', 'Foundation' end ================================================ FILE: APESuperHUD.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 18087298204064C10031DEF4 /* HUDStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18087297204064C10031DEF4 /* HUDStyle.swift */; }; 18AC6D011C5B902800FE881A /* APESuperHUD.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18AC6CF61C5B902800FE881A /* APESuperHUD.framework */; }; 18AC6D191C5B90D500FE881A /* APESuperHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = 18AC6D111C5B90D500FE881A /* APESuperHUD.h */; settings = {ATTRIBUTES = (Public, ); }; }; 18AC6D1B1C5B90D500FE881A /* HudAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18AC6D131C5B90D500FE881A /* HudAppearance.swift */; }; 18AC6D2A1C5B90F000FE881A /* FrameworkMedia.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18AC6D281C5B90F000FE881A /* FrameworkMedia.xcassets */; }; 18AC6D2D1C5B924A00FE881A /* APESuperHUDTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18AC6D251C5B90E100FE881A /* APESuperHUDTests.swift */; }; 18C9957320404C6700DC92D3 /* APESuperHUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18C9957120404C6700DC92D3 /* APESuperHUD.swift */; }; 18C9957420404C6700DC92D3 /* APESuperHUD.xib in Resources */ = {isa = PBXBuildFile; fileRef = 18C9957220404C6700DC92D3 /* APESuperHUD.xib */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 18AC6D021C5B902800FE881A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 18AC6CED1C5B902800FE881A /* Project object */; proxyType = 1; remoteGlobalIDString = 18AC6CF51C5B902800FE881A; remoteInfo = APESuperHUD; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 18087297204064C10031DEF4 /* HUDStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HUDStyle.swift; sourceTree = ""; }; 18AC6CF61C5B902800FE881A /* APESuperHUD.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = APESuperHUD.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 18AC6D001C5B902800FE881A /* APESuperHUDTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = APESuperHUDTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 18AC6D111C5B90D500FE881A /* APESuperHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APESuperHUD.h; sourceTree = ""; }; 18AC6D131C5B90D500FE881A /* HudAppearance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HudAppearance.swift; sourceTree = ""; }; 18AC6D221C5B90DA00FE881A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 18AC6D251C5B90E100FE881A /* APESuperHUDTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = APESuperHUDTests.swift; sourceTree = ""; }; 18AC6D281C5B90F000FE881A /* FrameworkMedia.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = FrameworkMedia.xcassets; sourceTree = ""; }; 18AC6D2E1C5B930D00FE881A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 18C9957120404C6700DC92D3 /* APESuperHUD.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APESuperHUD.swift; sourceTree = ""; }; 18C9957220404C6700DC92D3 /* APESuperHUD.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = APESuperHUD.xib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 18AC6CF21C5B902800FE881A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 18AC6CFD1C5B902800FE881A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 18AC6D011C5B902800FE881A /* APESuperHUD.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 18AC6CEC1C5B902800FE881A = { isa = PBXGroup; children = ( 18AC6CF71C5B902800FE881A /* Products */, 18AC6D271C5B90F000FE881A /* Resources */, 18AC6D101C5B90D500FE881A /* Source */, 18AC6D211C5B90DA00FE881A /* SupportFiles */, 18AC6D241C5B90E100FE881A /* Tests */, ); sourceTree = ""; }; 18AC6CF71C5B902800FE881A /* Products */ = { isa = PBXGroup; children = ( 18AC6CF61C5B902800FE881A /* APESuperHUD.framework */, 18AC6D001C5B902800FE881A /* APESuperHUDTests.xctest */, ); name = Products; sourceTree = ""; }; 18AC6D101C5B90D500FE881A /* Source */ = { isa = PBXGroup; children = ( 18AC6D111C5B90D500FE881A /* APESuperHUD.h */, 18AC6D131C5B90D500FE881A /* HudAppearance.swift */, 18C9957120404C6700DC92D3 /* APESuperHUD.swift */, 18087297204064C10031DEF4 /* HUDStyle.swift */, ); path = Source; sourceTree = ""; }; 18AC6D211C5B90DA00FE881A /* SupportFiles */ = { isa = PBXGroup; children = ( 18AC6D221C5B90DA00FE881A /* Info.plist */, ); path = SupportFiles; sourceTree = ""; }; 18AC6D241C5B90E100FE881A /* Tests */ = { isa = PBXGroup; children = ( 18AC6D2E1C5B930D00FE881A /* Info.plist */, 18AC6D251C5B90E100FE881A /* APESuperHUDTests.swift */, ); path = Tests; sourceTree = ""; }; 18AC6D271C5B90F000FE881A /* Resources */ = { isa = PBXGroup; children = ( 18C9957220404C6700DC92D3 /* APESuperHUD.xib */, 18AC6D281C5B90F000FE881A /* FrameworkMedia.xcassets */, ); path = Resources; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 18AC6CF31C5B902800FE881A /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 18AC6D191C5B90D500FE881A /* APESuperHUD.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 18AC6CF51C5B902800FE881A /* APESuperHUD */ = { isa = PBXNativeTarget; buildConfigurationList = 18AC6D0A1C5B902800FE881A /* Build configuration list for PBXNativeTarget "APESuperHUD" */; buildPhases = ( 18AC6CF11C5B902800FE881A /* Sources */, 18AC6CF21C5B902800FE881A /* Frameworks */, 18AC6CF31C5B902800FE881A /* Headers */, 18AC6CF41C5B902800FE881A /* Resources */, ); buildRules = ( ); dependencies = ( ); name = APESuperHUD; productName = APESuperHUD; productReference = 18AC6CF61C5B902800FE881A /* APESuperHUD.framework */; productType = "com.apple.product-type.framework"; }; 18AC6CFF1C5B902800FE881A /* APESuperHUDTests */ = { isa = PBXNativeTarget; buildConfigurationList = 18AC6D0D1C5B902800FE881A /* Build configuration list for PBXNativeTarget "APESuperHUDTests" */; buildPhases = ( 18AC6CFC1C5B902800FE881A /* Sources */, 18AC6CFD1C5B902800FE881A /* Frameworks */, 18AC6CFE1C5B902800FE881A /* Resources */, ); buildRules = ( ); dependencies = ( 18AC6D031C5B902800FE881A /* PBXTargetDependency */, ); name = APESuperHUDTests; productName = APESuperHUDTests; productReference = 18AC6D001C5B902800FE881A /* APESuperHUDTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 18AC6CED1C5B902800FE881A /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; LastUpgradeCheck = 0930; ORGANIZATIONNAME = Apegroup; TargetAttributes = { 18AC6CF51C5B902800FE881A = { CreatedOnToolsVersion = 7.2; LastSwiftMigration = 0920; }; 18AC6CFF1C5B902800FE881A = { CreatedOnToolsVersion = 7.2; LastSwiftMigration = 0920; }; }; }; buildConfigurationList = 18AC6CF01C5B902800FE881A /* Build configuration list for PBXProject "APESuperHUD" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 18AC6CEC1C5B902800FE881A; productRefGroup = 18AC6CF71C5B902800FE881A /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 18AC6CF51C5B902800FE881A /* APESuperHUD */, 18AC6CFF1C5B902800FE881A /* APESuperHUDTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 18AC6CF41C5B902800FE881A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 18C9957420404C6700DC92D3 /* APESuperHUD.xib in Resources */, 18AC6D2A1C5B90F000FE881A /* FrameworkMedia.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 18AC6CFE1C5B902800FE881A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 18AC6CF11C5B902800FE881A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 18087298204064C10031DEF4 /* HUDStyle.swift in Sources */, 18AC6D1B1C5B90D500FE881A /* HudAppearance.swift in Sources */, 18C9957320404C6700DC92D3 /* APESuperHUD.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 18AC6CFC1C5B902800FE881A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 18AC6D2D1C5B924A00FE881A /* APESuperHUDTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 18AC6D031C5B902800FE881A /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 18AC6CF51C5B902800FE881A /* APESuperHUD */; targetProxy = 18AC6D021C5B902800FE881A /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ 18AC6D081C5B902800FE881A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; 18AC6D091C5B902800FE881A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; 18AC6D0B1C5B902800FE881A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = SupportFiles/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.apegroup.APESuperHUD; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Debug; }; 18AC6D0C1C5B902800FE881A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = SupportFiles/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.apegroup.APESuperHUD; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Release; }; 18AC6D0E1C5B902800FE881A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.apegroup.APESuperHUDTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Debug; }; 18AC6D0F1C5B902800FE881A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.apegroup.APESuperHUDTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 18AC6CF01C5B902800FE881A /* Build configuration list for PBXProject "APESuperHUD" */ = { isa = XCConfigurationList; buildConfigurations = ( 18AC6D081C5B902800FE881A /* Debug */, 18AC6D091C5B902800FE881A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 18AC6D0A1C5B902800FE881A /* Build configuration list for PBXNativeTarget "APESuperHUD" */ = { isa = XCConfigurationList; buildConfigurations = ( 18AC6D0B1C5B902800FE881A /* Debug */, 18AC6D0C1C5B902800FE881A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 18AC6D0D1C5B902800FE881A /* Build configuration list for PBXNativeTarget "APESuperHUDTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 18AC6D0E1C5B902800FE881A /* Debug */, 18AC6D0F1C5B902800FE881A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 18AC6CED1C5B902800FE881A /* Project object */; } ================================================ FILE: APESuperHUD.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: APESuperHUD.xcodeproj/xcshareddata/xcschemes/APESuperHUD.xcscheme ================================================ ================================================ FILE: CHANGELOG.md ================================================ # Change Log All notable changes to this project will be documented in this file. --- ## [0.5.4](https://github.com/apegroup/APESuperHUD/releases/tag/0.5.4) Centre the icon and the loading indicator if there is no message to show. ## [0.5.3](https://github.com/apegroup/APESuperHUD/releases/tag/0.5.3) Prepare for SPM. Current version of SPM do not support UIKit. On Dec 4, 2015, at 5:39 PM, Daniel Dunbar (@apple.com) wrote: Right, now we only compile for the host platform (OS X or Linux, currently). Among other things, we currently have no knowledge (or options to choose) what SDK or architecture you are targeting. We also have no mechanisms for specifying what platforms targets are compatible with in the manifest. ## [0.5.2](https://github.com/apegroup/APESuperHUD/releases/tag/0.5.2) Adds documentation for public enums and properties. ## [0.5.1](https://github.com/apegroup/APESuperHUD/releases/tag/0.5.1) Faster display the HUD. Remove deprecations introduced in Swift 2.2. ## [0.4.1](https://github.com/apegroup/APESuperHUD/releases/tag/0.4.1) Fixes unit tests. ## [0.4](https://github.com/apegroup/APESuperHUD/releases/tag/0.4) Updates demo project due to API modifications. ## [0.3.3](https://github.com/apegroup/APESuperHUD/releases/tag/0.3.3) Deployment Target update. ## [0.3.2](https://github.com/apegroup/APESuperHUD/releases/tag/0.3.2) Bugfix cocoapods. ## [0.3.1](https://github.com/apegroup/APESuperHUD/releases/tag/0.3.1) Bugfix cocoapods. ## [0.3](https://github.com/apegroup/APESuperHUD/releases/tag/0.3) Adds the possibility to specify the HUD size in HUDAppearance. ## [0.2](https://github.com/apegroup/APESuperHUD/releases/tag/0.2) Test version. ## [0.1](https://github.com/apegroup/APESuperHUD/releases/tag/0.1) Test version. ================================================ FILE: CONTRIBUTING.md ================================================ ##Feature Request If you have any feature request, please [create a GitHub Issue](https://github.com/apegroup/APESuperHUD/issues/new) or make pull requests. ##Reporting Issues A great way to contribute to the project is to send a detailed issue when you encounter an problem. We always appreciate a well-written, thorough bug report. Check that the project issues database doesn't already include that problem or suggestion before submitting an issue. If you find a match, add a quick "+1" or "I have this problem too." Doing this helps prioritize the most common problems and requests. When reporting issues, please include the following: * The version of Xcode you're using * The version of iOS you're targeting * The full output of any stack trace or compiler error * A code snippet that reproduces the described behavior, if applicable * Any other details that would be useful in understanding the problem This information will help us review and fix your issue faster. ##Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: - (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or - (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or - (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. - (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. *References [Alamofire](https://github.com/Alamofire/Alamofire/blob/master/CONTRIBUTING.md) and [Linux](http://elinux.org/Developer_Certificate_Of_Origin)* ================================================ FILE: Demo/APESuperHUDDemo/AppDelegate.swift ================================================ // AppDelegate.swift // // The MIT License (MIT) // // Copyright (c) 2016 apegroup // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } } ================================================ FILE: Demo/APESuperHUDDemo/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "20x20", "scale" : "2x" }, { "idiom" : "iphone", "size" : "20x20", "scale" : "3x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" }, { "idiom" : "ipad", "size" : "20x20", "scale" : "1x" }, { "idiom" : "ipad", "size" : "20x20", "scale" : "2x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "1x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "2x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "1x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "2x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "1x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "2x" }, { "idiom" : "ipad", "size" : "83.5x83.5", "scale" : "2x" }, { "idiom" : "ios-marketing", "size" : "1024x1024", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Demo/APESuperHUDDemo/Assets.xcassets/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Demo/APESuperHUDDemo/Assets.xcassets/apegroup.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "filename" : "Symbol Green White.jpg", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Demo/APESuperHUDDemo/Assets.xcassets/spark.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "filename" : "spark.png", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Demo/APESuperHUDDemo/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: Demo/APESuperHUDDemo/Base.lproj/Main.storyboard ================================================ ================================================ FILE: Demo/APESuperHUDDemo/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.2.1 CFBundleSignature ???? CFBundleVersion 1 LSRequiresIPhoneOS UIAppFonts CaviarDreams.ttf UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: Demo/APESuperHUDDemo/ViewController.swift ================================================ // ViewController.swift // // The MIT License (MIT) // // Copyright (c) 2016 apegroup // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import UIKit import APESuperHUD class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Setup Appearnce setupHudAppearance() } private func setupHudAppearance() { HUDAppearance.cornerRadius = 12 HUDAppearance.animateInTime = 1.0 HUDAppearance.animateOutTime = 1.0 HUDAppearance.iconColor = UIColor(red: 38/255, green: 38/255, blue: 38/255, alpha: 1) HUDAppearance.titleTextColor = UIColor(red: 38/255, green: 38/255, blue: 38/255, alpha: 1) HUDAppearance.messageTextColor = UIColor(red: 38/255, green: 38/255, blue: 38/255, alpha: 1) HUDAppearance.loadingActivityIndicatorColor = UIColor(red: 38/255, green: 38/255, blue: 38/255, alpha: 1) HUDAppearance.cancelableOnTouch = true HUDAppearance.iconSize = CGSize(width: 40, height: 40) HUDAppearance.backgroundColor = UIColor.black.withAlphaComponent(0.3) if let messageFont = UIFont(name: "Caviar Dreams", size: 14) { HUDAppearance.messageFont = messageFont } if let titleFont = UIFont(name: "Caviar Dreams", size: 22) { HUDAppearance.titleFont = titleFont } } @IBAction func showHudWithIcon(_ sender: UIButton) { let image = UIImage(named: "apegroup")! APESuperHUD.show(style: .icon(image: image, duration: 3.0), title: "Hello", message: "world") { print("HUD dismissed") } // Or create a instance of APESuperHud /* let hudViewController = APESuperHUD(style: .icon(image: image, duration: 3), title: "Hello", message: "world") present(hudViewController, animated: true) */ } @IBAction func showHudWithLoadingIndicator(_ sender: UIButton) { APESuperHUD.show(style: .loadingIndicator(type: .standard), title: nil, message: "Loading...") DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { APESuperHUD.dismissAll(animated: true) }) // Or create a instance of APESuperHud /* let hudViewController = APESuperHUD(style: .loadingIndicator(type: .standard), title: nil, message: "Loading...") present(hudViewController, animated: true) DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { hudViewController.dismiss(animated: true) }) */ } @IBAction func showHudWithTitleAndMessage(_ sender: UIButton) { APESuperHUD.show(style: .textOnly, title: "Hello", message: "world") DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { APESuperHUD.dismissAll(animated: true) }) // Or create a instance of APESuperHud /* let hudViewController = APESuperHUD(style: .textOnly, title: "Hello", message: "world") present(hudViewController, animated: true) DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { hudViewController.dismiss(animated: true) }) */ } @IBAction func showHudWithUpdates(_ sender: UIButton) { APESuperHUD.show(style: .loadingIndicator(type: .standard), title: nil, message: "Loading...") DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { APESuperHUD.show(style: .textOnly, title: "Done loading", message: nil) DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { let image = UIImage(named: "apegroup")! APESuperHUD.show(style: .icon(image: image, duration: 3.0), title: nil, message: nil) }) }) } } ================================================ FILE: Demo/APESuperHUDDemo.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 181272911F7935C400CF834F /* APESuperHUD.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18AC6D7A1C5B947800FE881A /* APESuperHUD.framework */; }; 181272921F7935C400CF834F /* APESuperHUD.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 18AC6D7A1C5B947800FE881A /* APESuperHUD.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18AC6D631C5B942900FE881A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18AC6D621C5B942900FE881A /* AppDelegate.swift */; }; 18AC6D651C5B942900FE881A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18AC6D641C5B942900FE881A /* ViewController.swift */; }; 18AC6D681C5B942900FE881A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18AC6D661C5B942900FE881A /* Main.storyboard */; }; 18AC6D6A1C5B942900FE881A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18AC6D691C5B942900FE881A /* Assets.xcassets */; }; 18AC6D6D1C5B942900FE881A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18AC6D6B1C5B942900FE881A /* LaunchScreen.storyboard */; }; 18AC6D831C5B94B700FE881A /* CaviarDreams.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 18AC6D821C5B94B700FE881A /* CaviarDreams.ttf */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 181272931F7935C400CF834F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 18AC6D741C5B947800FE881A /* APESuperHUD.xcodeproj */; proxyType = 1; remoteGlobalIDString = 18AC6CF51C5B902800FE881A; remoteInfo = APESuperHUD; }; 18AC6D791C5B947800FE881A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 18AC6D741C5B947800FE881A /* APESuperHUD.xcodeproj */; proxyType = 2; remoteGlobalIDString = 18AC6CF61C5B902800FE881A; remoteInfo = APESuperHUD; }; 18AC6D7B1C5B947800FE881A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 18AC6D741C5B947800FE881A /* APESuperHUD.xcodeproj */; proxyType = 2; remoteGlobalIDString = 18AC6D001C5B902800FE881A; remoteInfo = APESuperHUDTests; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 181272951F7935C400CF834F /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( 181272921F7935C400CF834F /* APESuperHUD.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 18AC6D5F1C5B942900FE881A /* APESuperHUDDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = APESuperHUDDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 18AC6D621C5B942900FE881A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 18AC6D641C5B942900FE881A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 18AC6D671C5B942900FE881A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 18AC6D691C5B942900FE881A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 18AC6D6C1C5B942900FE881A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 18AC6D6E1C5B942900FE881A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 18AC6D741C5B947800FE881A /* APESuperHUD.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = APESuperHUD.xcodeproj; path = ../APESuperHUD.xcodeproj; sourceTree = ""; }; 18AC6D821C5B94B700FE881A /* CaviarDreams.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = CaviarDreams.ttf; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 18AC6D5C1C5B942900FE881A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 181272911F7935C400CF834F /* APESuperHUD.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 18AC6D561C5B942900FE881A = { isa = PBXGroup; children = ( 18AC6D741C5B947800FE881A /* APESuperHUD.xcodeproj */, 18AC6D611C5B942900FE881A /* APESuperHUDDemo */, 18AC6D601C5B942900FE881A /* Products */, ); sourceTree = ""; }; 18AC6D601C5B942900FE881A /* Products */ = { isa = PBXGroup; children = ( 18AC6D5F1C5B942900FE881A /* APESuperHUDDemo.app */, ); name = Products; sourceTree = ""; }; 18AC6D611C5B942900FE881A /* APESuperHUDDemo */ = { isa = PBXGroup; children = ( 18AC6D621C5B942900FE881A /* AppDelegate.swift */, 18AC6D691C5B942900FE881A /* Assets.xcassets */, 18AC6D821C5B94B700FE881A /* CaviarDreams.ttf */, 18AC6D6E1C5B942900FE881A /* Info.plist */, 18AC6D6B1C5B942900FE881A /* LaunchScreen.storyboard */, 18AC6D661C5B942900FE881A /* Main.storyboard */, 18AC6D641C5B942900FE881A /* ViewController.swift */, ); path = APESuperHUDDemo; sourceTree = ""; }; 18AC6D751C5B947800FE881A /* Products */ = { isa = PBXGroup; children = ( 18AC6D7A1C5B947800FE881A /* APESuperHUD.framework */, 18AC6D7C1C5B947800FE881A /* APESuperHUDTests.xctest */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 18AC6D5E1C5B942900FE881A /* APESuperHUDDemo */ = { isa = PBXNativeTarget; buildConfigurationList = 18AC6D711C5B942900FE881A /* Build configuration list for PBXNativeTarget "APESuperHUDDemo" */; buildPhases = ( 18AC6D5B1C5B942900FE881A /* Sources */, 18AC6D5C1C5B942900FE881A /* Frameworks */, 18AC6D5D1C5B942900FE881A /* Resources */, 181272951F7935C400CF834F /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( 181272941F7935C400CF834F /* PBXTargetDependency */, ); name = APESuperHUDDemo; productName = APESuperHUDDemo; productReference = 18AC6D5F1C5B942900FE881A /* APESuperHUDDemo.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 18AC6D571C5B942900FE881A /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; LastUpgradeCheck = 0900; ORGANIZATIONNAME = Apegroup; TargetAttributes = { 18AC6D5E1C5B942900FE881A = { CreatedOnToolsVersion = 7.2; DevelopmentTeam = Q48PCXNS55; LastSwiftMigration = 0900; }; }; }; buildConfigurationList = 18AC6D5A1C5B942900FE881A /* Build configuration list for PBXProject "APESuperHUDDemo" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 18AC6D561C5B942900FE881A; productRefGroup = 18AC6D601C5B942900FE881A /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = 18AC6D751C5B947800FE881A /* Products */; ProjectRef = 18AC6D741C5B947800FE881A /* APESuperHUD.xcodeproj */; }, ); projectRoot = ""; targets = ( 18AC6D5E1C5B942900FE881A /* APESuperHUDDemo */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ 18AC6D7A1C5B947800FE881A /* APESuperHUD.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = APESuperHUD.framework; remoteRef = 18AC6D791C5B947800FE881A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; 18AC6D7C1C5B947800FE881A /* APESuperHUDTests.xctest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; path = APESuperHUDTests.xctest; remoteRef = 18AC6D7B1C5B947800FE881A /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ 18AC6D5D1C5B942900FE881A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 18AC6D6D1C5B942900FE881A /* LaunchScreen.storyboard in Resources */, 18AC6D6A1C5B942900FE881A /* Assets.xcassets in Resources */, 18AC6D831C5B94B700FE881A /* CaviarDreams.ttf in Resources */, 18AC6D681C5B942900FE881A /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 18AC6D5B1C5B942900FE881A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 18AC6D651C5B942900FE881A /* ViewController.swift in Sources */, 18AC6D631C5B942900FE881A /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 181272941F7935C400CF834F /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = APESuperHUD; targetProxy = 181272931F7935C400CF834F /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 18AC6D661C5B942900FE881A /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 18AC6D671C5B942900FE881A /* Base */, ); name = Main.storyboard; sourceTree = ""; }; 18AC6D6B1C5B942900FE881A /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 18AC6D6C1C5B942900FE881A /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 18AC6D6F1C5B942900FE881A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 18AC6D701C5B942900FE881A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; 18AC6D721C5B942900FE881A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = Q48PCXNS55; INFOPLIST_FILE = APESuperHUDDemo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.apegroup.APESuperHUDDemo; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Debug; }; 18AC6D731C5B942900FE881A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = Q48PCXNS55; INFOPLIST_FILE = APESuperHUDDemo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.apegroup.APESuperHUDDemo; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 18AC6D5A1C5B942900FE881A /* Build configuration list for PBXProject "APESuperHUDDemo" */ = { isa = XCConfigurationList; buildConfigurations = ( 18AC6D6F1C5B942900FE881A /* Debug */, 18AC6D701C5B942900FE881A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 18AC6D711C5B942900FE881A /* Build configuration list for PBXNativeTarget "APESuperHUDDemo" */ = { isa = XCConfigurationList; buildConfigurations = ( 18AC6D721C5B942900FE881A /* Debug */, 18AC6D731C5B942900FE881A /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 18AC6D571C5B942900FE881A /* Project object */; } ================================================ FILE: Demo/APESuperHUDDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2016 apegroup Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Package.swift ================================================ import PackageDescription let package = Package( name: "APESuperHUD" ) ================================================ FILE: README.md ================================================ # APESuperHUD A simple way to display a HUD with a message or progress information in your application.

APESuperHUD

## Features - Simplicity. - Customizable. See [Change appearance](#change-appearance). - Fully written in Swift. - Unit tests. ## Requirements - iOS 9 or later. - Xcode 9 (Swift 4.1) or later. - For Swift 3.0 use version 1.1.3 - For Swift 2.2 use version 0.6 ## Installation #### CocoaPods You can use [CocoaPods](http://cocoapods.org/) to install `APESuperHUD` by adding it to your `Podfile`: ```ruby platform :ios, '9.0' use_frameworks! target 'MyApp' do pod 'APESuperHUD', :git => 'https://github.com/apegroup/APESuperHUD.git' end ``` Note that this requires CocoaPods version 36, and your iOS deployment target to be at least 9.0: #### Carthage You can use [Carthage](https://github.com/Carthage/Carthage) to install `APESuperHUD` by adding it to your `Cartfile`: ``` github "apegroup/APESuperHUD" ``` ## Usage Don't forget to import. ```swift import APESuperHUD ``` #### Show hud with icon ```swift let image = UIImage(named: "apegroup")! APESuperHUD.show(style: .icon(image: image, duration: 3.0), title: "Hello", message: "world") // Or create a instance of APESuperHud /* let hudViewController = APESuperHUD(style: .icon(image: image, duration: 3), title: "Hello", message: "world") present(hudViewController, animated: true) */ ``` #### Show hud with loading indicator ```swift APESuperHUD.show(style: .loadingIndicator(type: .standard), title: nil, message: "Loading...") DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { APESuperHUD.dismissAll(animated: true) }) // Or create a instance of APESuperHud /* let hudViewController = APESuperHUD(style: .loadingIndicator(type: .standard), title: nil, message: "Loading...") present(hudViewController, animated: true) DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { hudViewController.dismiss(animated: true) }) */ ``` #### Show hud with title and message ```swift APESuperHUD.show(style: .textOnly, title: "Hello", message: "world") DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { APESuperHUD.dismissAll(animated: true) }) // Or create a instance of APESuperHud /* let hudViewController = APESuperHUD(style: .textOnly, title: "Hello", message: "world") present(hudViewController, animated: true) DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { hudViewController.dismiss(animated: true) }) */ ``` #### Show hud with updates ```swift APESuperHUD.show(style: .loadingIndicator(type: .standard), title: nil, message: "Loading...") DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { APESuperHUD.show(style: .textOnly, title: "Done loading", message: nil) DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: { let image = UIImage(named: "apegroup")! APESuperHUD.show(style: .icon(image: image, duration: 3.0), title: nil, message: nil) }) }) ``` #### Change appearance ```swift /// Text color of the title text inside the HUD HUDAppearance.titleTextColor = UIColor.black /// Text color of the message text inside the HUD HUDAppearance.messageTextColor = UIColor.black /// The color of the icon in the HUD HUDAppearance.iconColor = UIColor.black /// The background color of the view where the HUD is presented HUDAppearance.backgroundColor = UIColor.black.withAlphaComponent(0.5) /// The background color of the HUD view HUDAppearance.foregroundColor = UIColor.white /// The color of the loading indicator HUDAppearance.loadingActivityIndicatorColor = UIColor.gray /// The corner radius of the HUD HUDAppearance.cornerRadius = 10.0 /// Enables/disables shadow effect around the HUD HUDAppearance.shadow = true /// The shadow color around the HUD HUDAppearance.shadowColor = UIColor.black /// The shadow offset around the HUD HUDAppearance.shadowOffset = CGSize(width: 0, height: 0) /// The shadow radius around the HUD HUDAppearance.shadowRadius = 6.0 /// The shadow opacity around the HUD HUDAppearance.shadowOpacity = 0.15 /// Enables/disables removal of the HUD if the user taps on the screen HUDAppearance.cancelableOnTouch = true /// The info message font in the HUD HUDAppearance.messageFont = UIFont.systemFont(ofSize: 13, weight: .regular) /// The title font in the HUD HUDAppearance.titleFont = UIFont.systemFont(ofSize: 20, weight: .bold) /// The size of the icon inside the HUD HUDAppearance.iconSize = CGSize(width: 48, height: 48) /// The HUD size HUDAppearance.hudSize = CGSize(width: 144, height: 144) /// The HUD fade in duration HUDAppearance.animateInTime = 0.7 /// The HUD fade out duration HUDAppearance.animateOutTime = 0.7 ``` ## Contributing All people are welcome to contribute. See CONTRIBUTING for details. ## License APESuperHUD is released under the MIT license. See LICENSE for details. ================================================ FILE: Resources/APESuperHUD.xib ================================================ ================================================ FILE: Resources/FrameworkMedia.xcassets/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Resources/FrameworkMedia.xcassets/checkmark_icon.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "filename" : "checkmark_icon.pdf", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" }, "properties" : { "template-rendering-intent" : "template" } } ================================================ FILE: Resources/FrameworkMedia.xcassets/email_icon.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "filename" : "email_icon.pdf", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" }, "properties" : { "template-rendering-intent" : "template" } } ================================================ FILE: Resources/FrameworkMedia.xcassets/happy_face_icon.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "filename" : "happy_face_icon.pdf", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" }, "properties" : { "template-rendering-intent" : "template" } } ================================================ FILE: Resources/FrameworkMedia.xcassets/info_icon.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "filename" : "info_icon.pdf", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" }, "properties" : { "template-rendering-intent" : "template" } } ================================================ FILE: Resources/FrameworkMedia.xcassets/sad_face_icon.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "filename" : "sad_face_icon.pdf", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" }, "properties" : { "template-rendering-intent" : "template" } } ================================================ FILE: Source/APESuperHUD.h ================================================ // APESuperHUD.h // // The MIT License (MIT) // // Copyright (c) 2016 apegroup // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #import //! Project version number for APESuperHUD. FOUNDATION_EXPORT double APESuperHUDVersionNumber; //! Project version string for APESuperHUD. FOUNDATION_EXPORT const unsigned char APESuperHUDVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import ================================================ FILE: Source/APESuperHUD.swift ================================================ // APESuperHUD.swift // // The MIT License (MIT) // // Copyright (c) 2016 apegroup // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import UIKit public class APESuperHUD: UIViewController { @IBOutlet private weak var hudView: UIView! @IBOutlet private weak var hudViewWidthConstraint: NSLayoutConstraint! @IBOutlet private weak var hudViewHeightConstraint: NSLayoutConstraint! @IBOutlet private weak var stackView: UIStackView! @IBOutlet private weak var loadingIndicatorView: UIActivityIndicatorView! @IBOutlet private weak var iconContainerView: UIView! @IBOutlet private weak var iconImageView: UIImageView! @IBOutlet private weak var iconWidthConstraint: NSLayoutConstraint! @IBOutlet private weak var iconHeightConstraint: NSLayoutConstraint! @IBOutlet private weak var titleLabel: UILabel! @IBOutlet private weak var messageLabel: UILabel! public var style: HUDStyle { didSet { setStyle(oldValue: oldValue, animated: true) } } private var window: UIWindow? private var _title: String? { didSet { if oldValue == _title { return } UIView.animate(withDuration: HUDAppearance.animateOutTime, animations: { self.titleLabel.alpha = 0 }, completion: { isFinished in guard isFinished else { return } self.titleLabel.text = self._title UIView.animate(withDuration: HUDAppearance.animateInTime, animations: { self.titleLabel.alpha = 1 }) }) } } public override var title: String? { get { return _title } set { _title = newValue } } public var message: String? { didSet { if oldValue == message { return } UIView.animate(withDuration: HUDAppearance.animateOutTime, animations: { self.messageLabel.alpha = 0 }, completion: { isFinished in guard isFinished else { return } self.messageLabel.text = self.message UIView.animate(withDuration: HUDAppearance.animateInTime, animations: { self.messageLabel.alpha = 1 }) }) } } public var duration: TimeInterval? { if case let .icon(tuple) = style { return tuple.duration } else { return nil } } private static var window: UIWindow? private var dismissTask: DispatchWorkItem? private var completionBlock: (() -> Void)? public init(style: HUDStyle, title: String? = nil, message: String? = nil, completion: (() -> Void)? = nil) { self.style = style self._title = title self.message = message self.completionBlock = completion let nibName = String(describing: type(of: self)) let bundle = Bundle(for: APESuperHUD.self) super.init(nibName: nibName, bundle: bundle) modalPresentationStyle = .overFullScreen modalTransitionStyle = .crossDissolve startDismissTimer() } public static func show(style: HUDStyle, title: String? = nil, message: String? = nil, completion: (() -> Void)? = nil) { if let vc = UIApplication.shared.windows.map({ $0.rootViewController }).compactMap({ $0 as? APESuperHUD }).first { vc.style = style vc.title = title vc.message = message vc.completionBlock = completion } else { let vc = APESuperHUD(style: style, title: title, message: message, completion: completion) let window = UIWindow(frame: UIScreen.main.bounds) window.backgroundColor = .clear window.rootViewController = vc window.makeKeyAndVisible() self.window = window } } public required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } public override func viewDidLoad() { super.viewDidLoad() hudView.alpha = 0 titleLabel.textColor = HUDAppearance.titleTextColor messageLabel.textColor = HUDAppearance.messageTextColor view.backgroundColor = HUDAppearance.backgroundColor hudView.backgroundColor = HUDAppearance.foregroundColor loadingIndicatorView.color = HUDAppearance.loadingActivityIndicatorColor hudView.layer.masksToBounds = true hudView.layer.cornerRadius = HUDAppearance.cornerRadius if HUDAppearance.shadow { hudView.layer.shadowColor = HUDAppearance.shadowColor.cgColor hudView.layer.shadowOffset = HUDAppearance.shadowOffset hudView.layer.shadowRadius = HUDAppearance.shadowRadius hudView.layer.shadowOpacity = HUDAppearance.shadowOpacity hudView.clipsToBounds = false } iconImageView.tintColor = HUDAppearance.iconColor messageLabel.font = HUDAppearance.messageFont titleLabel.font = HUDAppearance.titleFont iconWidthConstraint.constant = HUDAppearance.iconSize.width iconHeightConstraint.constant = HUDAppearance.iconSize.height hudViewWidthConstraint.constant = HUDAppearance.hudSize.width hudViewHeightConstraint.constant = HUDAppearance.hudSize.height setStyle(animated: false) titleLabel.text = _title messageLabel.text = message } public override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) animateInHud() } private func animateInHud() { hudView.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) view.layoutIfNeeded() UIView.animate(withDuration: HUDAppearance.animateInTime, delay: 0.0, usingSpringWithDamping: 0.6, initialSpringVelocity: 0, options: .curveEaseIn, animations: { [weak self] in self?.hudView.alpha = 1.0 self?.view.alpha = 1.0 self?.hudView.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) self?.view.layoutIfNeeded() } ) } public override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) { if flag { UIView.animate(withDuration: HUDAppearance.animateOutTime, animations: { self.hudView.alpha = 0 self.view.alpha = 0 }, completion: { isFinished in self.completionBlock?() if isFinished { if APESuperHUD.window != nil { completion?() APESuperHUD.window = nil } super.dismiss(animated: flag, completion: completion) } }) } else { completionBlock?() if APESuperHUD.window != nil { completion?() APESuperHUD.window = nil } super.dismiss(animated: flag, completion: completion) } } private func startDismissTimer() { self.dismissTask?.cancel() guard let duration = duration else { return } let dismissTask = DispatchWorkItem { [weak self] in self?.dismiss(animated: true) } DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + duration, execute: dismissTask) self.dismissTask = dismissTask } public static func dismissAll(animated flag: Bool, completion: (() -> Void)? = nil) { if let vc = UIApplication.shared.windows.map({ $0.rootViewController }).compactMap({ $0 as? APESuperHUD }).first { vc.dismiss(animated: flag, completion: completion) } } @IBAction func didTapView(_ sender: UITapGestureRecognizer) { if duration != nil { return } if HUDAppearance.cancelableOnTouch { dismissTask?.cancel() dismiss(animated: true) } } private func setStyle(oldValue: HUDStyle? = nil, animated: Bool) { switch style { case .icon(let tuple): if let oldValue = oldValue, case let .icon(oldTuple) = oldValue, oldTuple.image == tuple.image { return } if animated { let delay = loadingIndicatorView.alpha == 0 && iconImageView.alpha == 0 ? HUDAppearance.animateOutTime : 0 UIView.animate(withDuration: HUDAppearance.animateOutTime, animations: { self.loadingIndicatorView.alpha = 0 self.iconImageView.alpha = 0 }, completion: { isFinished in guard isFinished else { return } DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + delay, execute: { self.iconImageView.image = tuple.image self.iconImageView.isHidden = false self.iconContainerView.isHidden = false self.loadingIndicatorView.isHidden = true UIView.animate(withDuration: HUDAppearance.animateInTime, animations: { self.iconImageView.alpha = 1 self.iconContainerView.alpha = 1 }) self.startDismissTimer() }) }) } else { loadingIndicatorView.isHidden = true iconImageView.isHidden = false iconContainerView.isHidden = false iconImageView.image = tuple.image } case .loadingIndicator(_): if let oldValue = oldValue, case .loadingIndicator = oldValue { return } if animated { let delay = loadingIndicatorView.alpha == 0 && iconImageView.alpha == 0 ? HUDAppearance.animateOutTime : 0 UIView.animate(withDuration: HUDAppearance.animateOutTime, animations: { self.loadingIndicatorView.alpha = 0 self.iconImageView.alpha = 0 }, completion: { isFinished in guard isFinished else { return } DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + delay, execute: { self.loadingIndicatorView.isHidden = false self.iconImageView.isHidden = true UIView.animate(withDuration: HUDAppearance.animateInTime, animations: { self.loadingIndicatorView.alpha = 1 }) self.startDismissTimer() }) }) } else { iconImageView.isHidden = true loadingIndicatorView.isHidden = false iconContainerView.isHidden = true } case .textOnly: if animated { let delay = loadingIndicatorView.alpha == 0 && iconImageView.alpha == 0 && iconContainerView.alpha == 0 ? HUDAppearance.animateOutTime : 0 UIView.animate(withDuration: HUDAppearance.animateOutTime, animations: { self.loadingIndicatorView.alpha = 0 self.iconImageView.alpha = 0 self.iconContainerView.alpha = 0 }, completion: { isFinished in guard isFinished else { return } DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + delay, execute: { self.loadingIndicatorView.isHidden = true self.iconImageView.isHidden = true self.iconContainerView.isHidden = true self.startDismissTimer() }) }) } else { loadingIndicatorView.isHidden = true iconImageView.isHidden = true iconContainerView.isHidden = true } } } } #if swift(>=4.1) #elseif swift(>=4.2) #warning("Remove this once we've updated.") #else extension Collection { func compactMap( _ transform: (Element) throws -> ElementOfResult? ) rethrows -> [ElementOfResult] { return try flatMap(transform) } } #endif ================================================ FILE: Source/HUDStyle.swift ================================================ // HUDType.swift // // The MIT License (MIT) // // Copyright (c) 2016 apegroup // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import Foundation public enum HUDStyle { case icon(image: UIImage, duration: TimeInterval?) case loadingIndicator(type: LoadingIndicatorType) case textOnly } /** Layout of the loading indicator - Standard: Apple standard spinner loading indicator. */ public enum LoadingIndicatorType: Int { case standard } ================================================ FILE: Source/HudAppearance.swift ================================================ // HUDAppearance.swift // // The MIT License (MIT) // // Copyright (c) 2016 apegroup // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import UIKit public struct HUDAppearance { private init() {} /// Text color of the title text inside the HUD public static var titleTextColor = UIColor.black /// Text color of the message text inside the HUD public static var messageTextColor = UIColor.black /// The color of the icon in the HUD public static var iconColor = UIColor.black /// The background color of the view where the HUD is presented public static var backgroundColor = UIColor.black.withAlphaComponent(0.5) /// The background color of the HUD view public static var foregroundColor = UIColor.white /// The color of the loading indicator public static var loadingActivityIndicatorColor = UIColor.gray /// The corner radius of the HUD public static var cornerRadius: CGFloat = 10 /// Enables/disables shadow effect around the HUD public static var shadow: Bool = true /// The shadow color around the HUD public static var shadowColor: UIColor = UIColor.black /// The shadow offset around the HUD public static var shadowOffset: CGSize = CGSize(width: 0, height: 0) /// The shadow radius around the HUD public static var shadowRadius: CGFloat = 6.0 /// The shadow opacity around the HUD public static var shadowOpacity: Float = 0.15 /// Enables/disables removal of the HUD if the user taps on the screen public static var cancelableOnTouch = true // false /// The info message font in the HUD public static var messageFont = UIFont.systemFont(ofSize: 13, weight: .regular) /// The title font in the HUD public static var titleFont = UIFont.systemFont(ofSize: 20, weight: .bold) /// The size of the icon inside the HUD public static var iconSize = CGSize(width: 48, height: 48) /// The HUD size public static var hudSize = CGSize(width: 144, height: 144) /// The HUD fade in duration public static var animateInTime: TimeInterval = 0.7 /// The HUD fade out duration public static var animateOutTime: TimeInterval = 0.7 } ================================================ FILE: SupportFiles/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 1.1.2 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: Tests/APESuperHUDTests.swift ================================================ // APESuperHUDTests.swift // // The MIT License (MIT) // // Copyright (c) 2016 apegroup // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. import XCTest @testable import APESuperHUD class APESuperHUDTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } // WIP } ================================================ FILE: Tests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1