-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
483 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
TestStackView.xcodeproj/xcuserdata/Basil_A.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
type = "1" | ||
version = "2.0"> | ||
<Breakpoints> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "Yes" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "TestStackView/DPSSStackView/DPSSStackView.m" | ||
timestampString = "478126437.454767" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "169" | ||
endingLineNumber = "169" | ||
landmarkName = "-headerContainer" | ||
landmarkType = "5"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
<BreakpointProxy | ||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> | ||
<BreakpointContent | ||
shouldBeEnabled = "Yes" | ||
ignoreCount = "0" | ||
continueAfterRunningActions = "No" | ||
filePath = "TestStackView/DPSSStackView/DPSSStackView.m" | ||
timestampString = "478126489.930892" | ||
startingColumnNumber = "9223372036854775807" | ||
endingColumnNumber = "9223372036854775807" | ||
startingLineNumber = "115" | ||
endingLineNumber = "115" | ||
landmarkName = "-layoutSubviews" | ||
landmarkType = "5"> | ||
</BreakpointContent> | ||
</BreakpointProxy> | ||
</Breakpoints> | ||
</Bucket> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// DPSSDelegate.h | ||
// TestStackView | ||
// | ||
// Created by Basil Al-Tamimi on 2/25/16. | ||
// Copyright © 2016 Basil Al-Tamimi. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "DPTabView.h" | ||
|
||
typedef enum : NSUInteger { | ||
DPSSDelegateTypeIPhone, | ||
DPSSDelegateTypeIPad | ||
} DPSSDelegateType; | ||
|
||
@interface DPSSDelegate : NSObject<DPTabViewDataSource,DPTabViewDelegate> | ||
|
||
+ (instancetype)ssDelegateWithType:(DPSSDelegateType)type; | ||
|
||
@end | ||
|
||
@interface DPSSDelegateIPhone : DPSSDelegate | ||
|
||
@end | ||
|
||
@interface DPSSDelegateIPad : DPSSDelegate | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// | ||
// DPSSDelegate.m | ||
// TestStackView | ||
// | ||
// Created by Basil Al-Tamimi on 2/25/16. | ||
// Copyright © 2016 Basil Al-Tamimi. All rights reserved. | ||
// | ||
|
||
#import "DPSSDelegate.h" | ||
|
||
#define kMainColor [UIColor colorWithRed:190/255. green:10/255. blue:30/255. alpha:1] | ||
#define kSupportColor [UIColor colorWithRed:209/255. green:29/255. blue:51/255. alpha:1] | ||
|
||
@implementation DPSSDelegate | ||
|
||
+ (instancetype)ssDelegateWithType:(DPSSDelegateType)type { | ||
|
||
if (type == DPSSDelegateTypeIPhone) { | ||
return [DPSSDelegateIPhone new]; | ||
} else { | ||
return [DPSSDelegateIPad new]; | ||
} | ||
} | ||
|
||
- (CGFloat)tabViewTabBarHorizontalMargin:(DPTabView *)tabView {return 0;} | ||
|
||
- (CGFloat)tabViewTabBarHeight:(DPTabView *)tabView { | ||
NSAssert(false, @"tabViewNumberOfTabs needs to be implemented in the subclass"); | ||
return 0; | ||
} | ||
|
||
- (UIView *)tabViewSelectionCursor:(DPTabView *)tabView { | ||
return [UIView new]; | ||
} | ||
|
||
@end | ||
|
||
@implementation DPSSDelegateIPhone | ||
|
||
- (NSInteger)tabViewNumberOfTabs:(DPTabView *)tabView { | ||
return 2; | ||
} | ||
|
||
- (CGFloat)tabViewTabBarHorizontalMargin:(DPTabView *)tabView { | ||
return 10; | ||
} | ||
|
||
- (CGFloat)tabViewTabBarHeight:(DPTabView *)tabView { | ||
return 40; | ||
} | ||
|
||
- (void)tabView:(DPTabView *)tabView configurateButton:(UIButton *)button forIndex:(NSInteger)index withState:(DPTabViewButtonState)state { | ||
static CALayer *upperBorder; | ||
if (!upperBorder) { | ||
upperBorder = [CALayer layer]; | ||
upperBorder.backgroundColor = [kSupportColor CGColor]; | ||
} | ||
|
||
switch (state) { | ||
case DPTabViewButtonState_init: { | ||
button.layer.cornerRadius = 2; | ||
button.titleLabel.font = [UIFont systemFontOfSize:14]; | ||
button.clipsToBounds = YES; | ||
break; | ||
} | ||
|
||
case DPTabViewButtonState_selected: { | ||
button.backgroundColor = kMainColor; | ||
upperBorder.frame = CGRectMake(0, 0, CGRectGetWidth(button.frame), 1.0f); | ||
[button.layer addSublayer:upperBorder]; | ||
break; | ||
} | ||
|
||
case DPTabViewButtonState_deselected: { | ||
button.backgroundColor = [UIColor clearColor]; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
- (UIView *)tabViewSelectionCursor:(DPTabView *)tabView { | ||
CGFloat lineHeight = 3; | ||
CGFloat horMargin = [tabView tabBarHorizontalMargin]; | ||
CGFloat cursorWidth = tabView.frame.size.width - (horMargin * 2); | ||
|
||
UIView *cursor = [[UIView alloc] initWithFrame:(CGRect){horMargin,[tabView tabBarHeight] - lineHeight, cursorWidth, lineHeight}]; | ||
cursor.backgroundColor = kMainColor; | ||
|
||
CALayer *upperBorder = [CALayer layer]; | ||
upperBorder.backgroundColor = [kSupportColor CGColor]; | ||
upperBorder.frame = CGRectMake(0, 0, cursorWidth, 1.0f); | ||
[cursor.layer addSublayer:upperBorder]; | ||
|
||
return cursor; | ||
} | ||
|
||
|
||
@end | ||
|
||
@implementation DPSSDelegateIPad | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.