Skip to content

Commit

Permalink
Added unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krimpedance committed May 19, 2017
1 parent 5cc8b20 commit 6deeeb6
Show file tree
Hide file tree
Showing 5 changed files with 310 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "krimpedance/KRActivityIndicatorView" "2.0.1"
github "krimpedance/KRActivityIndicatorView" "2.0.2"
2 changes: 1 addition & 1 deletion KRProgressHUD.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/krimpedance/KRProgressHUD.git", :tag => s.version.to_s }
s.source_files = "KRProgressHUD/**/*.swift"

s.dependency "KRActivityIndicator", "~> 2.0.1"
s.dependency "KRActivityIndicator", "~> 2.0.2"
end
12 changes: 12 additions & 0 deletions KRProgressHUD.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
4BA70C341D02F28D009EB743 /* KRProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BA70C331D02F28D009EB743 /* KRProgressHUD.h */; settings = {ATTRIBUTES = (Public, ); }; };
4BA70C431D02F2ED009EB743 /* KRProgressHUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BA70C3F1D02F2ED009EB743 /* KRProgressHUD.swift */; };
4BA70C441D02F2ED009EB743 /* KRProgressHUDIconType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BA70C401D02F2ED009EB743 /* KRProgressHUDIconType.swift */; };
6B8AE6981ECE793600CE27A8 /* KRActivityIndicatorView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BD5F7C71EC3F3E4007A502E /* KRActivityIndicatorView.framework */; };
6BD5F7C81EC3F3E4007A502E /* KRActivityIndicatorView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BD5F7C71EC3F3E4007A502E /* KRActivityIndicatorView.framework */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -47,6 +48,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
6B8AE6981ECE793600CE27A8 /* KRActivityIndicatorView.framework in Frameworks */,
4B7576E21D1BCD56003FF258 /* KRProgressHUD.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -278,9 +280,14 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = KRProgressHUDTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/Carthage/Build/iOS";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = jp.mond.krimpedance.KRProgressHUDTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
Expand All @@ -292,6 +299,10 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = KRProgressHUDTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(PROJECT_DIR)/Carthage/Build/iOS";
Expand Down Expand Up @@ -417,6 +428,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = jp.mond.krimpedance.KRProgressHUD;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down
7 changes: 5 additions & 2 deletions KRProgressHUD/Classes/InnerKRProgressHUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ extension KRProgressHUD {
hudView.autoresizingMask = [.flexibleTopMargin, .flexibleBottomMargin,
.flexibleLeftMargin, .flexibleRightMargin]

iconView.frame = CGRect(origin: iconViewCenter, size: iconViewSize)
iconView.frame.size = iconViewSize
iconView.center = iconViewCenter
iconView.backgroundColor = .clear
iconView.isHidden = false

activityIndicatorView.frame.size = iconViewSize
activityIndicatorView.isLarge = true
Expand All @@ -58,6 +60,7 @@ extension KRProgressHUD {
messageLabel.textAlignment = .center
messageLabel.adjustsFontSizeToFitWidth = true
messageLabel.minimumScaleFactor = 0.5
messageLabel.numberOfLines = 1

iconDrawingView.layer.addSublayer(iconDrawingLayer)
iconView.addSubview(imageView)
Expand Down Expand Up @@ -99,7 +102,7 @@ extension KRProgressHUD {

// MARK: - Private actions --------------------------

fileprivate extension KRProgressHUD {
extension KRProgressHUD {
func cancelCurrentDismissHandler() -> Bool {
guard let handler = dismissHandler else { return true }
defer { dismissHandler = nil }
Expand Down
Loading

0 comments on commit 6deeeb6

Please sign in to comment.