Skip to content

Commit

Permalink
chore: rename ios project
Browse files Browse the repository at this point in the history
  • Loading branch information
luancurti committed Jan 23, 2020
1 parent 5e2b479 commit fe20b45
Show file tree
Hide file tree
Showing 12 changed files with 832 additions and 539 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#import <WebKit/WebKit.h>

@interface RNCWKProcessPoolManager : NSObject
@interface RNCNewWKProcessPoolManager : NSObject

+ (instancetype) sharedManager;
- (WKProcessPool *)sharedProcessPool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
*/

#import <Foundation/Foundation.h>
#import "RNCWKProcessPoolManager.h"
#import "RNCNewWKProcessPoolManager.h"

@interface RNCWKProcessPoolManager() {
@interface RNCNewWKProcessPoolManager() {
WKProcessPool *_sharedProcessPool;
}
@end

@implementation RNCWKProcessPoolManager
@implementation RNCNewWKProcessPoolManager

+ (id) sharedManager {
static RNCWKProcessPoolManager *_sharedManager = nil;
static RNCNewWKProcessPoolManager *_sharedManager = nil;
@synchronized(self) {
if(_sharedManager == nil) {
_sharedManager = [[super alloc] init];
Expand Down
10 changes: 5 additions & 5 deletions ios/RNCWebView.h → ios/RNCNewWKWebView.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#import <React/RCTDefines.h>
#import <WebKit/WebKit.h>

@class RNCWebView;
@class RNCNewWKWebView;

@protocol RNCWebViewDelegate <NSObject>
@protocol RNCNewWKWebViewDelegate <NSObject>

- (BOOL)webView:(RNCWebView *_Nonnull)webView
- (BOOL)webView:(RNCNewWKWebView *_Nonnull)webView
shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *_Nonnull)request
withCallback:(RCTDirectEventBlock _Nonnull)callback;

Expand All @@ -24,9 +24,9 @@
- (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate;
@end

@interface RNCWebView : RCTView
@interface RNCNewWKWebView : RCTView

@property (nonatomic, weak) id<RNCWebViewDelegate> _Nullable delegate;
@property (nonatomic, weak) id<RNCNewWKWebViewDelegate> _Nullable delegate;
@property (nonatomic, copy) NSDictionary * _Nullable source;
@property (nonatomic, assign) BOOL messagingEnabled;
@property (nonatomic, copy) NSString * _Nullable injectedJavaScript;
Expand Down
13 changes: 6 additions & 7 deletions ios/RNCWebView.m → ios/RNCNewWKWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import "RNCWebView.h"
#import "RNCNewWKWebView.h"
#import <React/RCTConvert.h>
#import <React/RCTAutoInsetsProtocol.h>
#import "RNCWKProcessPoolManager.h"
#import "RNCNewWKProcessPoolManager.h"
#import <UIKit/UIKit.h>

#import "objc/runtime.h"
Expand Down Expand Up @@ -40,7 +39,7 @@ -(id)inputAccessoryView
}
@end

@interface RNCWebView () <WKUIDelegate, WKNavigationDelegate, WKScriptMessageHandler, UIScrollViewDelegate, RCTAutoInsetsProtocol>
@interface RNCNewWKWebView () <WKUIDelegate, WKNavigationDelegate, WKScriptMessageHandler, UIScrollViewDelegate, RCTAutoInsetsProtocol>
@property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;
@property (nonatomic, copy) RCTDirectEventBlock onLoadingFinish;
@property (nonatomic, copy) RCTDirectEventBlock onLoadingError;
Expand All @@ -53,7 +52,7 @@ @interface RNCWebView () <WKUIDelegate, WKNavigationDelegate, WKScriptMessageHan
@property (nonatomic, copy) WKWebView *webView;
@end

@implementation RNCWebView
@implementation RNCNewWKWebView
{
UIColor * _savedBackgroundColor;
BOOL _savedHideKeyboardAccessoryView;
Expand Down Expand Up @@ -156,7 +155,7 @@ - (WKWebViewConfiguration *)setUpWkWebViewConfig
wkWebViewConfig.websiteDataStore = [WKWebsiteDataStore defaultDataStore];
}
if(self.useSharedProcessPool) {
wkWebViewConfig.processPool = [[RNCWKProcessPoolManager sharedManager] sharedProcessPool];
wkWebViewConfig.processPool = [[RNCNewWKProcessPoolManager sharedManager] sharedProcessPool];
}
wkWebViewConfig.userContentController = [WKUserContentController new];

Expand Down Expand Up @@ -705,7 +704,7 @@ - (void)layoutSubviews
{
[super layoutSubviews];

// Ensure webview takes the position and dimensions of RNCWebView
// Ensure webview takes the position and dimensions of RNCNewWKWebView
_webView.frame = self.bounds;
_webView.scrollView.contentInset = _contentInset;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
3515965E21A3C86000623BFA /* RNCWKProcessPoolManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */; };
E91B351D21446E6C00F9801F /* RNCWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351B21446E6C00F9801F /* RNCWebViewManager.m */; };
E91B351E21446E6C00F9801F /* RNCWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351C21446E6C00F9801F /* RNCWebView.m */; };
3515965E21A3C86000623BFA /* RNCNewWKProcessPoolManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3515965D21A3C86000623BFA /* RNCNewWKProcessPoolManager.m */; };
E91B351D21446E6C00F9801F /* RNCNewWKWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351B21446E6C00F9801F /* RNCNewWKWebViewManager.m */; };
E91B351E21446E6C00F9801F /* RNCNewWKWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351C21446E6C00F9801F /* RNCNewWKWebView.m */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -25,13 +25,13 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
134814201AA4EA6300B7C361 /* libRNCWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNCWKProcessPoolManager.m; sourceTree = "<group>"; };
3515965F21A3C87E00623BFA /* RNCWKProcessPoolManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNCWKProcessPoolManager.h; sourceTree = "<group>"; };
E91B351921446E6C00F9801F /* RNCWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCWebViewManager.h; sourceTree = "<group>"; };
E91B351A21446E6C00F9801F /* RNCWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCWebView.h; sourceTree = "<group>"; };
E91B351B21446E6C00F9801F /* RNCWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCWebViewManager.m; sourceTree = "<group>"; };
E91B351C21446E6C00F9801F /* RNCWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCWebView.m; sourceTree = "<group>"; };
134814201AA4EA6300B7C361 /* libRNCNewWKWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCNewWKWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
3515965D21A3C86000623BFA /* RNCNewWKProcessPoolManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNCNewWKProcessPoolManager.m; sourceTree = "<group>"; };
3515965F21A3C87E00623BFA /* RNCNewWKProcessPoolManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNCNewWKProcessPoolManager.h; sourceTree = "<group>"; };
E91B351921446E6C00F9801F /* RNCNewWKWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCNewWKWebViewManager.h; sourceTree = "<group>"; };
E91B351A21446E6C00F9801F /* RNCNewWKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCNewWKWebView.h; sourceTree = "<group>"; };
E91B351B21446E6C00F9801F /* RNCNewWKWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCNewWKWebViewManager.m; sourceTree = "<group>"; };
E91B351C21446E6C00F9801F /* RNCNewWKWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCNewWKWebView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -48,30 +48,30 @@
134814211AA4EA7D00B7C361 /* Products */ = {
isa = PBXGroup;
children = (
134814201AA4EA6300B7C361 /* libRNCWebView.a */,
134814201AA4EA6300B7C361 /* libRNCNewWKWebView.a */,
);
name = Products;
sourceTree = "<group>";
};
58B511D21A9E6C8500147676 = {
isa = PBXGroup;
children = (
E91B351A21446E6C00F9801F /* RNCWebView.h */,
E91B351C21446E6C00F9801F /* RNCWebView.m */,
E91B351921446E6C00F9801F /* RNCWebViewManager.h */,
E91B351B21446E6C00F9801F /* RNCWebViewManager.m */,
3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */,
3515965F21A3C87E00623BFA /* RNCWKProcessPoolManager.h */,
E91B351A21446E6C00F9801F /* RNCNewWKWebView.h */,
E91B351C21446E6C00F9801F /* RNCNewWKWebView.m */,
E91B351921446E6C00F9801F /* RNCNewWKWebViewManager.h */,
E91B351B21446E6C00F9801F /* RNCNewWKWebViewManager.m */,
3515965D21A3C86000623BFA /* RNCNewWKProcessPoolManager.m */,
3515965F21A3C87E00623BFA /* RNCNewWKProcessPoolManager.h */,
134814211AA4EA7D00B7C361 /* Products */,
);
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
58B511DA1A9E6C8500147676 /* RNCWebView */ = {
58B511DA1A9E6C8500147676 /* RNCNewWKWebView */ = {
isa = PBXNativeTarget;
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCWebView" */;
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCNewWKWebView" */;
buildPhases = (
58B511D71A9E6C8500147676 /* Sources */,
58B511D81A9E6C8500147676 /* Frameworks */,
Expand All @@ -81,9 +81,9 @@
);
dependencies = (
);
name = RNCWebView;
name = RNCNewWKWebView;
productName = RCTDataManager;
productReference = 134814201AA4EA6300B7C361 /* libRNCWebView.a */;
productReference = 134814201AA4EA6300B7C361 /* libRNCNewWKWebView.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
Expand All @@ -100,7 +100,7 @@
};
};
};
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCWebView" */;
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCNewWKWebView" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand All @@ -112,7 +112,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
58B511DA1A9E6C8500147676 /* RNCWebView */,
58B511DA1A9E6C8500147676 /* RNCNewWKWebView */,
);
};
/* End PBXProject section */
Expand All @@ -122,9 +122,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E91B351D21446E6C00F9801F /* RNCWebViewManager.m in Sources */,
E91B351E21446E6C00F9801F /* RNCWebView.m in Sources */,
3515965E21A3C86000623BFA /* RNCWKProcessPoolManager.m in Sources */,
E91B351D21446E6C00F9801F /* RNCNewWKWebViewManager.m in Sources */,
E91B351E21446E6C00F9801F /* RNCNewWKWebView.m in Sources */,
3515965E21A3C86000623BFA /* RNCNewWKProcessPoolManager.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -223,7 +223,7 @@
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = RNCWebView;
PRODUCT_NAME = RNCNewWKWebView;
SKIP_INSTALL = YES;
};
name = Debug;
Expand All @@ -239,15 +239,15 @@
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = RNCWebView;
PRODUCT_NAME = RNCNewWKWebView;
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCWebView" */ = {
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNCNewWKWebView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
58B511ED1A9E6C8500147676 /* Debug */,
Expand All @@ -256,7 +256,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCWebView" */ = {
58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNCNewWKWebView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
58B511F01A9E6C8500147676 /* Debug */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "58B511DA1A9E6C8500147676"
BuildableName = "libRNCNewWKWebView.a"
BlueprintName = "RNCNewWKWebView"
ReferencedContainer = "container:RNCNewWKWebView.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "58B511DA1A9E6C8500147676"
BuildableName = "libRNCNewWKWebView.a"
BlueprintName = "RNCNewWKWebView"
ReferencedContainer = "container:RNCNewWKWebView.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion ios/RNCWebViewManager.h → ios/RNCNewWKWebViewManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

#import <React/RCTViewManager.h>

@interface RNCWebViewManager : RCTViewManager
@interface RNCNewWKWebViewManager : RCTViewManager
@end
Loading

0 comments on commit fe20b45

Please sign in to comment.