Skip to content

Commit b7d858a

Browse files
committed
Add L74
1 parent 9550448 commit b7d858a

File tree

19 files changed

+1558
-0
lines changed

19 files changed

+1558
-0
lines changed

Lesson 74/Lesson 74.xcodeproj/project.pbxproj

Lines changed: 482 additions & 0 deletions
Large diffs are not rendered by default.

Lesson 74/Lesson 74.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
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>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// AppDelegate.swift
3+
// Lesson 74
4+
//
5+
// Created by Lucas Derraugh on 1/19/20.
6+
// Copyright © 2020 Lucas Derraugh. All rights reserved.
7+
//
8+
9+
import Cocoa
10+
11+
@NSApplicationMain
12+
class AppDelegate: NSObject, NSApplicationDelegate {
13+
14+
@IBOutlet weak var window: NSWindow!
15+
@IBOutlet weak var outputLabel: NSTextField!
16+
@IBOutlet weak var inputField: NSTextField!
17+
18+
@IBAction func uppercase(_ sender: Any) {
19+
UppercaseUtility.uppercase(inputField.stringValue) { [weak self] uppercased in
20+
DispatchQueue.main.async {
21+
self?.outputLabel.stringValue = uppercased
22+
}
23+
}
24+
}
25+
}
26+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "mac",
5+
"size" : "16x16",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "mac",
10+
"size" : "16x16",
11+
"scale" : "2x"
12+
},
13+
{
14+
"idiom" : "mac",
15+
"size" : "32x32",
16+
"scale" : "1x"
17+
},
18+
{
19+
"idiom" : "mac",
20+
"size" : "32x32",
21+
"scale" : "2x"
22+
},
23+
{
24+
"idiom" : "mac",
25+
"size" : "128x128",
26+
"scale" : "1x"
27+
},
28+
{
29+
"idiom" : "mac",
30+
"size" : "128x128",
31+
"scale" : "2x"
32+
},
33+
{
34+
"idiom" : "mac",
35+
"size" : "256x256",
36+
"scale" : "1x"
37+
},
38+
{
39+
"idiom" : "mac",
40+
"size" : "256x256",
41+
"scale" : "2x"
42+
},
43+
{
44+
"idiom" : "mac",
45+
"size" : "512x512",
46+
"scale" : "1x"
47+
},
48+
{
49+
"idiom" : "mac",
50+
"size" : "512x512",
51+
"scale" : "2x"
52+
}
53+
],
54+
"info" : {
55+
"version" : 1,
56+
"author" : "xcode"
57+
}
58+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}

Lesson 74/Lesson 74/Base.lproj/MainMenu.xib

Lines changed: 746 additions & 0 deletions
Large diffs are not rendered by default.

Lesson 74/Lesson 74/Info.plist

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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>CFBundleIconFile</key>
10+
<string></string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>$(PRODUCT_NAME)</string>
17+
<key>CFBundlePackageType</key>
18+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>LSMinimumSystemVersion</key>
24+
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
25+
<key>NSHumanReadableCopyright</key>
26+
<string>Copyright © 2020 Lucas Derraugh. All rights reserved.</string>
27+
<key>NSMainNibFile</key>
28+
<string>MainMenu</string>
29+
<key>NSPrincipalClass</key>
30+
<string>NSApplication</string>
31+
<key>NSSupportsAutomaticTermination</key>
32+
<true/>
33+
<key>NSSupportsSuddenTermination</key>
34+
<true/>
35+
</dict>
36+
</plist>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.files.user-selected.read-only</key>
8+
<true/>
9+
</dict>
10+
</plist>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// UppercaseUtility.swift
3+
// Lesson 74
4+
//
5+
// Created by Lucas Derraugh on 1/23/20.
6+
// Copyright © 2020 Lucas Derraugh. All rights reserved.
7+
//
8+
9+
import Foundation
10+
import TextService
11+
12+
class UppercaseUtility {
13+
class func uppercase(_ string: String, reply: @escaping (String) -> Void) {
14+
let connection = NSXPCConnection(serviceName: "com.lucasderraugh.TextService")
15+
connection.remoteObjectInterface = NSXPCInterface(with: TextServiceProtocol.self)
16+
connection.resume()
17+
18+
let service = connection.remoteObjectProxyWithErrorHandler { error in
19+
print("Error: \(error)")
20+
} as? TextServiceProtocol
21+
22+
service?.uppercase(string, withReply: reply)
23+
}
24+
}

0 commit comments

Comments
 (0)