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

Sync code from base repo #2

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a080214
Skip if there are no segmented set up yet
Jan 14, 2016
79a521e
Removes the 'transitioning' flag and doesn't disable interaction whil…
Jan 28, 2016
9b1ef4f
Disables interaction on the selected segment, so the highlight effect…
Jan 28, 2016
72c5108
Merge pull request #70 from dzenbot/interaction-fix
Jan 28, 2016
2f78154
Version bump (1.3.3)
Feb 4, 2016
364756a
Updates README
Feb 4, 2016
af6e3b7
Wraps the assert check for setItems: in DEBUG env (needed for podspec…
Feb 4, 2016
bc5f313
Adds a way to customise the positioning of the selection indicator, f…
Feb 5, 2016
d4c996f
Implements the DZNSegmentedControlDelegate methods in the sample proj…
Feb 5, 2016
701cfec
Correct the spelling of CocoaPods in README
ReadmeCritic Feb 11, 2016
5ec0d8c
Merge pull request #71 from ReadmeCritic/master
Feb 12, 2016
fff7300
Property to add padding to selection indicator
Mar 1, 2016
95a4ad2
Update README.md
Jun 9, 2016
8273127
Added method isSegmentAtIndexEnabled
Jul 7, 2016
210818b
Merge pull request #86 from pomarec/feature-isSegmentAtIndexEnabled
Jul 9, 2016
8b97808
Auto indicator width for observed scroll view.
fangqiuming Feb 15, 2017
43f1280
Remove useless lines
fangqiuming May 1, 2017
2644e6d
Merge pull request #89 from fangqiuming/master
Nov 13, 2017
dd81f87
Sample project updates and warnings cleanup from Xcode 9.1
Nov 13, 2017
f9158e4
Merge pull request #74 from abrpatel/selectionIndicatorPadding
Nov 13, 2017
adf2d99
Small tweaks
Nov 13, 2017
7ab3e5d
Adding Carthage support + project restructuring
Nov 13, 2017
eb8897e
Updating readme
Nov 13, 2017
034d7a2
Version bump (1.4)
Nov 13, 2017
10e26d8
Merge pull request #91 from dzenbot/carthage-support
Nov 13, 2017
baba534
Lowering the deployment target to 9.0
Nov 14, 2017
3ba556f
Merge branch 'carthage-support'
Nov 14, 2017
95b3cff
Merge branch 'master' of https://github.com/dzenbot/DZNSegmentedContr…
pavankotesh Jan 6, 2020
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
2 changes: 1 addition & 1 deletion DZNSegmentedControl.podspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

@version = "1.3.2"
@version = "1.4"

Pod::Spec.new do |s|
s.name = "DZNSegmentedControl"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4F3FA5151FBA525400425EB5"
BuildableName = "DZNSegmentedControl.framework"
BlueprintName = "DZNSegmentedControl"
ReferencedContainer = "container:DZNSegmentedControl.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4F3FA51D1FBA525400425EB5"
BuildableName = "DZNSegmentedControlTests.xctest"
BlueprintName = "DZNSegmentedControlTests"
ReferencedContainer = "container:DZNSegmentedControl.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4F3FA5151FBA525400425EB5"
BuildableName = "DZNSegmentedControl.framework"
BlueprintName = "DZNSegmentedControl"
ReferencedContainer = "container:DZNSegmentedControl.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4F3FA5151FBA525400425EB5"
BuildableName = "DZNSegmentedControl.framework"
BlueprintName = "DZNSegmentedControl"
ReferencedContainer = "container:DZNSegmentedControl.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4F3FA5151FBA525400425EB5"
BuildableName = "DZNSegmentedControl.framework"
BlueprintName = "DZNSegmentedControl"
ReferencedContainer = "container:DZNSegmentedControl.xcodeproj">
</BuildableReference>
</MacroExpansion>
</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,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0910"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4F3FA51D1FBA525400425EB5"
BuildableName = "DZNSegmentedControlTests.xctest"
BlueprintName = "DZNSegmentedControlTests"
ReferencedContainer = "container:DZNSegmentedControl.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ enum {
@property (nonatomic) NSInteger selectedSegmentIndex;
/** Returns the number of segments the receiver has. */
@property (nonatomic, readonly) NSUInteger numberOfSegments;
/** The height of the control. Default is 56pts, and if not showing counts, default is 30pts. */
/** The height of the control. Default is 56 points, and if not showing counts, default is 30 points. */
@property (nonatomic, readwrite) CGFloat height UI_APPEARANCE_SELECTOR;
/** The width of the control. Default is superview's width. */
@property (nonatomic, readwrite) CGFloat width UI_APPEARANCE_SELECTOR;
/** The height of the selection indicator. Default is 2pts. */
/** The height of the selection indicator. Default is 2 points. */
@property (nonatomic, readwrite) CGFloat selectionIndicatorHeight UI_APPEARANCE_SELECTOR;
/** The padding height of the selection indicator from the title of the button. Default is 0 points. */
@property (nonatomic, readwrite) CGFloat selectionIndicatorPadding UI_APPEARANCE_SELECTOR;
/** The duration of the indicator's animation. Default is 0.2 sec. */
@property (nonatomic, readwrite) CGFloat animationDuration UI_APPEARANCE_SELECTOR;
/** The font family to be used on labels. Default is system font (HelveticaNeue). Font size is managed by the class. */
Expand Down Expand Up @@ -129,6 +131,15 @@ enum {
*/
- (void)setEnabled:(BOOL)enabled forSegmentAtIndex:(NSUInteger)segment;


/**
Returns whether the given segment is selected or not

@param segment An index number identifying a segment in the control. It must be a number between 0 and the number of segments (numberOfSegments) minus 1; values exceeding this upper range are pinned to it.
@returns Returns whether the given segment is selected or not
*/
- (BOOL)isSegmentAtIndexEnabled:(NSUInteger)segment;

/**
Sets a contentOffset and contentSize to enable scrollView tracking.
To be used in combination with UIScrollView+DZNSegmentedControl.
Expand Down Expand Up @@ -161,8 +172,35 @@ enum {

@end

typedef NS_ENUM(NSInteger, DZNScrollDirection) {
DZNScrollDirectionHorizontal,
DZNScrollDirectionVertical
};

@class DZNSegmentedControl;

@interface UIScrollView (DZNSegmentedControl)

/** The scrolling direction of the scrollView. Default is Horizontal. */
@property (nonatomic) DZNScrollDirection scrollDirection;

/** YES if the scrollview should scroll automatically when a segment changes. Default is YES. */
@property (nonatomic) BOOL scrollOnSegmentChange;

/** The scrollView reference to observe the content offset updates and interact with. */
@property (nonatomic, weak) DZNSegmentedControl *segmentedControl;

@end

/**
The DZNSegmentedControlDelegate protocol defines the interface that DZNSegmentedControl delegate objects implement to manage the segmented control behavior. This protocol declares no methods of its own but conforms to the UIBarPositioningDelegate protocol to support the positioning of a segmented control when it is moved to a window.
This protocol conforms to the UIBarPositioningDelegate protocol to support the any directional decoration drawing accordingly (ie: the hairline and the selection indicator bar).
*/
@protocol DZNSegmentedControlDelegate <UIBarPositioningDelegate>
@optional

/**
Implement this method to position the selector indicator either at the top or bottom of the view. Default is UIBarPositionAny which means the selector indicator will be placed at the bottom. If not implemented, the value for positionForBar: will be used instead.
*/
- (UIBarPosition)positionForSelectionIndicator:(id<UIBarPositioning>)bar;

@end
Loading