Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit ba29f31

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents 7d15c4e + b0239fc commit ba29f31

File tree

8 files changed

+320
-259
lines changed

8 files changed

+320
-259
lines changed

WordPress-iOS-Shared.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPress-iOS-Shared"
3-
s.version = "0.4.1"
3+
s.version = "0.4.2"
44
s.summary = "Shared components used in building the WordPress iOS apps and other library components."
55

66
s.description = <<-DESC

WordPress-iOS-Shared.xcodeproj/project.pbxproj

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
931A1023192A9DFC00D3CC11 /* WPStyleGuide.m in Sources */ = {isa = PBXBuildFile; fileRef = 931A1022192A9DFC00D3CC11 /* WPStyleGuide.m */; };
2727
931A1026192A9E0B00D3CC11 /* WPNUXUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 931A1025192A9E0B00D3CC11 /* WPNUXUtility.m */; };
2828
931A1029192A9E2400D3CC11 /* WPTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 931A1028192A9E2400D3CC11 /* WPTableViewCell.m */; };
29-
931A102E192A9E3200D3CC11 /* WPTableViewSectionFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 931A102B192A9E3200D3CC11 /* WPTableViewSectionFooterView.m */; };
30-
931A102F192A9E3200D3CC11 /* WPTableViewSectionHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 931A102D192A9E3200D3CC11 /* WPTableViewSectionHeaderView.m */; };
29+
931A102E192A9E3200D3CC11 /* WPTableViewSectionHeaderFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 931A102B192A9E3200D3CC11 /* WPTableViewSectionHeaderFooterView.m */; };
3130
931A1035192AA03600D3CC11 /* UIColor+Helpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 931A1034192AA03600D3CC11 /* UIColor+Helpers.m */; };
3231
931A1038192AA34300D3CC11 /* WPImageSourceTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 931A1037192AA34300D3CC11 /* WPImageSourceTest.m */; };
3332
931A103B192AA35B00D3CC11 /* AsyncTestHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 931A103A192AA35B00D3CC11 /* AsyncTestHelper.m */; };
@@ -93,10 +92,8 @@
9392
931A1025192A9E0B00D3CC11 /* WPNUXUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WPNUXUtility.m; path = Core/WPNUXUtility.m; sourceTree = "<group>"; };
9493
931A1027192A9E2400D3CC11 /* WPTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WPTableViewCell.h; path = Core/WPTableViewCell.h; sourceTree = "<group>"; };
9594
931A1028192A9E2400D3CC11 /* WPTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WPTableViewCell.m; path = Core/WPTableViewCell.m; sourceTree = "<group>"; };
96-
931A102A192A9E3200D3CC11 /* WPTableViewSectionFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WPTableViewSectionFooterView.h; path = Core/WPTableViewSectionFooterView.h; sourceTree = "<group>"; };
97-
931A102B192A9E3200D3CC11 /* WPTableViewSectionFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WPTableViewSectionFooterView.m; path = Core/WPTableViewSectionFooterView.m; sourceTree = "<group>"; };
98-
931A102C192A9E3200D3CC11 /* WPTableViewSectionHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WPTableViewSectionHeaderView.h; path = Core/WPTableViewSectionHeaderView.h; sourceTree = "<group>"; };
99-
931A102D192A9E3200D3CC11 /* WPTableViewSectionHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WPTableViewSectionHeaderView.m; path = Core/WPTableViewSectionHeaderView.m; sourceTree = "<group>"; };
95+
931A102A192A9E3200D3CC11 /* WPTableViewSectionHeaderFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WPTableViewSectionHeaderFooterView.h; path = Core/WPTableViewSectionHeaderFooterView.h; sourceTree = "<group>"; };
96+
931A102B192A9E3200D3CC11 /* WPTableViewSectionHeaderFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WPTableViewSectionHeaderFooterView.m; path = Core/WPTableViewSectionHeaderFooterView.m; sourceTree = "<group>"; };
10097
931A1030192A9F3500D3CC11 /* WPTextFieldTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WPTextFieldTableViewCell.h; path = Core/WPTextFieldTableViewCell.h; sourceTree = "<group>"; };
10198
931A1033192AA03600D3CC11 /* UIColor+Helpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIColor+Helpers.h"; path = "Core/UIColor+Helpers.h"; sourceTree = "<group>"; };
10299
931A1034192AA03600D3CC11 /* UIColor+Helpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIColor+Helpers.m"; path = "Core/UIColor+Helpers.m"; sourceTree = "<group>"; };
@@ -243,10 +240,8 @@
243240
931A1022192A9DFC00D3CC11 /* WPStyleGuide.m */,
244241
931A1027192A9E2400D3CC11 /* WPTableViewCell.h */,
245242
931A1028192A9E2400D3CC11 /* WPTableViewCell.m */,
246-
931A102A192A9E3200D3CC11 /* WPTableViewSectionFooterView.h */,
247-
931A102B192A9E3200D3CC11 /* WPTableViewSectionFooterView.m */,
248-
931A102C192A9E3200D3CC11 /* WPTableViewSectionHeaderView.h */,
249-
931A102D192A9E3200D3CC11 /* WPTableViewSectionHeaderView.m */,
243+
931A102A192A9E3200D3CC11 /* WPTableViewSectionHeaderFooterView.h */,
244+
931A102B192A9E3200D3CC11 /* WPTableViewSectionHeaderFooterView.m */,
250245
931A1030192A9F3500D3CC11 /* WPTextFieldTableViewCell.h */,
251246
FF8DDCE01B5E91050098826F /* WPTextFieldTableViewCell.m */,
252247
);
@@ -443,10 +438,9 @@
443438
9309B52D192BEECC00B69F69 /* WordPressShared.m in Sources */,
444439
931A1016192A9D5200D3CC11 /* NSString+Util.m in Sources */,
445440
931A1023192A9DFC00D3CC11 /* WPStyleGuide.m in Sources */,
446-
931A102F192A9E3200D3CC11 /* WPTableViewSectionHeaderView.m in Sources */,
447441
598E770E1A8E3D1A0020DC05 /* WPDeviceIdentification.m in Sources */,
448442
7462F3401961FAAB00CC8EED /* WPFontManager.m in Sources */,
449-
931A102E192A9E3200D3CC11 /* WPTableViewSectionFooterView.m in Sources */,
443+
931A102E192A9E3200D3CC11 /* WPTableViewSectionHeaderFooterView.m in Sources */,
450444
744DA846194F3A76002CD6E9 /* UIImage+Util.m in Sources */,
451445
931A1020192A9DD500D3CC11 /* WPNoResultsView.m in Sources */,
452446
931A1026192A9E0B00D3CC11 /* WPNUXUtility.m in Sources */,

WordPress-iOS-Shared/Core/WPTableViewSectionFooterView.h

Lines changed: 0 additions & 22 deletions
This file was deleted.

WordPress-iOS-Shared/Core/WPTableViewSectionFooterView.m

Lines changed: 0 additions & 105 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#import <UIKit/UIKit.h>
2+
3+
4+
5+
/**
6+
* @enum WPTableViewSectionStyle
7+
* @brief The WPTableViewSectionHeaderFooterView helper class has two default styles: Header and Footer.
8+
* By means of this simple enum, we'll be able to initialize the HeaderFooterView with the
9+
* standard styles that should be applied when using this tool as a Header, or a Footer.
10+
*/
11+
12+
typedef NS_ENUM(NSInteger, WPTableViewSectionStyle)
13+
{
14+
WPTableViewSectionStyleHeader,
15+
WPTableViewSectionStyleFooter
16+
};
17+
18+
19+
20+
/**
21+
* @class WPTableViewSectionHeaderFooterView
22+
* @brief This class is meant to be used as TableView Section Footer, and provides a custom style that
23+
* should be used app-wide.
24+
*/
25+
26+
@interface WPTableViewSectionHeaderFooterView : UITableViewHeaderFooterView
27+
28+
@property (nonatomic, assign, readonly) WPTableViewSectionStyle style;
29+
@property (nonatomic, strong) NSString *title;
30+
@property (nonatomic, strong) UIColor *titleColor;
31+
@property (nonatomic, strong) UIFont *titleFont;
32+
@property (nonatomic, assign) NSTextAlignment titleAlignment;
33+
@property (nonatomic, assign) UIEdgeInsets titleInsets;
34+
@property (nonatomic, assign) BOOL uppercase;
35+
36+
- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier style:(WPTableViewSectionStyle)style;
37+
38+
39+
/**
40+
* @brief Calculates the Height required to display a View with the default Header Styles.
41+
*
42+
* @param headerText The text to be rendered.
43+
* @param width The container's width.
44+
* @returns Required Height
45+
*/
46+
47+
+ (CGFloat)heightForHeader:(NSString *)headerText width:(CGFloat)width;
48+
49+
50+
/**
51+
* @brief Calculates the Height required to display a View with the default Footer Styles.
52+
*
53+
* @param headerText The text to be rendered.
54+
* @param width The container's width.
55+
* @returns Required Height
56+
*/
57+
58+
+ (CGFloat)heightForFooter:(NSString *)footerText width:(CGFloat)width;
59+
60+
61+
/**
62+
* @brief Calculates the Height required to display a View with a custom Font and Title Insets.
63+
*
64+
* @param text The text to be rendered.
65+
* @param width The container's width.
66+
* @param font The font that should be used.
67+
* @returns Required Height
68+
*/
69+
70+
+ (CGFloat)heightForText:(NSString *)text width:(CGFloat)width titleInsets:(UIEdgeInsets)titleInsets font:(UIFont *)font;
71+
72+
@end

0 commit comments

Comments
 (0)