Skip to content

Commit 0cb4430

Browse files
committed
Update the Example App
1 parent 3054972 commit 0cb4430

File tree

5 files changed

+48
-37
lines changed

5 files changed

+48
-37
lines changed

Example/Atlantis-Example-App/Atlantis-Example-App.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
323323
CODE_SIGN_STYLE = Automatic;
324324
CURRENT_PROJECT_VERSION = 1;
325-
DEVELOPMENT_TEAM = 3X57WP8E8V;
325+
DEVELOPMENT_TEAM = 57SKMSUCY8;
326326
GENERATE_INFOPLIST_FILE = YES;
327327
INFOPLIST_FILE = "Atlantis-Example-App/Info.plist";
328328
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
@@ -350,7 +350,7 @@
350350
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
351351
CODE_SIGN_STYLE = Automatic;
352352
CURRENT_PROJECT_VERSION = 1;
353-
DEVELOPMENT_TEAM = 3X57WP8E8V;
353+
DEVELOPMENT_TEAM = 57SKMSUCY8;
354354
GENERATE_INFOPLIST_FILE = YES;
355355
INFOPLIST_FILE = "Atlantis-Example-App/Info.plist";
356356
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;

Example/Atlantis-Example-App/Atlantis-Example-App/AppDelegate.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ import Atlantis
1111
@main
1212
class AppDelegate: UIResponder, UIApplicationDelegate {
1313

14-
15-
1614
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1715

1816
// Auto connect to a current Macbook
19-
// Atlantis.start()
2017
Atlantis.start()
2118

2219
//
@@ -36,13 +33,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3633
// Use this method to select a configuration to create the new scene with.
3734
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
3835
}
39-
40-
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
41-
// Called when the user discards a scene session.
42-
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
43-
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
44-
}
45-
46-
4736
}
48-

Example/Atlantis-Example-App/Atlantis-Example-App/Base.lproj/Main.storyboard

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19162" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="F80-zt-Rqb">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="F80-zt-Rqb">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19144"/>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
67
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
78
<capability name="System colors in document resources" minToolsVersion="11.0"/>
89
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -17,72 +18,80 @@
1718
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1819
<subviews>
1920
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="18" translatesAutoresizingMaskIntoConstraints="NO" id="7D0-zJ-8eK">
20-
<rect key="frame" x="124" y="249" width="166.5" height="276"/>
21+
<rect key="frame" x="111.5" y="253" width="191.5" height="349.5"/>
2122
<subviews>
2223
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="v8I-SR-bhq">
23-
<rect key="frame" x="57.5" y="0.0" width="51.5" height="31"/>
24+
<rect key="frame" x="67.5" y="0.0" width="56.5" height="34.5"/>
2425
<state key="normal" title="Button"/>
2526
<buttonConfiguration key="configuration" style="filled" title="GET"/>
2627
<connections>
2728
<action selector="getBtnOnTap:" destination="BYZ-38-t0r" eventType="touchUpInside" id="mHW-Jx-iLE"/>
2829
</connections>
2930
</button>
3031
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="04t-U6-7Dw">
31-
<rect key="frame" x="32" y="49" width="102" height="31"/>
32+
<rect key="frame" x="37.5" y="52.5" width="116.5" height="34.5"/>
3233
<state key="normal" title="Button"/>
3334
<buttonConfiguration key="configuration" style="filled" title="POST JSON"/>
3435
<connections>
3536
<action selector="postJsonBtnOnTap:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Sd2-Vg-njJ"/>
3637
</connections>
3738
</button>
3839
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zEc-yg-v4o">
39-
<rect key="frame" x="6" y="98" width="154" height="31"/>
40+
<rect key="frame" x="7" y="105" width="177.5" height="34.5"/>
4041
<state key="normal" title="Button"/>
4142
<buttonConfiguration key="configuration" style="filled" title="POST URL-Encoded"/>
4243
<connections>
4344
<action selector="postUrlEncodedBtnOnTap:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Qyk-TE-X8S"/>
4445
</connections>
4546
</button>
4647
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9nl-iK-A4q">
47-
<rect key="frame" x="0.0" y="147" width="166.5" height="31"/>
48+
<rect key="frame" x="0.0" y="157.5" width="191.5" height="34.5"/>
4849
<state key="normal" title="Button"/>
4950
<buttonConfiguration key="configuration" style="filled" title="Upload multipart/form"/>
5051
<connections>
5152
<action selector="uploadMultipartFormBtnOnClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="N1J-A5-IET"/>
5253
</connections>
5354
</button>
5455
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Lts-kr-KlY">
55-
<rect key="frame" x="8" y="196" width="150" height="31"/>
56+
<rect key="frame" x="9.5" y="210" width="172.5" height="34.5"/>
5657
<state key="normal" title="Button"/>
5758
<buttonConfiguration key="configuration" style="filled" title="SessionUploadTask"/>
5859
<connections>
5960
<action selector="uploadTaskBtnOnTap:" destination="BYZ-38-t0r" eventType="touchUpInside" id="2mU-9G-gsK"/>
6061
</connections>
6162
</button>
6263
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LIh-A2-yJr">
63-
<rect key="frame" x="45.5" y="245" width="75.5" height="31"/>
64+
<rect key="frame" x="53" y="262.5" width="85" height="34.5"/>
6465
<state key="normal" title="Button"/>
6566
<buttonConfiguration key="configuration" style="filled" title="DELETE"/>
6667
<connections>
6768
<action selector="deleteBtnOnTap:" destination="BYZ-38-t0r" eventType="touchUpInside" id="RwH-33-xly"/>
6869
</connections>
6970
</button>
71+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ctO-W2-mv3">
72+
<rect key="frame" x="41" y="315" width="109.5" height="34.5"/>
73+
<state key="normal" title="Button"/>
74+
<buttonConfiguration key="configuration" style="filled" title="Upload File"/>
75+
<connections>
76+
<action selector="uploadBtnOnTap:" destination="BYZ-38-t0r" eventType="touchUpInside" id="gqf-zO-cST"/>
77+
</connections>
78+
</button>
7079
</subviews>
7180
</stackView>
7281
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2. Make HTTPS Requests by Alamofire" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="05x-wV-Tc3">
73-
<rect key="frame" x="61" y="188.5" width="292.5" height="20.5"/>
82+
<rect key="frame" x="61" y="192.5" width="292.5" height="20.5"/>
7483
<fontDescription key="fontDescription" type="system" pointSize="17"/>
7584
<nil key="textColor"/>
7685
<nil key="highlightedColor"/>
7786
</label>
7887
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1. Open Proxyman for macOS" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ctR-44-rkp">
79-
<rect key="frame" x="20" y="128" width="374" height="20.5"/>
88+
<rect key="frame" x="20" y="132" width="374" height="20.5"/>
8089
<fontDescription key="fontDescription" type="system" pointSize="17"/>
8190
<nil key="textColor"/>
8291
<nil key="highlightedColor"/>
8392
</label>
8493
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3. Inspect your HTPS Log on Proxyman app" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Rfz-Me-zWS">
85-
<rect key="frame" x="42" y="565" width="330" height="20.5"/>
94+
<rect key="frame" x="42" y="642.5" width="330" height="20.5"/>
8695
<fontDescription key="fontDescription" type="system" pointSize="17"/>
8796
<nil key="textColor"/>
8897
<nil key="highlightedColor"/>
@@ -121,7 +130,7 @@
121130
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="F80-zt-Rqb" sceneMemberID="viewController">
122131
<toolbarItems/>
123132
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Da3-ZR-g1S">
124-
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
133+
<rect key="frame" x="0.0" y="48" width="414" height="44"/>
125134
<autoresizingMask key="autoresizingMask"/>
126135
</navigationBar>
127136
<nil name="viewControllers"/>

Example/Atlantis-Example-App/Atlantis-Example-App/SceneDelegate.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
1111

1212
var window: UIWindow?
1313

14-
1514
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
1615
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
1716
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
@@ -46,7 +45,4 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
4645
// Use this method to save data, release shared resources, and store enough scene-specific state information
4746
// to restore the scene back to its current state.
4847
}
49-
50-
5148
}
52-

Example/Atlantis-Example-App/Atlantis-Example-App/ViewController.swift

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class ViewController: UIViewController {
1818
// MARK: - IBActions
1919

2020
@IBAction func getBtnOnTap(_ sender: Any) {
21-
let url = URL(string: "https://httpbin.org/get")!
21+
let url = URL(string: "https://httpbin.proxyman.app/get")!
2222
let query: [String: String] = ["name": "Proxyman",
2323
"id": "123"]
2424
let header: [String: String] = ["X-Proxyman-Data": "123",
@@ -29,7 +29,7 @@ final class ViewController: UIViewController {
2929
}
3030

3131
@IBAction func postJsonBtnOnTap(_ sender: Any) {
32-
let url = URL(string: "https://httpbin.org/post")!
32+
let url = URL(string: "https://httpbin.proxyman.app/post")!
3333
let body: [String: String] = ["name": "Proxyman",
3434
"id": "123"]
3535
let header: [String: String] = ["X-Proxyman-Data": "123",
@@ -40,7 +40,7 @@ final class ViewController: UIViewController {
4040
}
4141

4242
@IBAction func postUrlEncodedBtnOnTap(_ sender: Any) {
43-
let url = URL(string: "https://httpbin.org/post")!
43+
let url = URL(string: "https://httpbin.proxyman.app/post")!
4444
let body: [String: String] = ["name": "Proxyman",
4545
"id": "123"]
4646
let header: [String: String] = ["X-Proxyman-Data": "123",
@@ -52,7 +52,7 @@ final class ViewController: UIViewController {
5252

5353
@IBAction func uploadMultipartFormBtnOnClick(_ sender: Any) {
5454
let imageURL = Bundle.main.url(forResource: "image", withExtension: "jpg")!
55-
let url = URL(string: "https://httpbin.org/post")!
55+
let url = URL(string: "https://httpbin.proxyman.app/post")!
5656
let data = MultipartFormData()
5757
data.append("Hello Word".data(using: .utf8)!, withName: "text")
5858
data.append(imageURL, withName: "image", fileName: "bigsur", mimeType: "jpg")
@@ -62,7 +62,7 @@ final class ViewController: UIViewController {
6262
}
6363

6464
@IBAction func deleteBtnOnTap(_ sender: Any) {
65-
let url = URL(string: "https://httpbin.org/delete")!
65+
let url = URL(string: "https://httpbin.proxyman.app/delete")!
6666
let body: [String: String] = ["name": "Proxyman",
6767
"id": "123"]
6868
let header: [String: String] = ["X-Proxyman-Data": "123",
@@ -75,11 +75,14 @@ final class ViewController: UIViewController {
7575
@IBAction func uploadTaskBtnOnTap(_ sender: Any) {
7676
let imageURL = Bundle.main.url(forResource: "image", withExtension: "jpg")!
7777
let imageData = try! Data(contentsOf: imageURL)
78-
let url = URL(string: "https://httpbin.org/post")!
78+
let url = URL(string: "https://httpbin.proxyman.app/post")!
7979
var request = URLRequest(url: url)
8080
request.method = .post
8181

8282
let task = URLSession.shared.uploadTask(with: request, from: imageData) { _, response, _ in
83+
guard let response = response else {
84+
return
85+
}
8386
print(response)
8487
}
8588
task.resume()
@@ -90,4 +93,19 @@ final class ViewController: UIViewController {
9093
controller.sourceType = UIImagePickerController.SourceType.camera
9194
show(controller, sender: self)
9295
}
96+
97+
@IBAction func uploadBtnOnTap(_ sender: Any) {
98+
var request = URLRequest(url: URL(string: "https://httpbin.proxyman.app/put")!)
99+
request.method = .put
100+
let data = "123 Hello World".data(using: .utf8)!
101+
102+
let task = URLSession.shared.uploadTask(with: request, from: data) { data, _, error in
103+
if let error = error {
104+
print(error)
105+
return
106+
}
107+
print("Upload success!")
108+
}
109+
task.resume()
110+
}
93111
}

0 commit comments

Comments
 (0)