Skip to content

Commit

Permalink
fix Issues #5,6,7
Browse files Browse the repository at this point in the history
  • Loading branch information
leoru committed Oct 9, 2015
1 parent 988a4a8 commit b862366
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0610;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "Kirill Kunst";
TargetAttributes = {
6A7E7AF61A8B62AB00B7F3B2 = {
Expand Down Expand Up @@ -192,6 +192,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -257,6 +258,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = SwiftLoaderExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kunst.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -267,6 +269,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = SwiftLoaderExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kunst.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,54 @@
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../../src/SwiftLoader/SwiftLoader.swift"
timestampString = "466114447.732314"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "66"
endingLineNumber = "66"
landmarkName = "show(title:animated:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../../src/SwiftLoader/SwiftLoader.swift"
timestampString = "466114447.732314"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "115"
endingLineNumber = "115"
landmarkName = "stop()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "SwiftLoaderExample/ViewController.swift"
timestampString = "466114458.372446"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "39"
endingLineNumber = "39"
landmarkName = "actionShowLoader()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -37,10 +37,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -62,17 +62,21 @@
ReferencedContainer = "container:SwiftLoaderExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6A7E7AF61A8B62AB00B7F3B2"
Expand All @@ -85,12 +89,13 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6A7E7AF61A8B62AB00B7F3B2"
Expand Down
2 changes: 1 addition & 1 deletion example/SwiftLoaderExample/SwiftLoaderExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.kunst.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
16 changes: 8 additions & 8 deletions src/SwiftLoader/SwiftLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class SwiftLoader: UIView {
private var coverView : UIView?
private var titleLabel : UILabel?
private var loadingView : SwiftLoadingView?
private var animated : Bool?
private var animated : Bool = true
private var canUpdated = false
private var title: String?

Expand Down Expand Up @@ -47,6 +47,7 @@ public class SwiftLoader: UIView {
}

public class func show(title title: String?, animated : Bool) {

let currentWindow : UIWindow = UIApplication.sharedApplication().keyWindow!

let loader = SwiftLoader.sharedInstance
Expand All @@ -58,17 +59,16 @@ public class SwiftLoader: UIView {
let height : CGFloat = UIScreen.mainScreen().bounds.size.height
let width : CGFloat = UIScreen.mainScreen().bounds.size.width
let center : CGPoint = CGPointMake(width / 2.0, height / 2.0)
loader.center = center

loader.coverView = UIView(frame: currentWindow.bounds)
loader.coverView?.backgroundColor = loader.config.foregroundColor.colorWithAlphaComponent(loader.config.foregroundAlpha)
loader.center = center

if (loader.superview == nil) {
loader.coverView = UIView(frame: currentWindow.bounds)
loader.coverView?.backgroundColor = loader.config.foregroundColor.colorWithAlphaComponent(loader.config.foregroundAlpha)

currentWindow.addSubview(loader.coverView!)
currentWindow.addSubview(loader)
loader.start()
} else {
loader.coverView?.removeFromSuperview()
}
}

Expand All @@ -95,7 +95,7 @@ public class SwiftLoader: UIView {
private func start() {
self.loadingView?.start()

if (self.animated!) {
if (self.animated) {
UIView.animateWithDuration(0.3, animations: { () -> Void in
self.alpha = 1
}, completion: { (finished) -> Void in
Expand All @@ -108,7 +108,7 @@ public class SwiftLoader: UIView {

private func stop() {

if (self.animated!) {
if (self.animated) {
UIView.animateWithDuration(0.3, animations: { () -> Void in
self.alpha = 0
}, completion: { (finished) -> Void in
Expand Down

0 comments on commit b862366

Please sign in to comment.