Skip to content

Commit 7a79f7b

Browse files
committed
adding sample project from SwiftUI tutorial walkthrough
1 parent 34f3efb commit 7a79f7b

File tree

13 files changed

+863
-0
lines changed

13 files changed

+863
-0
lines changed

SwiftUI-Notes/SwiftUI-Notes.xcodeproj/project.pbxproj

+472
Large diffs are not rendered by default.

SwiftUI-Notes/SwiftUI-Notes.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// AppDelegate.swift
3+
// SwiftUI-Notes
4+
//
5+
// Created by Joseph Heck on 6/12/19.
6+
// Copyright © 2019 SwiftUI-Notes. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
@UIApplicationMain
12+
class AppDelegate: UIResponder, UIApplicationDelegate {
13+
14+
15+
16+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
17+
// Override point for customization after application launch.
18+
return true
19+
}
20+
21+
func applicationWillTerminate(_ application: UIApplication) {
22+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
23+
}
24+
25+
// MARK: UISceneSession Lifecycle
26+
27+
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
28+
// Called when a new scene session is being created.
29+
// Use this method to select a configuration to create the new scene with.
30+
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
31+
}
32+
33+
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
34+
// Called when the user discards a scene session.
35+
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
36+
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
37+
}
38+
39+
40+
}
41+
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
5+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7+
</dependencies>
8+
<scenes>
9+
<!--View Controller-->
10+
<scene sceneID="EHf-IW-A2E">
11+
<objects>
12+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
13+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
14+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
15+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
16+
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
17+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
18+
</view>
19+
</viewController>
20+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
21+
</objects>
22+
<point key="canvasLocation" x="53" y="375"/>
23+
</scene>
24+
</scenes>
25+
</document>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// ContentView.swift
3+
// SwiftUI-Notes
4+
//
5+
// Created by Joseph Heck on 6/12/19.
6+
// Copyright © 2019 SwiftUI-Notes. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
struct ContentView : View {
12+
var body: some View {
13+
Text("Hello World")
14+
}
15+
}
16+
17+
#if DEBUG
18+
struct ContentView_Previews : PreviewProvider {
19+
static var previews: some View {
20+
ContentView()
21+
}
22+
}
23+
#endif
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
<key>LSRequiresIPhoneOS</key>
22+
<true/>
23+
<key>UIApplicationSceneManifest</key>
24+
<dict>
25+
<key>UIApplicationSupportsMultipleScenes</key>
26+
<false/>
27+
<key>UISceneConfigurations</key>
28+
<dict>
29+
<key>UIWindowSceneSessionRoleApplication</key>
30+
<array>
31+
<dict>
32+
<key>UILaunchStoryboardName</key>
33+
<string>LaunchScreen</string>
34+
<key>UISceneConfigurationName</key>
35+
<string>Default Configuration</string>
36+
<key>UISceneDelegateClassName</key>
37+
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
38+
</dict>
39+
</array>
40+
</dict>
41+
</dict>
42+
<key>UILaunchStoryboardName</key>
43+
<string>LaunchScreen</string>
44+
<key>UIRequiredDeviceCapabilities</key>
45+
<array>
46+
<string>armv7</string>
47+
</array>
48+
<key>UISupportedInterfaceOrientations</key>
49+
<array>
50+
<string>UIInterfaceOrientationPortrait</string>
51+
<string>UIInterfaceOrientationLandscapeLeft</string>
52+
<string>UIInterfaceOrientationLandscapeRight</string>
53+
</array>
54+
<key>UISupportedInterfaceOrientations~ipad</key>
55+
<array>
56+
<string>UIInterfaceOrientationPortrait</string>
57+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
58+
<string>UIInterfaceOrientationLandscapeLeft</string>
59+
<string>UIInterfaceOrientationLandscapeRight</string>
60+
</array>
61+
</dict>
62+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//
2+
// SceneDelegate.swift
3+
// SwiftUI-Notes
4+
//
5+
// Created by Joseph Heck on 6/12/19.
6+
// Copyright © 2019 SwiftUI-Notes. All rights reserved.
7+
//
8+
9+
import UIKit
10+
import SwiftUI
11+
12+
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
13+
14+
var window: UIWindow?
15+
16+
17+
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
18+
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
19+
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
20+
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
21+
22+
// Use a UIHostingController as window root view controller
23+
let window = UIWindow(frame: UIScreen.main.bounds)
24+
window.rootViewController = UIHostingController(rootView: ContentView())
25+
self.window = window
26+
window.makeKeyAndVisible()
27+
}
28+
29+
func sceneDidDisconnect(_ scene: UIScene) {
30+
// Called as the scene is being released by the system.
31+
// This occurs shortly after the scene enters the background, or when its session is discarded.
32+
// Release any resources associated with this scene that can be re-created the next time the scene connects.
33+
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
34+
}
35+
36+
func sceneDidBecomeActive(_ scene: UIScene) {
37+
// Called when the scene has moved from an inactive state to an active state.
38+
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
39+
}
40+
41+
func sceneWillResignActive(_ scene: UIScene) {
42+
// Called when the scene will move from an active state to an inactive state.
43+
// This may occur due to temporary interruptions (ex. an incoming phone call).
44+
}
45+
46+
func sceneWillEnterForeground(_ scene: UIScene) {
47+
// Called as the scene transitions from the background to the foreground.
48+
// Use this method to undo the changes made on entering the background.
49+
}
50+
51+
func sceneDidEnterBackground(_ scene: UIScene) {
52+
// Called as the scene transitions from the foreground to the background.
53+
// Use this method to save data, release shared resources, and store enough scene-specific state information
54+
// to restore the scene back to its current state.
55+
}
56+
57+
58+
}
59+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
</dict>
22+
</plist>

0 commit comments

Comments
 (0)