Skip to content

Commit bad1fe5

Browse files
committed
Update example
1 parent b454890 commit bad1fe5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+57335
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ You may also need to edit this section:
166166

167167
### Example Apps
168168

169-
Example Xcode project "iOS Test App" is located in the examples folder. This project builds an iPhone Objective C App using libcurl, openssl, and nghttp2 libraries. The app provides a simple single text field interface for URL input and produces a curl respone.
169+
Example Xcode project "iOS Test App" is located in the example folder. This project builds an iPhone Objective C App using libcurl, openssl, and nghttp2 libraries. The app provides a simple single text field interface for URL input and produces a curl respone.
170170

171171
### Tree
172172

@@ -177,7 +177,7 @@ Example Xcode project "iOS Test App" is located in the examples folder. This pr
177177
| |____lib
178178
| |____libcurl-build.sh
179179
|
180-
|____examples
180+
|____example
181181
| |____iOS Test App
182182
|
183183
|____nghttp2

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ echo
134134
echo -e "${subbold}libcurl (rename to libcurl.a)${normal} [${dim}$LIBCURL${normal}]${dim}"
135135
xcrun -sdk iphoneos lipo -info curl/lib/*.a
136136

137-
EXAMPLE="examples/iOS Test App"
137+
EXAMPLE="example/iOS Test App"
138138
ARCHIVE="archive/libcurl-$LIBCURL-openssl-$OPENSSL-nghttp2-$NGHTTP2"
139139

140140
echo

example/iOS Test App/LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
COPYRIGHT AND PERMISSION NOTICE
2+
3+
Copyright (c) 2016 Jason A. Cox, @jasonacox
4+
5+
All rights reserved.
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+

example/iOS Test App/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# iOS Test App
2+
This is a test app for iOS using the curl, openssl and nghttp2 libraries.
3+
4+
# Build Instructions
5+
6+
Load project using Xcode (tested with version 8.2). Example lib binaries
7+
and header files are included but should be replaced with new curl + openssl +
8+
nghttp2 builds.
9+
10+
# Screenshot
11+
12+
i![iOS Test App](https://raw.githubusercontent.com/jasonacox/Build-OpenSSL-cURL/master/examples/iOS%20Test%20App/screenshot.png)
13+

example/iOS Test App/cacert.pem

Lines changed: 3466 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//
2+
// AppDelegate.h
3+
//
4+
// iOS TEST APP - This is a test app for iOS using the curl, openssl and nghttp2 libraries
5+
// @jasonacox/Build-OpenSSL-cURL
6+
//
7+
// Created by Jason A. Cox on 11/19/16.
8+
//
9+
// COPYRIGHT AND PERMISSION NOTICE
10+
//
11+
// Copyright (c) 2014-2020 Jason A. Cox, jason@jasonacox.com, and contributors,
12+
// see the THANKS file.
13+
//
14+
// All rights reserved.
15+
//
16+
// Permission is hereby granted, free of charge, to any person obtaining a copy
17+
// of this software and associated documentation files (the "Software"), to deal
18+
// in the Software without restriction, including without limitation the rights
19+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20+
// copies of the Software, and to permit persons to whom the Software is
21+
// furnished to do so, subject to the following conditions:
22+
//
23+
// The above copyright notice and this permission notice shall be included in all
24+
// copies or substantial portions of the Software.
25+
//
26+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32+
// SOFTWARE.
33+
//
34+
35+
36+
37+
#import <UIKit/UIKit.h>
38+
#import <curl/curl.h>
39+
#import <openssl/ssl.h>
40+
41+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
42+
43+
@property (strong, nonatomic) UIWindow *window;
44+
45+
46+
@end
47+
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
//
2+
// AppDelegate.m
3+
// iOS Test App
4+
//
5+
// Created by Jason A. Cox on 11/19/16.
6+
//
7+
// COPYRIGHT AND PERMISSION NOTICE
8+
//
9+
// Copyright (c) 2014-2020 Jason A. Cox, jasonacox@me.com, and many contributors,
10+
// see the THANKS file.
11+
//
12+
// All rights reserved.
13+
//
14+
// Permission is hereby granted, free of charge, to any person obtaining a copy
15+
// of this software and associated documentation files (the "Software"), to deal
16+
// in the Software without restriction, including without limitation the rights
17+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
// copies of the Software, and to permit persons to whom the Software is
19+
// furnished to do so, subject to the following conditions:
20+
//
21+
// The above copyright notice and this permission notice shall be included in all
22+
// copies or substantial portions of the Software.
23+
//
24+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30+
// SOFTWARE.
31+
//
32+
33+
34+
#import "AppDelegate.h"
35+
#import "opensslv.h"
36+
37+
@interface AppDelegate ()
38+
39+
@end
40+
41+
@implementation AppDelegate
42+
43+
44+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
45+
// Override point for customization after application launch.
46+
47+
// OpenSSL - Dot no use with OpenSSL 1.1.1 series
48+
#if OPENSSL_VERSION_NUMBER < 0x1000100fL
49+
SSL_load_error_strings(); /* readable error messages */
50+
SSL_library_init(); /* initialize library */
51+
#endif
52+
// libcurl - see http://curl.haxx.se/libcurl/
53+
curl_global_init(0L);
54+
55+
return YES;
56+
}
57+
58+
59+
- (void)applicationWillResignActive:(UIApplication *)application {
60+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
61+
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
62+
}
63+
64+
65+
- (void)applicationDidEnterBackground:(UIApplication *)application {
66+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
67+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
68+
}
69+
70+
71+
- (void)applicationWillEnterForeground:(UIApplication *)application {
72+
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
73+
}
74+
75+
76+
- (void)applicationDidBecomeActive:(UIApplication *)application {
77+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
78+
}
79+
80+
81+
- (void)applicationWillTerminate:(UIApplication *)application {
82+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
83+
// libcurl cleanup
84+
curl_global_cleanup();
85+
}
86+
87+
88+
@end
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "20x20",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "20x20",
11+
"scale" : "3x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "29x29",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "29x29",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"size" : "40x40",
26+
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "40x40",
31+
"scale" : "3x"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"size" : "60x60",
36+
"scale" : "2x"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"size" : "60x60",
41+
"scale" : "3x"
42+
},
43+
{
44+
"idiom" : "ipad",
45+
"size" : "20x20",
46+
"scale" : "1x"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"size" : "20x20",
51+
"scale" : "2x"
52+
},
53+
{
54+
"idiom" : "ipad",
55+
"size" : "29x29",
56+
"scale" : "1x"
57+
},
58+
{
59+
"idiom" : "ipad",
60+
"size" : "29x29",
61+
"scale" : "2x"
62+
},
63+
{
64+
"idiom" : "ipad",
65+
"size" : "40x40",
66+
"scale" : "1x"
67+
},
68+
{
69+
"idiom" : "ipad",
70+
"size" : "40x40",
71+
"scale" : "2x"
72+
},
73+
{
74+
"idiom" : "ipad",
75+
"size" : "76x76",
76+
"scale" : "1x"
77+
},
78+
{
79+
"idiom" : "ipad",
80+
"size" : "76x76",
81+
"scale" : "2x"
82+
},
83+
{
84+
"idiom" : "ipad",
85+
"size" : "83.5x83.5",
86+
"scale" : "2x"
87+
},
88+
{
89+
"idiom" : "ios-marketing",
90+
"size" : "1024x1024",
91+
"scale" : "1x"
92+
}
93+
],
94+
"info" : {
95+
"version" : 1,
96+
"author" : "xcode"
97+
}
98+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
5+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
6+
</dependencies>
7+
<scenes>
8+
<!--View Controller-->
9+
<scene sceneID="EHf-IW-A2E">
10+
<objects>
11+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
14+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
17+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
23+
</objects>
24+
<point key="canvasLocation" x="53" y="375"/>
25+
</scene>
26+
</scenes>
27+
</document>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
4+
<dependencies>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
7+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8+
</dependencies>
9+
<scenes>
10+
<!--View Controller-->
11+
<scene sceneID="tne-QT-ifu">
12+
<objects>
13+
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
14+
<layoutGuides>
15+
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
16+
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
17+
</layoutGuides>
18+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
19+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
20+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
21+
<subviews>
22+
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Enter URL" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="5ym-vw-h9c">
23+
<rect key="frame" x="48" y="106" width="292" height="30"/>
24+
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
25+
<fontDescription key="fontDescription" type="system" pointSize="14"/>
26+
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" keyboardType="URL"/>
27+
</textField>
28+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="iOS cURL Test App" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wnb-QK-GJr">
29+
<rect key="frame" x="16" y="52" width="382" height="46"/>
30+
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
31+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
32+
<nil key="textColor"/>
33+
<nil key="highlightedColor"/>
34+
</label>
35+
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4wA-r7-IzH">
36+
<rect key="frame" x="348" y="106" width="30" height="30"/>
37+
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
38+
<state key="normal" title="GET">
39+
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
40+
</state>
41+
<connections>
42+
<action selector="Get:" destination="BYZ-38-t0r" eventType="touchUpInside" id="2Y9-vf-DgB"/>
43+
</connections>
44+
</button>
45+
<textView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="cde-8a-gKJ">
46+
<rect key="frame" x="48" y="148" width="318" height="714"/>
47+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
48+
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
49+
<fontDescription key="fontDescription" type="system" pointSize="14"/>
50+
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no"/>
51+
</textView>
52+
</subviews>
53+
<color key="backgroundColor" systemColor="systemGrayColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
54+
</view>
55+
<connections>
56+
<outlet property="_appTitle" destination="Wnb-QK-GJr" id="XHy-jB-4Vb"/>
57+
<outlet property="_resultText" destination="cde-8a-gKJ" id="fXf-7x-IKn"/>
58+
<outlet property="_urlText" destination="5ym-vw-h9c" id="pBh-rP-qYS"/>
59+
</connections>
60+
</viewController>
61+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
62+
</objects>
63+
<point key="canvasLocation" x="117.39130434782609" y="135.9375"/>
64+
</scene>
65+
</scenes>
66+
</document>

0 commit comments

Comments
 (0)