Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small sized icons - fixed #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Tab Bar Center Tab.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
822C81EB1A96F0AD00F6F217 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0610;
ORGANIZATIONNAME = videmor;
TargetAttributes = {
Expand Down Expand Up @@ -405,6 +406,7 @@
822C82141A96F0AD00F6F217 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
822C82151A96F0AD00F6F217 /* Build configuration list for PBXNativeTarget "Tab Bar Center TabTests" */ = {
isa = XCConfigurationList;
Expand All @@ -413,6 +415,7 @@
822C82171A96F0AD00F6F217 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "822C81F21A96F0AD00F6F217"
BuildableName = "Tab Bar Center Tab.app"
BlueprintName = "Tab Bar Center Tab"
ReferencedContainer = "container:Tab Bar Center Tab.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "822C82071A96F0AD00F6F217"
BuildableName = "Tab Bar Center TabTests.xctest"
BlueprintName = "Tab Bar Center TabTests"
ReferencedContainer = "container:Tab Bar Center Tab.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "822C81F21A96F0AD00F6F217"
BuildableName = "Tab Bar Center Tab.app"
BlueprintName = "Tab Bar Center Tab"
ReferencedContainer = "container:Tab Bar Center Tab.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "822C81F21A96F0AD00F6F217"
BuildableName = "Tab Bar Center Tab.app"
BlueprintName = "Tab Bar Center Tab"
ReferencedContainer = "container:Tab Bar Center Tab.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "822C81F21A96F0AD00F6F217"
BuildableName = "Tab Bar Center Tab.app"
BlueprintName = "Tab Bar Center Tab"
ReferencedContainer = "container:Tab Bar Center Tab.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>Tab Bar Center Tab.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>822C81F21A96F0AD00F6F217</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>822C82071A96F0AD00F6F217</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
5 changes: 3 additions & 2 deletions Tab Bar Center Tab/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="sXF-Dt-dRc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="sXF-Dt-dRc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand Down
11 changes: 7 additions & 4 deletions Tab Bar Center Tab/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ViewController: UIViewController {
self.tabBarController?.tabBar.layer.borderWidth = 0
self.tabBarController?.tabBar.layer.borderColor = self.tabBarController?.tabBar.tintColor.CGColor

self.addCenterButtonWithImage(UIImage(named: "camera_button_take.png")!, highlightImage: nil)
self.addCenterButtonWithImage(UIImage(named: "capture-button.png")!, highlightImage: nil)
// [self addCenterButtonWithImage:[UIImage imageNamed:@"capture-button.png"] highlightImage:nil];
}

Expand All @@ -34,8 +34,8 @@ class ViewController: UIViewController {
}

func addCenterButtonWithImage(buttonImage: UIImage, highlightImage: UIImage?){
let button = UIButton.buttonWithType(UIButtonType.Custom) as UIButton
button.autoresizingMask = UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleTopMargin
let button = UIButton(type: UIButtonType.Custom) as UIButton
button.autoresizingMask = [UIViewAutoresizing.FlexibleRightMargin, UIViewAutoresizing.FlexibleLeftMargin,UIViewAutoresizing.FlexibleTopMargin,UIViewAutoresizing.FlexibleBottomMargin]

button.frame = CGRectMake(0, 0, buttonImage.size.width, buttonImage.size.height)
button.setBackgroundImage(buttonImage, forState: UIControlState.Normal)
Expand All @@ -45,7 +45,10 @@ class ViewController: UIViewController {
var heightDifference: CGFloat = buttonImage.size.height - self.tabBarController!.tabBar.frame.size.height

if (heightDifference < 0){
button.center = self.tabBarController!.tabBar.center
// button.center = self.tabBarController!.tabBar.center
var center: CGPoint = self.tabBarController!.tabBar.center
center.y = (center.y ) - self.tabBarController!.tabBar.frame.origin.y
button.center = center
}else{
var center: CGPoint = self.tabBarController!.tabBar.center
center.y = center.y - self.tabBarController!.tabBar.frame.origin.y - heightDifference/2.0
Expand Down