Skip to content

Commit efab794

Browse files
committed
Added feature to segmented bar: Issue #49
Added the ability to give each segment a different color.
1 parent 4bc945e commit efab794

File tree

7 files changed

+236
-337
lines changed

7 files changed

+236
-337
lines changed

Classes/ProgressViews/M13ProgressViewSegmentedBar.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,12 @@ typedef enum {
4545
@property (nonatomic, retain) UIColor *successColor;
4646
/**The color the bar changes to for the failure action.*/
4747
@property (nonatomic, retain) UIColor *failureColor;
48+
/**The array of UIColors that the segments will be colored with.
49+
@note Each index in the array coresponds to a single segment. If there are more indicies then segments, not all colors will be used. If there are less indicies than segments, the colors will be looped. If nil, then a solid fill will be used.*/
50+
@property (nonatomic, retain) NSArray *primaryColors;
51+
/**The array of UIColors that the segment's backgrounds will be colored with.
52+
@note Each index in the array coresponds to a single segment. If there are more indicies then segments, not all colors will be used. If there are less indicies than segments, the colors will be looped. If nil, then a solid fill will be used.*/
53+
@property (nonatomic, retain) NSArray *secondaryColors;
54+
4855

4956
@end

Classes/ProgressViews/M13ProgressViewSegmentedBar.m

Lines changed: 134 additions & 140 deletions
Large diffs are not rendered by default.

M13ProgressSuite.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@
6262
CA2FB02C1889946F00BCAEF5 /* SegmentedBarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB01D1889946F00BCAEF5 /* SegmentedBarViewController.m */; };
6363
CA2FB02D1889946F00BCAEF5 /* SegmentedRingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB01F1889946F00BCAEF5 /* SegmentedRingViewController.m */; };
6464
CA2FB02E1889946F00BCAEF5 /* StripedBarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB0211889946F00BCAEF5 /* StripedBarViewController.m */; };
65-
CA2FB032188994B700BCAEF5 /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB031188994B700BCAEF5 /* UIImage+ImageEffects.m */; };
6665
CA2FB0361889952E00BCAEF5 /* Galaxy.jpg in Resources */ = {isa = PBXBuildFile; fileRef = CA2FB0341889952E00BCAEF5 /* Galaxy.jpg */; };
6766
CA2FB0371889952E00BCAEF5 /* Striped_apple_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = CA2FB0351889952E00BCAEF5 /* Striped_apple_logo.png */; };
6867
CA2FB03A1889974600BCAEF5 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2FB0391889974600BCAEF5 /* Accelerate.framework */; };
6968
CA2FB03C1889975400BCAEF5 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2FB03B1889975400BCAEF5 /* CoreImage.framework */; };
7069
CA2FB03E1889975A00BCAEF5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2FB03D1889975A00BCAEF5 /* QuartzCore.framework */; };
7170
CA412B0218D252FE00FCB7CC /* M13ProgressViewRadiative.m in Sources */ = {isa = PBXBuildFile; fileRef = CA412B0118D252FE00FCB7CC /* M13ProgressViewRadiative.m */; };
7271
CA412B0518D2638E00FCB7CC /* RadiativeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA412B0418D2638E00FCB7CC /* RadiativeViewController.m */; };
72+
CA42BE291A12A92F0018E53E /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = CA42BE281A12A92F0018E53E /* UIImage+ImageEffects.m */; };
7373
CA66890318CBBD1400827C48 /* M13ProgressViewMetro.m in Sources */ = {isa = PBXBuildFile; fileRef = CA66890218CBBD1400827C48 /* M13ProgressViewMetro.m */; };
7474
CA66890618CBEF9300827C48 /* MetroViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA66890518CBEF9300827C48 /* MetroViewController.m */; };
7575
CA6F31C3190EA88D008D1E64 /* M13ProgressViewLetterpress.m in Sources */ = {isa = PBXBuildFile; fileRef = CA6F31C2190EA88D008D1E64 /* M13ProgressViewLetterpress.m */; };
@@ -159,8 +159,6 @@
159159
CA2FB01F1889946F00BCAEF5 /* SegmentedRingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SegmentedRingViewController.m; sourceTree = "<group>"; };
160160
CA2FB0201889946F00BCAEF5 /* StripedBarViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StripedBarViewController.h; sourceTree = "<group>"; };
161161
CA2FB0211889946F00BCAEF5 /* StripedBarViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StripedBarViewController.m; sourceTree = "<group>"; };
162-
CA2FB030188994B700BCAEF5 /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+ImageEffects.h"; path = "Classes/HUD/UIImage+ImageEffects.h"; sourceTree = "<group>"; };
163-
CA2FB031188994B700BCAEF5 /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+ImageEffects.m"; path = "Classes/HUD/UIImage+ImageEffects.m"; sourceTree = "<group>"; };
164162
CA2FB0341889952E00BCAEF5 /* Galaxy.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = Galaxy.jpg; path = M13ProgressSuite/Galaxy.jpg; sourceTree = "<group>"; };
165163
CA2FB0351889952E00BCAEF5 /* Striped_apple_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Striped_apple_logo.png; path = M13ProgressSuite/Striped_apple_logo.png; sourceTree = "<group>"; };
166164
CA2FB0391889974600BCAEF5 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
@@ -170,6 +168,8 @@
170168
CA412B0118D252FE00FCB7CC /* M13ProgressViewRadiative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewRadiative.m; path = Classes/ProgressViews/M13ProgressViewRadiative.m; sourceTree = "<group>"; };
171169
CA412B0318D2638E00FCB7CC /* RadiativeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RadiativeViewController.h; sourceTree = "<group>"; };
172170
CA412B0418D2638E00FCB7CC /* RadiativeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RadiativeViewController.m; sourceTree = "<group>"; };
171+
CA42BE271A12A92F0018E53E /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+ImageEffects.h"; path = "Classes/HUD/UIImage+ImageEffects.h"; sourceTree = "<group>"; };
172+
CA42BE281A12A92F0018E53E /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+ImageEffects.m"; path = "Classes/HUD/UIImage+ImageEffects.m"; sourceTree = "<group>"; };
173173
CA66890118CBBD1400827C48 /* M13ProgressViewMetro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewMetro.h; path = Classes/ProgressViews/M13ProgressViewMetro.h; sourceTree = "<group>"; };
174174
CA66890218CBBD1400827C48 /* M13ProgressViewMetro.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewMetro.m; path = Classes/ProgressViews/M13ProgressViewMetro.m; sourceTree = "<group>"; };
175175
CA66890418CBEF9300827C48 /* MetroViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetroViewController.h; sourceTree = "<group>"; };
@@ -317,8 +317,8 @@
317317
CA2FAFDF1889935700BCAEF5 /* HUD */ = {
318318
isa = PBXGroup;
319319
children = (
320-
CA2FB030188994B700BCAEF5 /* UIImage+ImageEffects.h */,
321-
CA2FB031188994B700BCAEF5 /* UIImage+ImageEffects.m */,
320+
CA42BE271A12A92F0018E53E /* UIImage+ImageEffects.h */,
321+
CA42BE281A12A92F0018E53E /* UIImage+ImageEffects.m */,
322322
CA2FAFDC1889935400BCAEF5 /* M13ProgressHUD.h */,
323323
CA2FAFDD1889935400BCAEF5 /* M13ProgressHUD.m */,
324324
);
@@ -648,7 +648,6 @@
648648
CA2FAFFE1889937800BCAEF5 /* M13ProgressViewStripedBar.m in Sources */,
649649
CA66890618CBEF9300827C48 /* MetroViewController.m in Sources */,
650650
CA2FAFFA1889937800BCAEF5 /* M13ProgressViewPie.m in Sources */,
651-
CA2FB032188994B700BCAEF5 /* UIImage+ImageEffects.m in Sources */,
652651
CA2FAFD71889933200BCAEF5 /* UINavigationController+M13ProgressViewBar.m in Sources */,
653652
CA2FB0281889946F00BCAEF5 /* PieViewController.m in Sources */,
654653
CA2FB0261889946F00BCAEF5 /* ImageViewController.m in Sources */,
@@ -662,6 +661,7 @@
662661
CA2FAFF71889937800BCAEF5 /* M13ProgressViewBorderedBar.m in Sources */,
663662
CA2FB02E1889946F00BCAEF5 /* StripedBarViewController.m in Sources */,
664663
CA2FAFFC1889937800BCAEF5 /* M13ProgressViewSegmentedBar.m in Sources */,
664+
CA42BE291A12A92F0018E53E /* UIImage+ImageEffects.m in Sources */,
665665
CA412B0218D252FE00FCB7CC /* M13ProgressViewRadiative.m in Sources */,
666666
CA2FB02D1889946F00BCAEF5 /* SegmentedRingViewController.m in Sources */,
667667
CA2FAFFB1889937800BCAEF5 /* M13ProgressViewRing.m in Sources */,
3.99 KB
Binary file not shown.

0 commit comments

Comments
 (0)