Skip to content

Commit

Permalink
Added move animations, and code for removing tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
graetzer committed Jun 8, 2012
1 parent 6adcad0 commit c47c373
Show file tree
Hide file tree
Showing 17 changed files with 389 additions and 199 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ build/*
xcuserdata
profile
*.moved-aside

Demo/.DS_Store

.DS_Store
37 changes: 25 additions & 12 deletions Demo/SGTabs.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
F470D28F1580EA5100ED3644 /* SGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F470D28E1580EA5100ED3644 /* SGAppDelegate.m */; };
F470D2921580EA5100ED3644 /* SGViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F470D2911580EA5100ED3644 /* SGViewController.m */; };
F470D2951580EA5100ED3644 /* SGViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = F470D2931580EA5100ED3644 /* SGViewController_iPhone.xib */; };
F470D2981580EA5100ED3644 /* SGViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = F470D2961580EA5100ED3644 /* SGViewController_iPad.xib */; };
F470D2A91580EAD700ED3644 /* SGTabsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F470D2A81580EAD700ED3644 /* SGTabsViewController.m */; };
F470D2AC1580ECDB00ED3644 /* SGTabsView.m in Sources */ = {isa = PBXBuildFile; fileRef = F470D2AB1580ECDB00ED3644 /* SGTabsView.m */; };
F470D2AF1580ECE700ED3644 /* SGTabView.m in Sources */ = {isa = PBXBuildFile; fileRef = F470D2AE1580ECE700ED3644 /* SGTabView.m */; };
Expand All @@ -36,7 +35,6 @@
F470D2901580EA5100ED3644 /* SGViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SGViewController.h; sourceTree = "<group>"; };
F470D2911580EA5100ED3644 /* SGViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SGViewController.m; sourceTree = "<group>"; };
F470D2941580EA5100ED3644 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/SGViewController_iPhone.xib; sourceTree = "<group>"; };
F470D2971580EA5100ED3644 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/SGViewController_iPad.xib; sourceTree = "<group>"; };
F470D2A71580EAD700ED3644 /* SGTabsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGTabsViewController.h; sourceTree = "<group>"; };
F470D2A81580EAD700ED3644 /* SGTabsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGTabsViewController.m; sourceTree = "<group>"; };
F470D2AA1580ECDB00ED3644 /* SGTabsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGTabsView.h; sourceTree = "<group>"; };
Expand All @@ -45,6 +43,14 @@
F470D2AE1580ECE700ED3644 /* SGTabView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGTabView.m; sourceTree = "<group>"; };
F470D2B01580ED3000ED3644 /* SGTabsTopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGTabsTopView.h; sourceTree = "<group>"; };
F470D2B11580ED3000ED3644 /* SGTabsTopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGTabsTopView.m; sourceTree = "<group>"; };
F476BFBF15816C8E00BABEEB /* SGTabView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGTabView.h; sourceTree = "<group>"; };
F476BFC015816C8E00BABEEB /* SGTabView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGTabView.m; sourceTree = "<group>"; };
F476BFC115816C8E00BABEEB /* SGTabsTopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGTabsTopView.h; sourceTree = "<group>"; };
F476BFC215816C8E00BABEEB /* SGTabsTopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGTabsTopView.m; sourceTree = "<group>"; };
F476BFC315816C8E00BABEEB /* SGTabsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGTabsView.h; sourceTree = "<group>"; };
F476BFC415816C8E00BABEEB /* SGTabsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGTabsView.m; sourceTree = "<group>"; };
F476BFC515816C8E00BABEEB /* SGTabsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGTabsViewController.h; sourceTree = "<group>"; };
F476BFC615816C8E00BABEEB /* SGTabsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGTabsViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -97,7 +103,7 @@
F470D2901580EA5100ED3644 /* SGViewController.h */,
F470D2911580EA5100ED3644 /* SGViewController.m */,
F470D2931580EA5100ED3644 /* SGViewController_iPhone.xib */,
F470D2961580EA5100ED3644 /* SGViewController_iPad.xib */,
F476BFBE15816C8E00BABEEB /* Source */,
F470D2851580EA5100ED3644 /* Supporting Files */,
);
name = Demo;
Expand Down Expand Up @@ -131,6 +137,22 @@
path = ../Source;
sourceTree = "<group>";
};
F476BFBE15816C8E00BABEEB /* Source */ = {
isa = PBXGroup;
children = (
F476BFBF15816C8E00BABEEB /* SGTabView.h */,
F476BFC015816C8E00BABEEB /* SGTabView.m */,
F476BFC115816C8E00BABEEB /* SGTabsTopView.h */,
F476BFC215816C8E00BABEEB /* SGTabsTopView.m */,
F476BFC315816C8E00BABEEB /* SGTabsView.h */,
F476BFC415816C8E00BABEEB /* SGTabsView.m */,
F476BFC515816C8E00BABEEB /* SGTabsViewController.h */,
F476BFC615816C8E00BABEEB /* SGTabsViewController.m */,
);
name = Source;
path = ../../Source;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -185,7 +207,6 @@
files = (
F470D2891580EA5100ED3644 /* InfoPlist.strings in Resources */,
F470D2951580EA5100ED3644 /* SGViewController_iPhone.xib in Resources */,
F470D2981580EA5100ED3644 /* SGViewController_iPad.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -225,14 +246,6 @@
name = SGViewController_iPhone.xib;
sourceTree = "<group>";
};
F470D2961580EA5100ED3644 /* SGViewController_iPad.xib */ = {
isa = PBXVariantGroup;
children = (
F470D2971580EA5100ED3644 /* en */,
);
name = SGViewController_iPad.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
Expand Down
16 changes: 15 additions & 1 deletion Demo/SGTabs/SGAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,21 @@
// SGTabs
//
// Created by simon on 07.06.12.
// Copyright (c) 2012 Cybercon GmbH. All rights reserved.
//
//
// Copyright (c) 2012 Simon Grätzer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import <UIKit/UIKit.h>
Expand Down
18 changes: 16 additions & 2 deletions Demo/SGTabs/SGAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,21 @@
// SGTabs
//
// Created by simon on 07.06.12.
// Copyright (c) 2012 Cybercon GmbH. All rights reserved.
//
//
// Copyright (c) 2012 Simon Grätzer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "SGAppDelegate.h"
Expand All @@ -30,7 +44,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[self.window makeKeyAndVisible];
[self.viewController addBlankTab:@"Hello World"];

timer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(openTab) userInfo:nil repeats:YES];
timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(openTab) userInfo:nil repeats:YES];

return YES;
}
Expand Down
16 changes: 15 additions & 1 deletion Demo/SGTabs/SGViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,21 @@
// SGTabs
//
// Created by simon on 07.06.12.
// Copyright (c) 2012 Cybercon GmbH. All rights reserved.
//
//
// Copyright (c) 2012 Simon Grätzer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import <UIKit/UIKit.h>
Expand Down
16 changes: 15 additions & 1 deletion Demo/SGTabs/SGViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,21 @@
// SGTabs
//
// Created by simon on 07.06.12.
// Copyright (c) 2012 Cybercon GmbH. All rights reserved.
//
//
// Copyright (c) 2012 Simon Grätzer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "SGViewController.h"
Expand Down
120 changes: 0 additions & 120 deletions Demo/SGTabs/en.lproj/SGViewController_iPad.xib

This file was deleted.

2 changes: 1 addition & 1 deletion Demo/SGTabs/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SGTabs
//
// Created by simon on 07.06.12.
// Copyright (c) 2012 Cybercon GmbH. All rights reserved.
// Copyright (c) 2012 Simon Grätzer. All rights reserved.
//

#import <UIKit/UIKit.h>
Expand Down
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
SGTabs
======
# SGTabs

Tab component for iOS 5+. You can show your ViewControllers in tabs, it is possible to add and remove tabs on the fly
Tab component for iOS 5+. You can show your ViewControllers in tabs, it is possible to add and remove tabs on the fly



# Licence
I provider my code under the Apache Licence.
Credits go to [Fictorial LLC][https://github.com/fictorial/BHTabBar], my tab control implementation is spired by BHTabBar


Copyright 2012 Simon Grätzer

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
19 changes: 17 additions & 2 deletions Source/SGTabView.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,23 @@
// SGTabs
//
// Created by simon on 07.06.12.
// Copyright (c) 2012 Cybercon GmbH. All rights reserved.
//
//
// Copyright (c) 2012 Simon Grätzer
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//


#import <UIKit/UIKit.h>

Expand All @@ -14,7 +29,7 @@
}

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, assign) NSUInteger index;
@property (nonatomic, assign) NSUInteger position;
@property (nonatomic, assign) BOOL editable;

- (id)initWithFrame:(CGRect)frame title:(NSString *)title;
Expand Down
Loading

0 comments on commit c47c373

Please sign in to comment.