Skip to content

Commit

Permalink
demo gif added
Browse files Browse the repository at this point in the history
  • Loading branch information
Cem Olcay authored and Cem Olcay committed Dec 16, 2014
1 parent d377200 commit 0c5e9f4
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>6774D07C-128B-4F7B-B21C-D644FC78E932</string>
<key>IDESourceControlProjectName</key>
<string>BubbleControl-Swift</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>AC1D7CE64D2EF7E33ADE8B45A6E7F6CF2516B52F</key>
<string>https://github.com/cemolcay/BubbleControl-Swift.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>BubbleControl-Swift.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>AC1D7CE64D2EF7E33ADE8B45A6E7F6CF2516B52F</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/cemolcay/BubbleControl-Swift.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>AC1D7CE64D2EF7E33ADE8B45A6E7F6CF2516B52F</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>AC1D7CE64D2EF7E33ADE8B45A6E7F6CF2516B52F</string>
<key>IDESourceControlWCCName</key>
<string>BubbleControl-Swift</string>
</dict>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B27A54351A39953B00F18798"
BuildableName = "BubbleControl-Swift.app"
BlueprintName = "BubbleControl-Swift"
ReferencedContainer = "container:BubbleControl-Swift.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B27A544A1A39953B00F18798"
BuildableName = "BubbleControl-SwiftTests.xctest"
BlueprintName = "BubbleControl-SwiftTests"
ReferencedContainer = "container:BubbleControl-Swift.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B27A544A1A39953B00F18798"
BuildableName = "BubbleControl-SwiftTests.xctest"
BlueprintName = "BubbleControl-SwiftTests"
ReferencedContainer = "container:BubbleControl-Swift.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B27A54351A39953B00F18798"
BuildableName = "BubbleControl-Swift.app"
BlueprintName = "BubbleControl-Swift"
ReferencedContainer = "container:BubbleControl-Swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B27A54351A39953B00F18798"
BuildableName = "BubbleControl-Swift.app"
BlueprintName = "BubbleControl-Swift"
ReferencedContainer = "container:BubbleControl-Swift.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B27A54351A39953B00F18798"
BuildableName = "BubbleControl-Swift.app"
BlueprintName = "BubbleControl-Swift"
ReferencedContainer = "container:BubbleControl-Swift.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>BubbleControl-Swift.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>B27A54351A39953B00F18798</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>B27A544A1A39953B00F18798</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
15 changes: 10 additions & 5 deletions BubbleControl-Swift/BubbleControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -648,20 +648,25 @@ class BubbleControl: UIControl {

func openContentView () {
if let v = contentView {
APPDELEGATE.window!.addSubview(v)
let win = APPDELEGATE.window!
win.addSubview(v)
win.bringSubviewToFront(self)

snapOffset = snapOffsetMin
snap()
positionBeforeToggle = frame.origin

if let anim = setOpenAnimation {
anim (contentView: v, backgroundView: APPDELEGATE.window?.subviews[0] as? UIView)
anim (contentView: v, backgroundView: win.subviews[0] as? UIView)
} else {
v.bottom = APPDELEGATE.window!.bottom
v.bottom = win.bottom
}

moveY(v.top - h - snapOffset)
APPDELEGATE.window?.bringSubviewToFront(self)
if movesBottom {
movePoint(CGPoint (x: win.center.x - w/2, y: win.bottom - h - snapOffset))
} else {
moveY(v.top - h - snapOffset)
}
}
}

Expand Down
7 changes: 3 additions & 4 deletions BubbleControl-Swift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,21 @@ class ViewController: UIViewController {
self.bubble!.popFromNavBar()
}


bubble.setOpenAnimation = { content, background in
self.bubble.contentView!.bottom = win.bottom
if (self.bubble.center.x > win.center.x) {
self.bubble.contentView!.left = win.right
self.bubble.contentView!.spring({ () -> Void in
self.bubble.contentView!.right = win.right
}, completion: nil)
}, completion: nil)
} else {
self.bubble.contentView!.right = win.left
self.bubble.contentView!.spring({ () -> Void in
self.bubble.contentView!.left = win.left
}, completion: nil)
}, completion: nil)
}
}


let min: CGFloat = 50
let max: CGFloat = win.h - 250
Expand Down
Binary file added demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0c5e9f4

Please sign in to comment.