Skip to content
This repository was archived by the owner on Dec 13, 2017. It is now read-only.

Commit 6a78ee6

Browse files
committed
Merge pull request #744 from wordpress-mobile/fix/framework-support-2
Cocoapods framework support
2 parents 16e4b80 + e8e4bfb commit 6a78ee6

211 files changed

Lines changed: 2580 additions & 1947 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Classes/WPEditorFormatbarView.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#import "WPEditorFormatbarView.h"
22

33
#import <CocoaLumberjack/CocoaLumberjack.h>
4-
#import "WPDeviceIdentification.h"
4+
#import <WordPressShared/WPDeviceIdentification.h>
55
#import "WPEditorToolbarButton.h"
66
#import "ZSSBarButtonItem.h"
77

@@ -274,9 +274,11 @@ - (void)initBarButtonItem:(ZSSBarButtonItem*)barButtonItem
274274
barButtonItem.tag = tag;
275275
barButtonItem.htmlProperty = htmlProperty;
276276
barButtonItem.accessibilityLabel = accessibilityLabel;
277-
278-
UIImage* buttonImage = [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
279-
277+
278+
NSBundle* editorBundle = [NSBundle bundleForClass:[self class]];
279+
UIImage* image = [UIImage imageNamed:imageName inBundle:editorBundle compatibleWithTraitCollection:nil];
280+
UIImage* buttonImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
281+
280282
WPEditorToolbarButton* customButton = [[WPEditorToolbarButton alloc] initWithFrame:CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height)];
281283
[customButton setImage:buttonImage forState:UIControlStateNormal];
282284
customButton.normalTintColor = self.itemTintColor;

Classes/WPEditorLoggingConfiguration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#import <Foundation/Foundation.h>
2+
#import <CocoaLumberjack/CocoaLumberjack.h>
23

34
#ifdef LOG_LEVEL_DEF
45
#undef LOG_LEVEL_DEF

Classes/WPEditorToolbarButton.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#import "WPEditorToolbarButton.h"
2-
#import <WordPress-iOS-Shared/WPStyleGuide.h>
2+
#import <WordPressShared/WPStyleGuide.h>
33

44
static NSString* const CircleLayerKey = @"circleLayer";
55
static CGFloat TouchAnimationCircleRadius = 15.0;

Classes/WPEditorView.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
#import "WPEditorField.h"
66
#import "WPImageMeta.h"
77
#import "ZSSTextView.h"
8-
#import <WordPress-iOS-Shared/WPDeviceIdentification.h>
9-
#import <WordPress-iOS-Shared/WPFontManager.h>
10-
#import <WordPress-iOS-Shared/WPStyleGuide.h>
8+
#import <WordPressShared/WPDeviceIdentification.h>
9+
#import <WordPressShared/WPFontManager.h>
10+
#import <WordPressShared/WPStyleGuide.h>
1111

1212
typedef void(^WPEditorViewCallbackParameterProcessingBlock)(NSString* parameterName, NSString* parameterValue);
1313
typedef void(^WPEditorViewNoParamsCompletionBlock)();

Classes/WPEditorViewController.m

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#import "WPEditorViewController.h"
22
#import <MobileCoreServices/MobileCoreServices.h>
33
#import <UIKit/UIKit.h>
4-
#import <WordPressCom-Analytics-iOS/WPAnalytics.h>
5-
#import <WordPress-iOS-Shared/WPFontManager.h>
6-
#import <WordPress-iOS-Shared/WPStyleGuide.h>
7-
#import <WordPress-iOS-Shared/WPTableViewCell.h>
8-
#import <WordPress-iOS-Shared/UIImage+Util.h>
9-
#import <WordPress-iOS-Shared/UIColor+Helpers.h>
10-
#import <WordPress-iOS-Shared/WPDeviceIdentification.h>
4+
#import <WordPressComAnalytics/WPAnalytics.h>
5+
#import <WordPressShared/WPFontManager.h>
6+
#import <WordPressShared/WPStyleGuide.h>
7+
#import <WordPressShared/WPTableViewCell.h>
8+
#import <WordPressShared/UIImage+Util.h>
9+
#import <WordPressShared/UIColor+Helpers.h>
10+
#import <WordPressShared/WPDeviceIdentification.h>
1111

1212
#import "WPEditorField.h"
1313
#import "WPEditorToolbarButton.h"
@@ -103,8 +103,9 @@ - (void)sharedInitializationWithEditing:(BOOL)editing
103103
- (void)createToolbarView
104104
{
105105
NSAssert(!_toolbarView, @"The toolbar view should not exist here.");
106-
107-
_toolbarView = (WPEditorFormatbarView *)[[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([WPEditorFormatbarView class]) owner:nil options:nil] firstObject];
106+
107+
NSBundle *editorBundle = [NSBundle bundleForClass:[WPEditorFormatbarView class]];
108+
_toolbarView = (WPEditorFormatbarView *)[[editorBundle loadNibNamed:NSStringFromClass([WPEditorFormatbarView class]) owner:nil options:nil] firstObject];
108109
_toolbarView.delegate = self;
109110
_toolbarView.borderColor = [WPStyleGuide greyLighten10];
110111
_toolbarView.itemTintColor = [WPStyleGuide greyLighten10];

Classes/WPLegacyEditorViewController.m

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#import "WPLegacyEditorViewController.h"
22
#import "WPLegacyKeyboardToolbarBase.h"
33
#import "WPLegacyKeyboardToolbarDone.h"
4-
#import <WordPressCom-Analytics-iOS/WPAnalytics.h>
5-
#import <WordPress-iOS-Shared/WPStyleGuide.h>
6-
#import <WordPress-iOS-Shared/WPTableViewCell.h>
7-
#import <WordPress-iOS-Shared/UIImage+Util.h>
4+
#import <WordPressComAnalytics/WPAnalytics.h>
5+
#import <WordPressShared/WPStyleGuide.h>
6+
#import <WordPressShared/WPTableViewCell.h>
7+
#import <WordPressShared/UIImage+Util.h>
88

99
CGFloat const WPLegacyEPVCTextfieldHeight = 44.0f;
1010
CGFloat const WPLegacyEPVCOptionsHeight = 44.0f;
@@ -138,11 +138,11 @@ - (void)setupToolbar
138138
return;
139139
}
140140

141-
UIBarButtonItem *previewButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon-posts-editor-preview"]
141+
UIBarButtonItem *previewButton = [[UIBarButtonItem alloc] initWithImage:[self imageNamed:@"icon-posts-editor-preview"]
142142
style:UIBarButtonItemStylePlain
143143
target:self
144144
action:@selector(didTouchPreview)];
145-
UIBarButtonItem *photoButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon-posts-editor-media"]
145+
UIBarButtonItem *photoButton = [[UIBarButtonItem alloc] initWithImage:[self imageNamed:@"icon-posts-editor-media"]
146146
style:UIBarButtonItemStylePlain
147147
target:self
148148
action:@selector(didTouchMediaOptions)];
@@ -494,6 +494,11 @@ - (NSString *)validateNewLinkInfo:(NSString *)urlText
494494
}
495495
}
496496

497+
- (UIImage *)imageNamed:(NSString *)imageName {
498+
NSBundle* editorBundle = [NSBundle bundleForClass:[self class]];
499+
return [UIImage imageNamed:imageName inBundle:editorBundle compatibleWithTraitCollection:nil];
500+
}
501+
497502
#pragma mark - Formatting
498503

499504
- (void)wrapSelectionWithTag:(NSString *)tag

Classes/WPLegacyKeyboardToolbarButtonItem.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#import "WPLegacyKeyboardToolbarButtonItem.h"
22
#import <QuartzCore/QuartzCore.h>
3-
#import <WordPress-iOS-Shared/WPStyleGuide.h>
3+
#import <WordPressShared/WPStyleGuide.h>
44

55
@implementation WPLegacyKeyboardToolbarButtonItem
66
@synthesize actionTag, actionName;
@@ -19,13 +19,18 @@ - (id)initWithFrame:(CGRect)frame {
1919
return self;
2020
}
2121

22+
- (UIImage *)imageNamed:(NSString *)imageName {
23+
NSBundle* editorBundle = [NSBundle bundleForClass:[self class]];
24+
return [UIImage imageNamed:imageName inBundle:editorBundle compatibleWithTraitCollection:nil];
25+
}
26+
2227
- (void)setImageName:(NSString *)imageName {
23-
[self setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@", imageName]] forState:UIControlStateNormal];
28+
[self setImage:[self imageNamed:[NSString stringWithFormat:@"%@", imageName]] forState:UIControlStateNormal];
2429
self.imageView.contentMode = UIViewContentModeCenter;
2530
}
2631

2732
- (void)setImageName:(NSString *)imageName withColor:(UIColor *)tintColor highlightColor:(UIColor *)highlightColor {
28-
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%@", imageName]];
33+
UIImage *image = [self imageNamed:[NSString stringWithFormat:@"%@", imageName]];
2934
if (tintColor) {
3035
image = [self createImage:image withColor:tintColor];
3136
}

Example/EditorDemo.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
15E849FD13EC454FA48CFC80 /* libPods-EditorDemoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 290415B5098D4CEDAA96DF0F /* libPods-EditorDemoTests.a */; };
1110
59F15AD219E45BB000CD8E33 /* WPEditorDemoLoggingConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 59F15AD119E45BB000CD8E33 /* WPEditorDemoLoggingConfiguration.m */; };
1211
5D24FEF91A3C9E8B009E1932 /* WPImageMetaViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D24FEF81A3C9E8B009E1932 /* WPImageMetaViewController.m */; };
1312
74291D0A1940C859004230D4 /* content.html in Resources */ = {isa = PBXBuildFile; fileRef = 74291D091940C859004230D4 /* content.html */; };
@@ -28,7 +27,8 @@
2827
748D2AB5193E516000D5ACC8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 748D2AB3193E516000D5ACC8 /* InfoPlist.strings */; };
2928
748D2AB7193E516000D5ACC8 /* EditorDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 748D2AB6193E516000D5ACC8 /* EditorDemoTests.m */; };
3029
74991B601BF10E7500AFA57B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 74991B5F1BF10E7500AFA57B /* LaunchScreen.storyboard */; };
31-
B1341A871FF54DCCAEE52D3A /* libPods-EditorDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 986CDAC2D08B4B22A292BF20 /* libPods-EditorDemo.a */; };
30+
9B748FC06BB5833078779F06 /* Pods_EditorDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4B93A674A3CAFF72CC6964B /* Pods_EditorDemo.framework */; };
31+
FF4B4D4C28B2EE2360630A8A /* Pods_EditorDemoTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0F0C09885E0B8DAD277393B /* Pods_EditorDemoTests.framework */; };
3232
/* End PBXBuildFile section */
3333

3434
/* Begin PBXContainerItemProxy section */
@@ -42,7 +42,6 @@
4242
/* End PBXContainerItemProxy section */
4343

4444
/* Begin PBXFileReference section */
45-
290415B5098D4CEDAA96DF0F /* libPods-EditorDemoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-EditorDemoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4645
59F15AD019E45BB000CD8E33 /* WPEditorDemoLoggingConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WPEditorDemoLoggingConfiguration.h; sourceTree = "<group>"; };
4746
59F15AD119E45BB000CD8E33 /* WPEditorDemoLoggingConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WPEditorDemoLoggingConfiguration.m; sourceTree = "<group>"; };
4847
5D24FEF71A3C9E8B009E1932 /* WPImageMetaViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WPImageMetaViewController.h; sourceTree = "<group>"; };
@@ -72,9 +71,10 @@
7271
748D2AB6193E516000D5ACC8 /* EditorDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EditorDemoTests.m; sourceTree = "<group>"; };
7372
74991B5F1BF10E7500AFA57B /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
7473
7DB5B4BB7BD920939EF39DA4 /* Pods-EditorDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EditorDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-EditorDemo/Pods-EditorDemo.release.xcconfig"; sourceTree = "<group>"; };
75-
986CDAC2D08B4B22A292BF20 /* libPods-EditorDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-EditorDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
7674
A92C5705CA55DA4FE6C241C2 /* Pods-EditorDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EditorDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-EditorDemo/Pods-EditorDemo.debug.xcconfig"; sourceTree = "<group>"; };
75+
C0F0C09885E0B8DAD277393B /* Pods_EditorDemoTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_EditorDemoTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7776
E3905FE0E04F3570F2A87958 /* Pods-EditorDemoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EditorDemoTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-EditorDemoTests/Pods-EditorDemoTests.debug.xcconfig"; sourceTree = "<group>"; };
77+
E4B93A674A3CAFF72CC6964B /* Pods_EditorDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_EditorDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7878
/* End PBXFileReference section */
7979

8080
/* Begin PBXFrameworksBuildPhase section */
@@ -86,7 +86,7 @@
8686
748D2A8B193E516000D5ACC8 /* CoreGraphics.framework in Frameworks */,
8787
748D2A8D193E516000D5ACC8 /* UIKit.framework in Frameworks */,
8888
748D2A89193E516000D5ACC8 /* Foundation.framework in Frameworks */,
89-
B1341A871FF54DCCAEE52D3A /* libPods-EditorDemo.a in Frameworks */,
89+
9B748FC06BB5833078779F06 /* Pods_EditorDemo.framework in Frameworks */,
9090
);
9191
runOnlyForDeploymentPostprocessing = 0;
9292
};
@@ -97,7 +97,7 @@
9797
748D2AAB193E516000D5ACC8 /* XCTest.framework in Frameworks */,
9898
748D2AAD193E516000D5ACC8 /* UIKit.framework in Frameworks */,
9999
748D2AAC193E516000D5ACC8 /* Foundation.framework in Frameworks */,
100-
15E849FD13EC454FA48CFC80 /* libPods-EditorDemoTests.a in Frameworks */,
100+
FF4B4D4C28B2EE2360630A8A /* Pods_EditorDemoTests.framework in Frameworks */,
101101
);
102102
runOnlyForDeploymentPostprocessing = 0;
103103
};
@@ -143,8 +143,8 @@
143143
748D2A8A193E516000D5ACC8 /* CoreGraphics.framework */,
144144
748D2A8C193E516000D5ACC8 /* UIKit.framework */,
145145
748D2AAA193E516000D5ACC8 /* XCTest.framework */,
146-
986CDAC2D08B4B22A292BF20 /* libPods-EditorDemo.a */,
147-
290415B5098D4CEDAA96DF0F /* libPods-EditorDemoTests.a */,
146+
E4B93A674A3CAFF72CC6964B /* Pods_EditorDemo.framework */,
147+
C0F0C09885E0B8DAD277393B /* Pods_EditorDemoTests.framework */,
148148
);
149149
name = Frameworks;
150150
sourceTree = "<group>";

Example/EditorDemo/WPAppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#import "WPAppDelegate.h"
22

33
#import <CocoaLumberjack/CocoaLumberjack.h>
4-
#import <WordPress-iOS-Editor/WPEditorViewController.h>
4+
#import <WordPressEditor/WPEditorViewController.h>
55

66
@implementation WPAppDelegate
77

Example/EditorDemo/WPImageMetaViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#import "WPImageMetaViewController.h"
2-
#import <WordPress-iOS-Editor/WPImageMeta.h>
2+
#import <WordPressEditor/WPImageMeta.h>
33

44
@interface WPImageMetaViewController ()
55

0 commit comments

Comments
 (0)