Skip to content

Commit

Permalink
docs: add ios sample
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavisau committed Oct 28, 2022
1 parent 27585e9 commit d2fec0e
Show file tree
Hide file tree
Showing 31 changed files with 588 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/samples/ios/readme.md
@@ -0,0 +1,3 @@
run run-host.sh to start a host that will watch for the ios sample

[quick video](https://rdavisau.blob.core.windows.net/zzz/tbc-ios.mp4?sv=2020-08-04&st=2022-10-28T23%3A15%3A37Z&se=2050-10-29T23%3A15%3A00Z&sr=b&sp=r&sig=Bofw4bFpbFvBblkCc1TtXB00GPLwUxW8fIoUAlkwhgo%3D)
31 changes: 31 additions & 0 deletions src/samples/ios/reload-config.json
@@ -0,0 +1,31 @@
{
"ConsoleHost": {
"ExpectedClients": [
{
"Address": "localhost",
"Port": 50125
}
]
},
"FileWatcher": {
"RootPath": "tbc.sample.ios",
"Ignore": [
"/obj/",
"/bin/"
]
},
"AssemblyCompiler": {
"Debug": true,
"PreprocessorSymbols": [
"DEBUG",
"__RELOAD__"
],
"GlobalUsingsSources": [
{
"Kind": "SearchPath",
"Reference": "tbc.sample.ios/tbc.sample.ios/obj/Debug/net6.0-ios",
"Context": "LastModified"
}
]
}
}
1 change: 1 addition & 0 deletions src/samples/ios/run-host.sh
@@ -0,0 +1 @@
dotnet run -f net6.0 -c release --project ../../heads/tbc.host.console/tbc.host.console.csproj -- ./reload-config.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions src/samples/ios/tbc.sample.ios/tbc.sample.ios.sln
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tbc.sample.ios", "tbc.sample.ios\tbc.sample.ios.csproj", "{BB37ADFF-95A7-4650-B7C0-9E067D3E6E29}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tbc", "tbc", "{5517CA9E-603F-466A-A6CC-6BB8BA4BA70B}"
ProjectSection(SolutionItems) = preProject
..\readme.md = ..\readme.md
..\reload-config.json = ..\reload-config.json
..\run-host.sh = ..\run-host.sh
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BB37ADFF-95A7-4650-B7C0-9E067D3E6E29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB37ADFF-95A7-4650-B7C0-9E067D3E6E29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB37ADFF-95A7-4650-B7C0-9E067D3E6E29}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{BB37ADFF-95A7-4650-B7C0-9E067D3E6E29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB37ADFF-95A7-4650-B7C0-9E067D3E6E29}.Release|Any CPU.Build.0 = Release|Any CPU
{BB37ADFF-95A7-4650-B7C0-9E067D3E6E29}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
EndGlobal
29 changes: 29 additions & 0 deletions src/samples/ios/tbc.sample.ios/tbc.sample.ios/AppDelegate.cs
@@ -0,0 +1,29 @@
using tbc.sample.ios.Reload;
using Tbc.Target;
using Tbc.Target.Config;

namespace tbc.sample.ios;

[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
public override UIWindow Window { get; set; } = default!;

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
Window = new UIWindow(UIScreen.MainScreen.Bounds) { RootViewController = new MyViewController() };
Window.MakeKeyAndVisible();

Task.Run(SetupReload);

return true;
}

private async Task SetupReload()
{
var reloadManager = new iOSReloadManager(Window);
var targetServer = new TargetServer(new TargetConfiguration { ListenPort = 50125 });

await targetServer.Run(reloadManager);
}
}
@@ -0,0 +1,117 @@
{
"images": [
{
"scale": "2x",
"size": "20x20",
"idiom": "iphone",
"filename": "Icon40.png"
},
{
"scale": "3x",
"size": "20x20",
"idiom": "iphone",
"filename": "Icon60.png"
},
{
"scale": "2x",
"size": "29x29",
"idiom": "iphone",
"filename": "Icon58.png"
},
{
"scale": "3x",
"size": "29x29",
"idiom": "iphone",
"filename": "Icon87.png"
},
{
"scale": "2x",
"size": "40x40",
"idiom": "iphone",
"filename": "Icon80.png"
},
{
"scale": "3x",
"size": "40x40",
"idiom": "iphone",
"filename": "Icon120.png"
},
{
"scale": "2x",
"size": "60x60",
"idiom": "iphone",
"filename": "Icon120.png"
},
{
"scale": "3x",
"size": "60x60",
"idiom": "iphone",
"filename": "Icon180.png"
},
{
"scale": "1x",
"size": "20x20",
"idiom": "ipad",
"filename": "Icon20.png"
},
{
"scale": "2x",
"size": "20x20",
"idiom": "ipad",
"filename": "Icon40.png"
},
{
"scale": "1x",
"size": "29x29",
"idiom": "ipad",
"filename": "Icon29.png"
},
{
"scale": "2x",
"size": "29x29",
"idiom": "ipad",
"filename": "Icon58.png"
},
{
"scale": "1x",
"size": "40x40",
"idiom": "ipad",
"filename": "Icon40.png"
},
{
"scale": "2x",
"size": "40x40",
"idiom": "ipad",
"filename": "Icon80.png"
},
{
"scale": "1x",
"size": "76x76",
"idiom": "ipad",
"filename": "Icon76.png"
},
{
"scale": "2x",
"size": "76x76",
"idiom": "ipad",
"filename": "Icon152.png"
},
{
"scale": "2x",
"size": "83.5x83.5",
"idiom": "ipad",
"filename": "Icon167.png"
},
{
"scale": "1x",
"size": "1024x1024",
"idiom": "ios-marketing",
"filename": "Icon1024.png"
}
],
"properties": {},
"info": {
"version": 1,
"author": "xcode"
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,6 @@
<?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>
</dict>
</plist>
42 changes: 42 additions & 0 deletions src/samples/ios/tbc.sample.ios/tbc.sample.ios/Info.plist
@@ -0,0 +1,42 @@
<?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>CFBundleDisplayName</key>
<string>tbc.sample.ios</string>
<key>CFBundleIdentifier</key>
<string>com.companyname.tbc.sample.ios</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<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>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
</dict>
</plist>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="222" launchScreen="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<scene sceneID="221">
<objects>
<viewController id="222" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="219"/>
<viewControllerLayoutGuide type="bottom" id="220"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="223">
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="224" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-200" y="-388"/>
</scene>
</scenes>
</document>

0 comments on commit d2fec0e

Please sign in to comment.