Initial commit 🎉

fbshipit-source-id: b6fc29740c6875d2e78953b8a7123890a67930f2
Co-authored-by: Sebastian McKenzie <sebmck@fb.com>
Co-authored-by: John Knox <jknox@fb.com>
Co-authored-by: Emil Sjölander <emilsj@fb.com>
Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com>
This commit is contained in:
Daniel Büchele
2018-04-13 08:38:06 -07:00
committed by Daniel Buchele
commit fbbf8cf16b
659 changed files with 87130 additions and 0 deletions

11
iOS/Sample/AppDelegate.h Normal file
View File

@@ -0,0 +1,11 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@end

53
iOS/Sample/AppDelegate.mm Normal file
View File

@@ -0,0 +1,53 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#import "AppDelegate.h"
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <SonarKit/SonarClient.h>
#import <SonarKitLayoutComponentKitSupport/SonarKitLayoutComponentKitSupport.h>
#import <SonarKitLayoutPlugin/SonarKitLayoutPlugin.h>
#import <SonarKitNetworkPlugin/SonarKitNetworkPlugin.h>
#import "MainViewController.h"
#import "RootViewController.h"
#if !FB_SONARKIT_ENABLED
#error "Sample need to be run with SonarKit enabled in order to properly interact with Sonar. SonarKit is enabled by default if its a debug build."
#endif
@implementation AppDelegate {
UIWindow *_window;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
SonarClient *client = [SonarClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
[SonarKitLayoutComponentKitSupport setUpWithDescriptorMapper: layoutDescriptorMapper];
[client addPlugin: [[SonarKitLayoutPlugin alloc] initWithRootNode: application
withDescriptorMapper: layoutDescriptorMapper]];
[[SonarClient sharedClient] addPlugin: [[SonarKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
[[SonarClient sharedClient] start];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryBoard" bundle:nil];
MainViewController *mainViewController = [storyboard instantiateViewControllerWithIdentifier:@"MainViewController"];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController: mainViewController];
navigationController.navigationBar.topItem.title = @"Sample";
navigationController.navigationBar.translucent = NO;
[_window setRootViewController: [[UINavigationController alloc] initWithRootViewController: mainViewController]];
[_window makeKeyAndVisible];
return YES;
}
@end

View File

@@ -0,0 +1,62 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon_20pt@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon_20pt@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon_29pt@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon_29pt@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon_40pt@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon_40pt@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon_60pt@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon_60pt@3x.png",
"scale" : "3x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "icon_83.5@2x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sonarpattern.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

43
iOS/Sample/Info.plist Normal file
View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.facebook.sonar</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Main View Controller-->
<scene sceneID="bsE-tG-aac">
<objects>
<viewController storyboardIdentifier="MainViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="2r2-64-LPh" customClass="MainViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="GoF-kQ-JxU">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sonarpattern" translatesAutoresizingMaskIntoConstraints="NO" id="B57-dd-H6T">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="R0E-21-TJB">
<rect key="frame" x="0.0" y="20" width="375" height="60"/>
<color key="backgroundColor" red="0.89411764709999997" green="0.87450980389999999" blue="0.92941176469999998" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="DUb-hX-xeU"/>
</constraints>
<state key="normal" title="Network Inspector">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="tappedNetworkInspector:" destination="2r2-64-LPh" eventType="touchUpInside" id="6Ta-mA-Ybz"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xh0-Q4-60g">
<rect key="frame" x="0.0" y="88" width="375" height="60"/>
<color key="backgroundColor" red="0.89411764709999997" green="0.87450980389999999" blue="0.92941176469999998" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="XTt-ck-0aH"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="60" id="d85-OI-WKV"/>
</constraints>
<state key="normal" title="ComponentKit Layout">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="tappedComponentKitLayout:" destination="2r2-64-LPh" eventType="touchUpInside" id="amo-e0-rJv"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="xh0-Q4-60g" firstAttribute="trailing" secondItem="fhd-5r-dZW" secondAttribute="trailing" id="0Uf-Hu-a0E"/>
<constraint firstItem="xh0-Q4-60g" firstAttribute="top" secondItem="R0E-21-TJB" secondAttribute="bottom" constant="8" id="1LN-rK-SJg"/>
<constraint firstItem="R0E-21-TJB" firstAttribute="top" secondItem="fhd-5r-dZW" secondAttribute="top" id="4Og-b3-TDg"/>
<constraint firstItem="R0E-21-TJB" firstAttribute="leading" secondItem="fhd-5r-dZW" secondAttribute="leading" id="7mG-cL-FY7"/>
<constraint firstItem="xh0-Q4-60g" firstAttribute="leading" secondItem="fhd-5r-dZW" secondAttribute="leading" id="DPX-l5-Rca"/>
<constraint firstItem="B57-dd-H6T" firstAttribute="leading" secondItem="fhd-5r-dZW" secondAttribute="leading" id="Hhd-in-vfk"/>
<constraint firstItem="fhd-5r-dZW" firstAttribute="trailing" secondItem="B57-dd-H6T" secondAttribute="trailing" id="ODW-CJ-ean"/>
<constraint firstItem="fhd-5r-dZW" firstAttribute="trailing" secondItem="R0E-21-TJB" secondAttribute="trailing" id="QyG-ez-XwS"/>
<constraint firstItem="fhd-5r-dZW" firstAttribute="bottom" secondItem="B57-dd-H6T" secondAttribute="bottom" id="kh1-ra-tzR"/>
<constraint firstItem="B57-dd-H6T" firstAttribute="top" secondItem="fhd-5r-dZW" secondAttribute="top" id="vGA-oo-EGc"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fhd-5r-dZW"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="d8y-kY-iPg" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="222" y="286"/>
</scene>
<!--Network View Controller-->
<scene sceneID="Zgm-Mh-TPB">
<objects>
<viewController storyboardIdentifier="NetworkViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="qMe-JX-czP" customClass="NetworkViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="1kD-re-kO3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sonarpattern" translatesAutoresizingMaskIntoConstraints="NO" id="ytS-7A-bty">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WSh-CB-RQ8">
<rect key="frame" x="40" y="257.5" width="295" height="152"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cp1-5I-XfA">
<rect key="frame" x="0.0" y="8" width="295" height="40"/>
<color key="backgroundColor" red="0.89411764705882346" green="0.87450980392156863" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="hEd-JE-i7Y"/>
</constraints>
<state key="normal" title="GET API">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="tappedGetAPI:" destination="qMe-JX-czP" eventType="touchUpInside" id="Xb9-5E-G2l"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Fel-3h-2Ts">
<rect key="frame" x="0.0" y="56" width="295" height="40"/>
<color key="backgroundColor" red="0.89411764709999997" green="0.87450980389999999" blue="0.92941176469999998" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="FZH-fX-J9r"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="40" id="jrN-nN-euJ"/>
</constraints>
<state key="normal" title="POST API">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="tappedPOSTAPI:" destination="qMe-JX-czP" eventType="touchUpInside" id="kv5-Bd-q86"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cYg-iA-yAD">
<rect key="frame" x="0.0" y="104" width="295" height="40"/>
<color key="backgroundColor" red="0.89411764709999997" green="0.87450980389999999" blue="0.92941176469999998" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Ge2-aM-Eg0"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="40" id="HCy-ae-Gdv"/>
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="40" id="qNh-k0-ArC"/>
</constraints>
<state key="normal" title="Github FB Litho">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="tappedGithubLitho:" destination="qMe-JX-czP" eventType="touchUpInside" id="SPR-ez-foo"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="cYg-iA-yAD" firstAttribute="leading" secondItem="WSh-CB-RQ8" secondAttribute="leading" id="0kX-uC-WJE"/>
<constraint firstAttribute="trailing" secondItem="cYg-iA-yAD" secondAttribute="trailing" id="AhI-YX-f2y"/>
<constraint firstItem="cp1-5I-XfA" firstAttribute="top" secondItem="WSh-CB-RQ8" secondAttribute="top" constant="8" id="Cvx-D3-uOd"/>
<constraint firstAttribute="trailing" secondItem="Fel-3h-2Ts" secondAttribute="trailing" id="Me3-xl-G4o"/>
<constraint firstItem="Fel-3h-2Ts" firstAttribute="leading" secondItem="WSh-CB-RQ8" secondAttribute="leading" id="UjN-Wu-rMh"/>
<constraint firstItem="cYg-iA-yAD" firstAttribute="top" secondItem="Fel-3h-2Ts" secondAttribute="bottom" constant="8" id="ZC6-2u-nON"/>
<constraint firstAttribute="trailing" secondItem="cp1-5I-XfA" secondAttribute="trailing" id="eHK-MT-ycp"/>
<constraint firstItem="cp1-5I-XfA" firstAttribute="leading" secondItem="WSh-CB-RQ8" secondAttribute="leading" id="jcb-e1-AgW"/>
<constraint firstAttribute="bottom" secondItem="cYg-iA-yAD" secondAttribute="bottom" constant="8" id="lzW-9m-4E3"/>
<constraint firstItem="Fel-3h-2Ts" firstAttribute="top" secondItem="cp1-5I-XfA" secondAttribute="bottom" constant="8" id="sAQ-IL-GiU"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="WSh-CB-RQ8" firstAttribute="centerY" secondItem="1kD-re-kO3" secondAttribute="centerY" id="3BG-Ur-hnA"/>
<constraint firstItem="dLV-zh-N2b" firstAttribute="bottom" secondItem="ytS-7A-bty" secondAttribute="bottom" id="3E3-Q6-qrR"/>
<constraint firstItem="dLV-zh-N2b" firstAttribute="trailing" secondItem="ytS-7A-bty" secondAttribute="trailing" id="Otd-ig-Ezq"/>
<constraint firstItem="dLV-zh-N2b" firstAttribute="trailing" secondItem="WSh-CB-RQ8" secondAttribute="trailing" constant="40" id="RUW-bQ-Oql"/>
<constraint firstItem="WSh-CB-RQ8" firstAttribute="leading" secondItem="dLV-zh-N2b" secondAttribute="leading" constant="40" id="dhp-xN-0UN"/>
<constraint firstItem="ytS-7A-bty" firstAttribute="top" secondItem="dLV-zh-N2b" secondAttribute="top" id="lsK-fA-AsM"/>
<constraint firstItem="ytS-7A-bty" firstAttribute="leading" secondItem="dLV-zh-N2b" secondAttribute="leading" id="wRh-vG-hUe"/>
</constraints>
<viewLayoutGuide key="safeArea" id="dLV-zh-N2b"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="jLg-IP-htV" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="958" y="280"/>
</scene>
</scenes>
<resources>
<image name="sonarpattern" width="421" height="658"/>
</resources>
</document>

View File

@@ -0,0 +1,12 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#import <UIKit/UIKit.h>
@interface MainViewController : UIViewController
@end

View File

@@ -0,0 +1,38 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#import "MainViewController.h"
#import "NetworkViewController.h"
#import "RootViewController.h"
@interface MainViewController ()
@end
@implementation MainViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (IBAction)tappedComponentKitLayout:(UIButton *)sender {
RootViewController *rootViewController = [RootViewController new];
[self.navigationController pushViewController:rootViewController animated:true];
}
- (IBAction)tappedNetworkInspector:(UIButton *)sender {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryBoard" bundle:nil];
NetworkViewController *networkViewController = [storyboard instantiateViewControllerWithIdentifier:@"NetworkViewController"];
[self.navigationController pushViewController:networkViewController animated:true];
}
@end

View File

@@ -0,0 +1,13 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#import <UIKit/UIKit.h>
@interface NetworkViewController : UIViewController
@end

View File

@@ -0,0 +1,84 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#import "NetworkViewController.h"
@interface NetworkViewController ()
@end
@implementation NetworkViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"Network";
}
- (IBAction)tappedGithubLitho:(UIButton *)sender {
[[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@"https://raw.githubusercontent.com/facebook/litho/master/docs/static/logo.png"] completionHandler:^(NSData *_Nullable data, NSURLResponse *_Nullable response, NSError *_Nullable error) {
if (error && !data) {
return;
}
NSLog(@"Got Image");
}] resume];
}
- (IBAction)tappedPOSTAPI:(UIButton *)sender {
NSString *post = @"https://demo9512366.mockable.io/SonarPost";
NSURL *url = [NSURL URLWithString:post];
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL: url];
[urlRequest addValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[urlRequest addValue:@"application/json" forHTTPHeaderField:@"Accept"];
NSDictionary *mapData = [[NSDictionary alloc] initWithObjectsAndKeys: @"Sonar", @"app",
@"Its awesome", @"remarks",
nil];
NSError *error = nil;
NSData *postData = [NSJSONSerialization dataWithJSONObject:mapData options:0 error:&error];
[urlRequest setHTTPBody:postData];
[urlRequest setHTTPMethod:@"POST"];
__weak NetworkViewController *weakSelf = self;
[[[NSURLSession sharedSession] dataTaskWithRequest:urlRequest completionHandler:^(NSData *_Nullable data, NSURLResponse *_Nullable response, NSError *_Nullable error) {
if (error || !data) {
UIAlertController *alertController = [weakSelf alertControllerForMessage:@"Received error in POST API response"];
[weakSelf presentViewController:alertController animated:true completion:nil];
return;
}
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
NSLog(@"MSG-POST: %@", dict[@"msg"]);
UIAlertController *alertController = [weakSelf alertControllerForMessage:@"Received response from POST API"];
[weakSelf presentViewController:alertController animated:true completion:nil];
}] resume];
}
- (IBAction)tappedGetAPI:(UIButton *)sender {
__weak NetworkViewController *weakSelf = self;
[[[NSURLSession sharedSession] dataTaskWithURL:[NSURL URLWithString:@"https://demo9512366.mockable.io/"] completionHandler:^(NSData *_Nullable data, NSURLResponse *_Nullable response, NSError *_Nullable error) {
if (error || !data) {
UIAlertController *alertController = [weakSelf alertControllerForMessage:@"Received error in GET API response"];
[weakSelf presentViewController:alertController animated:true completion:nil];
return;
}
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
NSLog(@"MSG-GET: %@", dict[@"msg"]);
UIAlertController *alertController = [weakSelf alertControllerForMessage:@"Received response from GET API"];
[weakSelf presentViewController:alertController animated:true completion:nil];
}] resume];
}
- (UIAlertController *)alertControllerForMessage:(nonnull NSString *)msg {
UIAlertController *controller = [UIAlertController alertControllerWithTitle:@"Sonar" message:msg preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *action = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:nil];
[controller addAction:action];
return controller;
}
@end

31
iOS/Sample/Podfile Normal file
View File

@@ -0,0 +1,31 @@
project 'Sample.xcodeproj'
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
swift_version = "4.1"
target 'Sample' do
pod 'EasyWSClient', :podspec => '../third-party-podspecs/EasyWSClient.podspec'
pod 'DoubleConversion', :podspec => '../third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../third-party-podspecs/Folly.podspec'
pod 'PeerTalk', :git => 'https://github.com/rsms/peertalk'
pod 'ComponentKit', :podspec => '../third-party-podspecs/ComponentKit.podspec'
pod 'Yoga','~>1.8.1', :modular_headers => true
pod 'Sonar', :podspec => '../../xplat/Sonar/SonarKitCPP.podspec'
pod 'SonarKit', :podspec => '../SonarKit.podspec'
pod 'SonarKit/SonarKitLayoutComponentKitSupport', :podspec => '../SonarKit.podspec'
pod 'SonarKit/SKIOSNetworkPlugin', :podspec => '../SonarKit.podspec'
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['YogaKit'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = swift_version
end
end
end
end
end

128
iOS/Sample/Podfile.lock Normal file
View File

@@ -0,0 +1,128 @@
PODS:
- boost-for-react-native (1.63.0)
- CocoaAsyncSocket (7.6.3)
- ComponentKit (0.21):
- Yoga
- DoubleConversion (3.0.0)
- EasyWSClient (1.0.0)
- Folly (2018.05.07.00):
- boost-for-react-native
- DoubleConversion
- glog
- glog (0.3.5)
- PeerTalk (0.0.2)
- Sonar (1.0.0):
- EasyWSClient
- Folly
- SonarKit (1.0.0):
- CocoaAsyncSocket (~> 7.6)
- Folly
- PeerTalk
- Sonar
- SonarKit/SKIOSNetworkPlugin (= 1.0.0)
- SonarKit/SonarKitLayoutComponentKitSupport (= 1.0.0)
- SonarKit/SonarKitLayoutPlugin (= 1.0.0)
- SonarKit/SonarKitNetworkPlugin (= 1.0.0)
- SonarKit/SonarKitNetworkPlugin (= 1.0.0)
- SonarKit/SKIOSNetworkPlugin (1.0.0):
- CocoaAsyncSocket (~> 7.6)
- Folly
- PeerTalk
- Sonar
- SonarKit/SonarKitNetworkPlugin
- SonarKit/SonarKitLayoutComponentKitSupport (1.0.0):
- CocoaAsyncSocket (~> 7.6)
- ComponentKit
- Folly
- PeerTalk
- Sonar
- SonarKit/SonarKitLayoutPlugin
- Yoga (= 1.8.1)
- SonarKit/SonarKitLayoutPlugin (1.0.0):
- CocoaAsyncSocket (~> 7.6)
- Folly
- PeerTalk
- Sonar
- Yoga (= 1.8.1)
- YogaKit (= 1.8.1)
- SonarKit/SonarKitNetworkPlugin (1.0.0):
- CocoaAsyncSocket (~> 7.6)
- Folly
- PeerTalk
- Sonar
- Yoga (1.8.1)
- YogaKit (1.8.1):
- Yoga (~> 1.8.1)
DEPENDENCIES:
- ComponentKit (from `../third-party-podspecs/ComponentKit.podspec`)
- DoubleConversion (from `../third-party-podspecs/DoubleConversion.podspec`)
- EasyWSClient (from `../third-party-podspecs/EasyWSClient.podspec`)
- Folly (from `../third-party-podspecs/Folly.podspec`)
- glog (from `../third-party-podspecs/glog.podspec`)
- PeerTalk (from `https://github.com/rsms/peertalk`)
- Sonar (from `../../xplat/Sonar/SonarKitCPP.podspec`)
- SonarKit (from `../SonarKit.podspec`)
- SonarKit/SKIOSNetworkPlugin (from `../SonarKit.podspec`)
- SonarKit/SonarKitLayoutComponentKitSupport (from `../SonarKit.podspec`)
- Yoga (~> 1.8.1)
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- boost-for-react-native
- CocoaAsyncSocket
- Yoga
- YogaKit
EXTERNAL SOURCES:
ComponentKit:
:podspec: "../third-party-podspecs/ComponentKit.podspec"
DoubleConversion:
:podspec: "../third-party-podspecs/DoubleConversion.podspec"
EasyWSClient:
:podspec: "../third-party-podspecs/EasyWSClient.podspec"
Folly:
:podspec: "../third-party-podspecs/Folly.podspec"
glog:
:podspec: "../third-party-podspecs/glog.podspec"
PeerTalk:
:git: https://github.com/rsms/peertalk
Sonar:
:podspec: "../../xplat/Sonar/SonarKitCPP.podspec"
SonarKit:
:podspec: "../SonarKit.podspec"
CHECKOUT OPTIONS:
ComponentKit:
:commit: f801317e71f88fbb5a398cd726fc0375255f43ba
:git: https://github.com/facebook/ComponentKit.git
EasyWSClient:
:commit: 9b87dc488048900a8cd684f51ddc98143682dbc3
:git: https://github.com/dhbaird/easywsclient.git
PeerTalk:
:commit: 588303b43efa5082d654b6f75d1b84a6ba4b5b9e
:git: https://github.com/rsms/peertalk
Sonar:
:commit: 26c298ad3401157ac2b7336218c1dde63260dc0c
:git: https://github.com/facebook/Sonar.git
SonarKit:
:commit: 26c298ad3401157ac2b7336218c1dde63260dc0c
:git: https://github.com/facebook/Sonar.git
SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CocoaAsyncSocket: eafaa68a7e0ec99ead0a7b35015e0bf25d2c8987
ComponentKit: 7bd0ad508946aeb68dd52ed8739ced9846ff3671
DoubleConversion: 310ccd7cdf00175c32883664f84fe026025604df
EasyWSClient: 7ec8effe7d86f6061a47d19a55355769c9edfd2f
Folly: 2d29ed217455246ae583ff1980f9ce882af31e80
glog: f175af2df1f453be65bd355b287a07c842927a99
PeerTalk: f5389c286e4d477e59b73dfbf25c5c70a2464761
Sonar: 815b6c6357c78564d9132f6389605b285a06f052
SonarKit: 29b45073b54d7f5db13e53b7afe6fb6f36c6bea7
Yoga: e6f1fed82138c17da5332e15e5770abf0e9cc386
YogaKit: bb90d11e297e06abef7e0cfb20e035a6bd00cdc4
PODFILE CHECKSUM: cab936292346d86ef8900c8f67d3c707dc421709
COCOAPODS: 1.5.2

View File

@@ -0,0 +1,12 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#import <UIKit/UIKit.h>
@interface RootViewController : UIViewController
@end

View File

@@ -0,0 +1,99 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#import "RootViewController.h"
#import <ComponentKit/CKBackgroundLayoutComponent.h>
#import <ComponentKit/CKButtonComponent.h>
#import <ComponentKit/CKComponent.h>
#import <ComponentKit/CKComponentFlexibleSizeRangeProvider.h>
#import <ComponentKit/CKComponentHostingView.h>
#import <ComponentKit/CKComponentProvider.h>
#import <ComponentKit/CKCompositeComponent.h>
#import <ComponentKit/CKFlexboxComponent.h>
#import <ComponentKit/CKImageComponent.h>
#import <ComponentKit/CKInsetComponent.h>
@interface RootViewController ()
@property (strong, nonatomic) CKComponentHostingView *rootCKHostingView;
@end
@implementation RootViewController
- (instancetype)init
{
if (self = [super init]) {
_rootCKHostingView = [[CKComponentHostingView alloc]
initWithComponentProvider:[self class]
sizeRangeProvider:
[CKComponentFlexibleSizeRangeProvider providerWithFlexibility:CKComponentSizeRangeFlexibleHeight]];
[self.view addSubview:_rootCKHostingView];
[self loadViewIfNeeded];
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"ComponentKit Layout";
self.edgesForExtendedLayout = UIRectEdgeNone;
}
- (void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
_rootCKHostingView.frame = self.view.bounds;
}
+ (CKComponent *)componentForModel:(id<NSObject>)model context:(id<NSObject>)context {
return [CKBackgroundLayoutComponent
newWithComponent:
[CKFlexboxComponent
newWithView:{
}
size:{}
style:{}
children: {
{
[CKButtonComponent
newWithAction:nil
options:{
.titles = @"Purple",
.titleColors = UIColor.purpleColor,
}
]
},
{
[CKButtonComponent
newWithAction:nil
options:{
.titles = @"Brown",
.titleColors = UIColor.brownColor,
}
]
},
{
[CKButtonComponent
newWithAction:nil
options:{
.titles = @"Cyan",
.titleColors = UIColor.cyanColor,
}
]
},
}]
background:
[CKImageComponent
newWithImage:[UIImage imageNamed:@"sonarpattern"]
attributes:{}
size:{}]];
}
@end

View File

@@ -0,0 +1,480 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
53D59DB320ABA18400207065 /* NetworkViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53D59DAA20ABA18300207065 /* NetworkViewController.m */; };
53D59DB420ABA18400207065 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 53D59DAB20ABA18300207065 /* AppDelegate.mm */; };
53D59DB520ABA18400207065 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53D59DAD20ABA18300207065 /* MainViewController.m */; };
53D59DB620ABA18400207065 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 53D59DAF20ABA18300207065 /* RootViewController.mm */; };
53D59DB720ABA18400207065 /* MainStoryBoard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 53D59DB020ABA18400207065 /* MainStoryBoard.storyboard */; };
53D59DB820ABA18400207065 /* Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 53D59DB120ABA18400207065 /* Icons.xcassets */; };
53E0DE5420ABA0E4005682E1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 53E0DE5320ABA0E4005682E1 /* main.m */; };
B369CEA3B6F57057FAACAE2F /* libPods-Sample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 27922CF99D8E609480377096 /* libPods-Sample.a */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
275FDB8D19C1C8C26A47DA09 /* Pods-Sample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.release.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.release.xcconfig"; sourceTree = "<group>"; };
27922CF99D8E609480377096 /* libPods-Sample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Sample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
53D59DAA20ABA18300207065 /* NetworkViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NetworkViewController.m; sourceTree = SOURCE_ROOT; };
53D59DAB20ABA18300207065 /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = SOURCE_ROOT; };
53D59DAC20ABA18300207065 /* NetworkViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkViewController.h; sourceTree = SOURCE_ROOT; };
53D59DAD20ABA18300207065 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = SOURCE_ROOT; };
53D59DAE20ABA18300207065 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = SOURCE_ROOT; };
53D59DAF20ABA18300207065 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = SOURCE_ROOT; };
53D59DB020ABA18400207065 /* MainStoryBoard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryBoard.storyboard; sourceTree = SOURCE_ROOT; };
53D59DB120ABA18400207065 /* Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icons.xcassets; sourceTree = SOURCE_ROOT; };
53D59DB220ABA18400207065 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = SOURCE_ROOT; };
53D59DBA20ABA20300207065 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
53E0DE4120ABA0E3005682E1 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; };
53E0DE5220ABA0E4005682E1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };
53E0DE5320ABA0E4005682E1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
7086E77977EF48ABCAE4DED7 /* Pods-Sample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Sample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Sample/Pods-Sample.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
53E0DE3E20ABA0E3005682E1 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B369CEA3B6F57057FAACAE2F /* libPods-Sample.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
53D59DB920ABA19900207065 /* Sample */ = {
isa = PBXGroup;
children = (
53D59DBA20ABA20300207065 /* AppDelegate.h */,
53D59DAB20ABA18300207065 /* AppDelegate.mm */,
53D59DB120ABA18400207065 /* Icons.xcassets */,
53D59DB020ABA18400207065 /* MainStoryBoard.storyboard */,
53D59DB220ABA18400207065 /* MainViewController.h */,
53D59DAD20ABA18300207065 /* MainViewController.m */,
53D59DAC20ABA18300207065 /* NetworkViewController.h */,
53D59DAA20ABA18300207065 /* NetworkViewController.m */,
53D59DAE20ABA18300207065 /* RootViewController.h */,
53D59DAF20ABA18300207065 /* RootViewController.mm */,
53E0DE5220ABA0E4005682E1 /* Info.plist */,
53E0DE5320ABA0E4005682E1 /* main.m */,
);
name = Sample;
sourceTree = "<group>";
};
53E0DE3820ABA0E3005682E1 = {
isa = PBXGroup;
children = (
53D59DB920ABA19900207065 /* Sample */,
53E0DE4220ABA0E3005682E1 /* Products */,
71F5EB9E42BEADDCC04A205D /* Pods */,
E2FCEB633911AF4886EC0881 /* Frameworks */,
);
sourceTree = "<group>";
};
53E0DE4220ABA0E3005682E1 /* Products */ = {
isa = PBXGroup;
children = (
53E0DE4120ABA0E3005682E1 /* Sample.app */,
);
name = Products;
sourceTree = "<group>";
};
71F5EB9E42BEADDCC04A205D /* Pods */ = {
isa = PBXGroup;
children = (
7086E77977EF48ABCAE4DED7 /* Pods-Sample.debug.xcconfig */,
275FDB8D19C1C8C26A47DA09 /* Pods-Sample.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
E2FCEB633911AF4886EC0881 /* Frameworks */ = {
isa = PBXGroup;
children = (
27922CF99D8E609480377096 /* libPods-Sample.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
53E0DE4020ABA0E3005682E1 /* Sample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 53E0DE5720ABA0E4005682E1 /* Build configuration list for PBXNativeTarget "Sample" */;
buildPhases = (
88DDF414B12B2B557290B67B /* [CP] Check Pods Manifest.lock */,
53E0DE3D20ABA0E3005682E1 /* Sources */,
53E0DE3E20ABA0E3005682E1 /* Frameworks */,
53E0DE3F20ABA0E3005682E1 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Sample;
productName = Sample;
productReference = 53E0DE4120ABA0E3005682E1 /* Sample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
53E0DE3920ABA0E3005682E1 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = Facebook;
TargetAttributes = {
53E0DE4020ABA0E3005682E1 = {
CreatedOnToolsVersion = 9.4;
};
};
};
buildConfigurationList = 53E0DE3C20ABA0E3005682E1 /* Build configuration list for PBXProject "Sample" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 53E0DE3820ABA0E3005682E1;
productRefGroup = 53E0DE4220ABA0E3005682E1 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
53E0DE4020ABA0E3005682E1 /* Sample */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
53E0DE3F20ABA0E3005682E1 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
53D59DB820ABA18400207065 /* Icons.xcassets in Resources */,
53D59DB720ABA18400207065 /* MainStoryBoard.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
88DDF414B12B2B557290B67B /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Sample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
53E0DE3D20ABA0E3005682E1 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
53E0DE5420ABA0E4005682E1 /* main.m in Sources */,
53D59DB320ABA18400207065 /* NetworkViewController.m in Sources */,
53D59DB420ABA18400207065 /* AppDelegate.mm in Sources */,
53D59DB520ABA18400207065 /* MainViewController.m in Sources */,
53D59DB620ABA18400207065 /* RootViewController.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
53E0DE5520ABA0E4005682E1 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
53E0DE5620ABA0E4005682E1 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
53E0DE5820ABA0E4005682E1 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7086E77977EF48ABCAE4DED7 /* Pods-Sample.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
"FB_SONARKIT_ENABLED=1",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/CocoaAsyncSocket\"",
"\"${PODS_ROOT}/Headers/Public/ComponentKit\"",
"\"${PODS_ROOT}/Headers/Public/DoubleConversion\"",
"\"${PODS_ROOT}/Headers/Public/EasyWSClient\"",
"\"${PODS_ROOT}/Headers/Public/Folly\"",
"\"${PODS_ROOT}/Headers/Public/PeerTalk\"",
"\"${PODS_ROOT}/Headers/Public/Sonar\"/**",
"\"${PODS_ROOT}/Headers/Public/SonarKit\"",
"\"${PODS_ROOT}/Headers/Public/Yoga\"",
"\"${PODS_ROOT}/Headers/Public/boost-for-react-native\"",
"\"${PODS_ROOT}/Headers/Public/glog\"/**",
"\"${PODS_ROOT}/SonarKit\"/**",
);
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.3;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFB_SONARKIT_ENABLED=1",
"-Wno-implicit-retain-self",
"-Wno-global-constructors",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-l\"CocoaAsyncSocket\"",
"-l\"ComponentKit\"",
"-l\"DoubleConversion\"",
"-l\"EasyWSClient\"",
"-l\"Folly\"",
"-l\"PeerTalk\"",
"-l\"Sonar\"",
"-l\"SonarKit\"",
"-l\"Yoga\"",
"-l\"c++\"",
"-l\"glog\"",
"-l\"stdc++\"",
"-framework",
"\"CFNetwork\"",
"-framework",
"\"CoreText\"",
"-framework",
"\"Security\"",
"-framework",
"\"UIKit\"",
"-DFB_SONARKIT_ENABLED=1",
);
PRODUCT_BUNDLE_IDENTIFIER = FB.Sample;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
53E0DE5920ABA0E4005682E1 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 275FDB8D19C1C8C26A47DA09 /* Pods-Sample.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
GCC_NO_COMMON_BLOCKS = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"\"${PODS_ROOT}/Headers/Public\"",
"\"${PODS_ROOT}/Headers/Public/CocoaAsyncSocket\"",
"\"${PODS_ROOT}/Headers/Public/ComponentKit\"",
"\"${PODS_ROOT}/Headers/Public/DoubleConversion\"",
"\"${PODS_ROOT}/Headers/Public/EasyWSClient\"",
"\"${PODS_ROOT}/Headers/Public/Folly\"",
"\"${PODS_ROOT}/Headers/Public/PeerTalk\"",
"\"${PODS_ROOT}/Headers/Public/Sonar\"/**",
"\"${PODS_ROOT}/Headers/Public/SonarKit\"",
"\"${PODS_ROOT}/Headers/Public/Yoga\"",
"\"${PODS_ROOT}/Headers/Public/boost-for-react-native\"",
"\"${PODS_ROOT}/Headers/Public/glog\"/**",
"\"${PODS_ROOT}/SonarKit\"/**",
);
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.3;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFB_SONARKIT_ENABLED=1",
"-Wno-implicit-retain-self",
"-Wno-global-constructors",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-l\"CocoaAsyncSocket\"",
"-l\"ComponentKit\"",
"-l\"DoubleConversion\"",
"-l\"EasyWSClient\"",
"-l\"Folly\"",
"-l\"PeerTalk\"",
"-l\"Sonar\"",
"-l\"SonarKit\"",
"-l\"Yoga\"",
"-l\"c++\"",
"-l\"glog\"",
"-l\"stdc++\"",
"-framework",
"\"CFNetwork\"",
"-framework",
"\"CoreText\"",
"-framework",
"\"Security\"",
"-framework",
"\"UIKit\"",
"-DFB_SONARKIT_ENABLED=1",
);
PRODUCT_BUNDLE_IDENTIFIER = FB.Sample;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
53E0DE3C20ABA0E3005682E1 /* Build configuration list for PBXProject "Sample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
53E0DE5520ABA0E4005682E1 /* Debug */,
53E0DE5620ABA0E4005682E1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
53E0DE5720ABA0E4005682E1 /* Build configuration list for PBXNativeTarget "Sample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
53E0DE5820ABA0E4005682E1 /* Debug */,
53E0DE5920ABA0E4005682E1 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 53E0DE3920ABA0E3005682E1 /* Project object */;
}

16
iOS/Sample/main.m Normal file
View File

@@ -0,0 +1,16 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}