├── .gitignore ├── LICENSE ├── README.md ├── Viewport.android.js ├── Viewport.h ├── Viewport.ios.js ├── Viewport.m ├── Viewport.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── Viewport.xccheckout └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | Viewport.xcodeproj/xcuserdata 3 | Viewport.xcodeproj/project.xcworkspace/xcuserdata 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Peter Janak 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-viewport 2 | Utility to get current size of the viewport. 3 | 4 | ## Add it to your project 5 | 6 | 1. Run `npm install react-native-viewport --save` 7 | 2. Open your project in XCode, right click on `Libraries` and click `Add Files to "Your Project Name"`. 8 | 3. Navigate to `node_modules/react-native-viewport` 9 | 4. Select `Viewport.xcodeproj` 10 | 5. Add `libViewport.a` to `Build Phases -> Link Binary With Libraries`. 11 | 6. Click on `Viewport.xcodeproj` in `Libraries` and go the `Build Settings` tab. Double click the text to the right of `Header Search Paths` and verify that it has `$(SRCROOT)../react-native/React` - if it isn't, then add it. This is so XCode is able to find the headers that the `Viewport` source files are referring to by pointing to the header files installed within the `react-native` `node_modules` directory. 12 | 7. Whenever you want to use it within React code now you can: `var Viewport = require('react-native-viewport');` 13 | 14 | ## Methods 15 | *** 16 | Note that any time you receive dimensions you will be given an object formatted like so: 17 | 18 | ``` 19 | { 20 | width: 120, 21 | height: 120 22 | } 23 | ``` 24 | *** 25 | 26 | `addEventListener(eventName, callback)` 27 | 28 | >Adds an event listener to the backing viewport manager. Will call the provided callback whenever the event is fired. 29 | 30 | >Currently the only supported event is `dimensionsDidChange`. As a convenience, you can reference this event via `Viewport.events.DEVICE_DIMENSIONS_EVENT`. This event fires whenever the dimensions of the screen change (e.g. a screen rotation). 31 | 32 | `removeEventListener(eventName, callback)` 33 | 34 | >Removes an event listener from the backing viewport manager. Will only remove listeners with the exact name and callback specified. 35 | 36 | `getDimensions(callback)` 37 | 38 | >Gets the current dimensions and passes them to the specified callback. This is useful if you ever want to get dimensions in an adhoc way, such as when the app first boots up and before you have the chance to attach a listener. 39 | 40 | 41 | -------------------------------------------------------------------------------- /Viewport.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Stub of Sample for Android. 3 | * 4 | * @providesModule Viewport 5 | * @flow 6 | */ 7 | 'use strict'; 8 | 9 | var warning = require('warning'); 10 | 11 | var Viewport = { 12 | test: function() { 13 | warning("Not yet implemented for Android.") 14 | } 15 | }; 16 | 17 | module.exports = Sample; -------------------------------------------------------------------------------- /Viewport.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "RCTBridgeModule.h" 11 | 12 | @interface Viewport : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Viewport.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | * @providesModule Viewport 10 | * @flow 11 | */ 12 | 'use strict'; 13 | 14 | var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); 15 | var ViewportManager = require('NativeModules').Viewport; 16 | var invariant = require('invariant'); 17 | 18 | /** 19 | * Viewport gives access to the viewport's height and width. 20 | * 21 | * This could be used if someone wanted an image which stretched the width of 22 | * the device. 23 | * 24 | * Note: The values returned here are all ready in terms of the pixel ratio of 25 | * the device. For example, the iPhone 6 renders 750x1334 pixels. However, it has 26 | * a pixel ratio of two. Therefore the return values of these functions will 27 | * already be modified by the pixel ratio. In the iPhone 6's case this means 28 | * that the resolution that gets returned will be 375x667. 29 | */ 30 | var Viewport = {}; 31 | 32 | var _dimensionSubscriptions = {}; 33 | 34 | Viewport.events = { 35 | DEVICE_DIMENSIONS_EVENT: 'dimensionsDidChange' 36 | }; 37 | 38 | Viewport.addEventListener = function( 39 | eventName: ChangeEventName, 40 | handler: Function 41 | ): void { 42 | invariant(eventName === Viewport.events.DEVICE_DIMENSIONS_EVENT, 43 | 'No event by name ' + eventName); 44 | _dimensionSubscriptions[handler] = RCTDeviceEventEmitter.addListener( 45 | Viewport.events.DEVICE_DIMENSIONS_EVENT, 46 | handler 47 | ); 48 | }; 49 | 50 | Viewport.removeEventListener = function( 51 | eventName: ChangeEventName, 52 | handler: Function 53 | ): void { 54 | if (!_dimensionSubscriptions[handler]) { 55 | return; 56 | } 57 | _dimensionSubscriptions[handler].remove(); 58 | _dimensionSubscriptions[handler] = null; 59 | }; 60 | 61 | Viewport.getDimensions = function( 62 | handler: Function 63 | ) { 64 | ViewportManager.getCurrentDimensions(handler); 65 | } 66 | 67 | module.exports = Viewport; 68 | -------------------------------------------------------------------------------- /Viewport.m: -------------------------------------------------------------------------------- 1 | #import "Viewport.h" 2 | #import "RCTBridge.h" 3 | #import "RCTEventDispatcher.h" 4 | #import "RCTUtils.h" 5 | 6 | static NSDictionary *RCTCurrentDimensions() 7 | { 8 | static NSDictionary *dimensions; 9 | 10 | CGSize frameSize = [UIScreen mainScreen].applicationFrame.size; 11 | if ((NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1) 12 | && UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) { 13 | frameSize = CGSizeMake(frameSize.height, frameSize.width); 14 | } 15 | 16 | dimensions = @{ 17 | @"width": @(frameSize.width), 18 | @"height": @(frameSize.height) 19 | }; 20 | 21 | return dimensions; 22 | } 23 | 24 | 25 | @implementation Viewport 26 | { 27 | NSDictionary *_lastKnownDimensions; 28 | } 29 | 30 | @synthesize bridge = _bridge; 31 | 32 | RCT_EXPORT_MODULE(); 33 | 34 | #pragma mark - Lifecycle 35 | 36 | - (instancetype)init 37 | { 38 | if ((self = [super init])) { 39 | _lastKnownDimensions = RCTCurrentDimensions(); 40 | 41 | [[NSNotificationCenter defaultCenter] addObserver:self 42 | selector:@selector(deviceOrientationDidChangeNotification:) 43 | name:UIDeviceOrientationDidChangeNotification 44 | object:nil]; 45 | } 46 | 47 | return self; 48 | } 49 | 50 | - (void)dealloc 51 | { 52 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 53 | } 54 | 55 | #pragma mark - Notification methods 56 | 57 | - (void)deviceOrientationDidChangeNotification:(NSNotification*)note 58 | { 59 | _lastKnownDimensions = RCTCurrentDimensions(); 60 | [_bridge.eventDispatcher sendDeviceEventWithName:@"dimensionsDidChange" body:_lastKnownDimensions]; 61 | } 62 | 63 | #pragma mark - Public API 64 | /** 65 | * Get the current dimensions of the viewport 66 | */ 67 | RCT_EXPORT_METHOD(getCurrentDimensions:(RCTResponseSenderBlock)callback) 68 | { 69 | _lastKnownDimensions = RCTCurrentDimensions(); 70 | callback(@[_lastKnownDimensions]); 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Viewport.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13BE3DEE1AC21097009241FE /* Viewport.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* Viewport.m */; }; 11 | /* End PBXBuildFile section */ 12 | 13 | /* Begin PBXCopyFilesBuildPhase section */ 14 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 15 | isa = PBXCopyFilesBuildPhase; 16 | buildActionMask = 2147483647; 17 | dstPath = "include/$(PRODUCT_NAME)"; 18 | dstSubfolderSpec = 16; 19 | files = ( 20 | ); 21 | runOnlyForDeploymentPostprocessing = 0; 22 | }; 23 | /* End PBXCopyFilesBuildPhase section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 134814201AA4EA6300B7C361 /* libViewport.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libViewport.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | 13BE3DEC1AC21097009241FE /* Viewport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Viewport.h; sourceTree = ""; }; 28 | 13BE3DED1AC21097009241FE /* Viewport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Viewport.m; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 134814211AA4EA7D00B7C361 /* Products */ = { 43 | isa = PBXGroup; 44 | children = ( 45 | 134814201AA4EA6300B7C361 /* libViewport.a */, 46 | ); 47 | name = Products; 48 | sourceTree = ""; 49 | }; 50 | 58B511D21A9E6C8500147676 = { 51 | isa = PBXGroup; 52 | children = ( 53 | 13BE3DEC1AC21097009241FE /* Viewport.h */, 54 | 13BE3DED1AC21097009241FE /* Viewport.m */, 55 | 134814211AA4EA7D00B7C361 /* Products */, 56 | ); 57 | sourceTree = ""; 58 | }; 59 | /* End PBXGroup section */ 60 | 61 | /* Begin PBXNativeTarget section */ 62 | 58B511DA1A9E6C8500147676 /* Viewport */ = { 63 | isa = PBXNativeTarget; 64 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Viewport" */; 65 | buildPhases = ( 66 | 58B511D71A9E6C8500147676 /* Sources */, 67 | 58B511D81A9E6C8500147676 /* Frameworks */, 68 | 58B511D91A9E6C8500147676 /* CopyFiles */, 69 | ); 70 | buildRules = ( 71 | ); 72 | dependencies = ( 73 | ); 74 | name = Viewport; 75 | productName = RCTDataManager; 76 | productReference = 134814201AA4EA6300B7C361 /* libViewport.a */; 77 | productType = "com.apple.product-type.library.static"; 78 | }; 79 | /* End PBXNativeTarget section */ 80 | 81 | /* Begin PBXProject section */ 82 | 58B511D31A9E6C8500147676 /* Project object */ = { 83 | isa = PBXProject; 84 | attributes = { 85 | LastUpgradeCheck = 0610; 86 | ORGANIZATIONNAME = ""; 87 | TargetAttributes = { 88 | 58B511DA1A9E6C8500147676 = { 89 | CreatedOnToolsVersion = 6.1.1; 90 | }; 91 | }; 92 | }; 93 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Viewport" */; 94 | compatibilityVersion = "Xcode 3.2"; 95 | developmentRegion = English; 96 | hasScannedForEncodings = 0; 97 | knownRegions = ( 98 | en, 99 | ); 100 | mainGroup = 58B511D21A9E6C8500147676; 101 | productRefGroup = 58B511D21A9E6C8500147676; 102 | projectDirPath = ""; 103 | projectRoot = ""; 104 | targets = ( 105 | 58B511DA1A9E6C8500147676 /* Viewport */, 106 | ); 107 | }; 108 | /* End PBXProject section */ 109 | 110 | /* Begin PBXSourcesBuildPhase section */ 111 | 58B511D71A9E6C8500147676 /* Sources */ = { 112 | isa = PBXSourcesBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | 13BE3DEE1AC21097009241FE /* Viewport.m in Sources */, 116 | ); 117 | runOnlyForDeploymentPostprocessing = 0; 118 | }; 119 | /* End PBXSourcesBuildPhase section */ 120 | 121 | /* Begin XCBuildConfiguration section */ 122 | 58B511ED1A9E6C8500147676 /* Debug */ = { 123 | isa = XCBuildConfiguration; 124 | buildSettings = { 125 | ALWAYS_SEARCH_USER_PATHS = NO; 126 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 127 | CLANG_CXX_LIBRARY = "libc++"; 128 | CLANG_ENABLE_MODULES = YES; 129 | CLANG_ENABLE_OBJC_ARC = YES; 130 | CLANG_WARN_BOOL_CONVERSION = YES; 131 | CLANG_WARN_CONSTANT_CONVERSION = YES; 132 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 133 | CLANG_WARN_EMPTY_BODY = YES; 134 | CLANG_WARN_ENUM_CONVERSION = YES; 135 | CLANG_WARN_INT_CONVERSION = YES; 136 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 137 | CLANG_WARN_UNREACHABLE_CODE = YES; 138 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 139 | COPY_PHASE_STRIP = NO; 140 | ENABLE_STRICT_OBJC_MSGSEND = YES; 141 | GCC_C_LANGUAGE_STANDARD = gnu99; 142 | GCC_DYNAMIC_NO_PIC = NO; 143 | GCC_OPTIMIZATION_LEVEL = 0; 144 | GCC_PREPROCESSOR_DEFINITIONS = ( 145 | "DEBUG=1", 146 | "$(inherited)", 147 | ); 148 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 149 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 150 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 151 | GCC_WARN_UNDECLARED_SELECTOR = YES; 152 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 153 | GCC_WARN_UNUSED_FUNCTION = YES; 154 | GCC_WARN_UNUSED_VARIABLE = YES; 155 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 156 | MTL_ENABLE_DEBUG_INFO = YES; 157 | ONLY_ACTIVE_ARCH = YES; 158 | SDKROOT = iphoneos; 159 | TARGETED_DEVICE_FAMILY = 1; 160 | }; 161 | name = Debug; 162 | }; 163 | 58B511EE1A9E6C8500147676 /* Release */ = { 164 | isa = XCBuildConfiguration; 165 | buildSettings = { 166 | ALWAYS_SEARCH_USER_PATHS = NO; 167 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 168 | CLANG_CXX_LIBRARY = "libc++"; 169 | CLANG_ENABLE_MODULES = YES; 170 | CLANG_ENABLE_OBJC_ARC = YES; 171 | CLANG_WARN_BOOL_CONVERSION = YES; 172 | CLANG_WARN_CONSTANT_CONVERSION = YES; 173 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 174 | CLANG_WARN_EMPTY_BODY = YES; 175 | CLANG_WARN_ENUM_CONVERSION = YES; 176 | CLANG_WARN_INT_CONVERSION = YES; 177 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 178 | CLANG_WARN_UNREACHABLE_CODE = YES; 179 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 180 | COPY_PHASE_STRIP = YES; 181 | ENABLE_NS_ASSERTIONS = NO; 182 | ENABLE_STRICT_OBJC_MSGSEND = YES; 183 | GCC_C_LANGUAGE_STANDARD = gnu99; 184 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 185 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 186 | GCC_WARN_UNDECLARED_SELECTOR = YES; 187 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 188 | GCC_WARN_UNUSED_FUNCTION = YES; 189 | GCC_WARN_UNUSED_VARIABLE = YES; 190 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 191 | MTL_ENABLE_DEBUG_INFO = NO; 192 | SDKROOT = iphoneos; 193 | TARGETED_DEVICE_FAMILY = 1; 194 | VALIDATE_PRODUCT = YES; 195 | }; 196 | name = Release; 197 | }; 198 | 58B511F01A9E6C8500147676 /* Debug */ = { 199 | isa = XCBuildConfiguration; 200 | buildSettings = { 201 | HEADER_SEARCH_PATHS = ( 202 | "$(inherited)", 203 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 204 | "$(SRCROOT)/node_modules/react-native/React/**", 205 | "$(SRCROOT)/../../React/**", 206 | "$(SRCROOT)/../react-native/React/**", 207 | ); 208 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 209 | OTHER_LDFLAGS = "-ObjC"; 210 | PRODUCT_NAME = Viewport; 211 | SKIP_INSTALL = YES; 212 | STRIP_INSTALLED_PRODUCT = YES; 213 | TARGETED_DEVICE_FAMILY = 1; 214 | }; 215 | name = Debug; 216 | }; 217 | 58B511F11A9E6C8500147676 /* Release */ = { 218 | isa = XCBuildConfiguration; 219 | buildSettings = { 220 | HEADER_SEARCH_PATHS = ( 221 | "$(inherited)", 222 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 223 | "$(SRCROOT)/node_modules/react-native/React/**", 224 | "$(SRCROOT)/../../React/**", 225 | "$(SRCROOT)/../react-native/React/**", 226 | ); 227 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 228 | OTHER_LDFLAGS = "-ObjC"; 229 | PRODUCT_NAME = Viewport; 230 | SKIP_INSTALL = YES; 231 | STRIP_INSTALLED_PRODUCT = YES; 232 | TARGETED_DEVICE_FAMILY = 1; 233 | }; 234 | name = Release; 235 | }; 236 | /* End XCBuildConfiguration section */ 237 | 238 | /* Begin XCConfigurationList section */ 239 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "Viewport" */ = { 240 | isa = XCConfigurationList; 241 | buildConfigurations = ( 242 | 58B511ED1A9E6C8500147676 /* Debug */, 243 | 58B511EE1A9E6C8500147676 /* Release */, 244 | ); 245 | defaultConfigurationIsVisible = 0; 246 | defaultConfigurationName = Release; 247 | }; 248 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "Viewport" */ = { 249 | isa = XCConfigurationList; 250 | buildConfigurations = ( 251 | 58B511F01A9E6C8500147676 /* Debug */, 252 | 58B511F11A9E6C8500147676 /* Release */, 253 | ); 254 | defaultConfigurationIsVisible = 0; 255 | defaultConfigurationName = Release; 256 | }; 257 | /* End XCConfigurationList section */ 258 | }; 259 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 260 | } 261 | -------------------------------------------------------------------------------- /Viewport.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Viewport.xcodeproj/project.xcworkspace/xcshareddata/Viewport.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 809A1765-FDD7-4B52-8E8A-7D76A5DEEEDE 9 | IDESourceControlProjectName 10 | project 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 02BAA710A4410DAA84A4BD6D093983C84F4B4869 14 | github.com:pjjanak/react-native-viewport.git 15 | 16 | IDESourceControlProjectPath 17 | Viewport.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 02BAA710A4410DAA84A4BD6D093983C84F4B4869 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:pjjanak/react-native-viewport.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 02BAA710A4410DAA84A4BD6D093983C84F4B4869 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 02BAA710A4410DAA84A4BD6D093983C84F4B4869 36 | IDESourceControlWCCName 37 | react-native-viewport 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-viewport", 3 | "version": "0.0.2", 4 | "description": "Viewport dimensions for react-native", 5 | "keywords": ["react-component", "react-native", "react", "ios", "viewport", "screen", "dimensions"], 6 | "bugs": "https://github.com/pjjanak/react-native-viewport/issues", 7 | "license": "MIT", 8 | "author": { 9 | "name": "Peter Janak" 10 | }, 11 | "main": "./Viewport.ios.js", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/pjjanak/react-native-viewport.git" 15 | }, 16 | "dependencies": { 17 | "react-native": "^0.4.0" 18 | } 19 | } 20 | --------------------------------------------------------------------------------