Layout Plugin support for swift (#295)
Summary: Changed the podspec file to expose only those header files in public which are necessary. The exposed public header files have no c++ in it, thus due to this layout plugin now works for swift too. Fixes #174  Pull Request resolved: https://github.com/facebook/flipper/pull/295 Reviewed By: passy Differential Revision: D10389202 Pulled By: priteshrnandgaonkar fbshipit-source-id: 0ecc428f8008dd3aac48a675a8b97bb610f8e9eb
This commit is contained in:
committed by
Facebook Github Bot
parent
c544199289
commit
603c4c5fbc
@@ -63,6 +63,8 @@ dependencies {
|
||||
|
||||
### iOS
|
||||
|
||||
In Objective-C you can add it as follows:
|
||||
|
||||
```objective-c
|
||||
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
|
||||
#import <FlipperKitLayoutPlugin/SKDescriptorMapper.h>
|
||||
@@ -71,6 +73,18 @@ SKDescriptorMapper *mapper = [[SKDescriptorMapper alloc] initWithDefaults];
|
||||
[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:context.application withDescriptorMapper:mapper]]
|
||||
```
|
||||
|
||||
Whereas in swift you can add it as follows:
|
||||
|
||||
```swift
|
||||
import FlipperKit
|
||||
|
||||
let layoutDescriptorMapper = SKDescriptorMapper(defaults: ())
|
||||
// If you want to debug componentkit view in swift, otherwise you can ignore the next line
|
||||
FlipperKitLayoutComponentKitSupport.setUpWith(layoutDescriptorMapper)
|
||||
|
||||
client?.add(FlipperKitLayoutPlugin(rootNode: application, with: layoutDescriptorMapper!))
|
||||
```
|
||||
|
||||
## Quick edits
|
||||
|
||||
The Layout Inspector not only allows you to view the hierarchy and inspect each item's properties, but it also allows you to edit things such as layout attributes, background colors, props, and state. Most things actually. This allows you to quickly tweak paddings, margins, and colors until you are happy with them, all without re-compiling. This can save you many hours implementing a new design.
|
||||
|
||||
Reference in New Issue
Block a user