UnicornChat: Version 1.0, 2016-10-27

First release

Sample code from the "Extending Your Apps with SiriKit” WWDC 2016 session.
This commit is contained in:
Liu Lantao 2016-12-24 12:37:42 +08:00
parent 7070c9bdea
commit 99e75cdf41
45 changed files with 1823 additions and 0 deletions

42
UnicornChat/LICENSE.txt Normal file
View File

@ -0,0 +1,42 @@
Sample code project: UnicornChat: Extending Your Apps with SiriKit
Version: 1.0
IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2016 Apple Inc. All Rights Reserved.

17
UnicornChat/README.md Normal file
View File

@ -0,0 +1,17 @@
# UnicornChat: Extending Your Apps with SiriKit
UnicornChat is a messaging application for unicorns to chat with each other.
As a sample app, this illustrates how to adopt SiriKit by adding an Intents extension and an Intents UI extension.
## Requirements
### Build
Xcode 8.0 or later; iOS 10.0 SDK or later
### Runtime
iOS 10.0 or later
Copyright (C) 2016 Apple Inc. All rights reserved.

View File

@ -0,0 +1,44 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>SiriExtension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>IntentsRestrictedWhileLocked</key>
<array>
<string>INSendMessageIntent</string>
</array>
<key>IntentsSupported</key>
<array>
<string>INSendMessageIntent</string>
</array>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.intents-service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).UCIntentsHandler</string>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,20 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The main entry point to the Intents extension.
*/
import Intents
class UCIntentsHandler: INExtension {
override func handler(for intent: INIntent) -> Any? {
if intent is INSendMessageIntent {
return UCSendMessageIntentHandler()
}
return nil
}
}

View File

@ -0,0 +1,88 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The handler class for INSendMessageIntent.
*/
import Foundation
import Intents
import UnicornCore
class UCSendMessageIntentHandler: NSObject, INSendMessageIntentHandling {
// MARK: 1. Resolve
func resolveRecipients(forSendMessage intent: INSendMessageIntent, with completion: @escaping ([INPersonResolutionResult]) -> Swift.Void) {
if let recipients = intent.recipients {
var resolutionResults = [INPersonResolutionResult]()
for recipient in recipients {
let matchingContacts = UCAddressBookManager().contacts(matchingName: recipient.displayName)
switch matchingContacts.count {
case 2 ... Int.max:
// We need Siri's help to ask user to pick one from the matches.
let disambiguationOptions: [INPerson] = matchingContacts.map { contact in
return contact.inPerson()
}
resolutionResults += [.disambiguation(with: disambiguationOptions)]
case 1:
let recipientMatched = matchingContacts[0].inPerson()
resolutionResults += [.success(with: recipientMatched)]
case 0:
resolutionResults += [.unsupported()]
default:
break
}
}
completion(resolutionResults)
} else {
// No recipients are provided. We need to prompt for a value.
completion([INPersonResolutionResult.needsValue()])
}
}
func resolveContent(forSendMessage intent: INSendMessageIntent, with completion: @escaping (INStringResolutionResult) -> Swift.Void) {
if let text = intent.content, !text.isEmpty {
completion(INStringResolutionResult.success(with: text))
}
else {
completion(INStringResolutionResult.needsValue())
}
}
// MARK: 2. Confirm
func confirm(sendMessage intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Swift.Void) {
if UCAccount.shared().hasValidAuthentication {
completion(INSendMessageIntentResponse(code: .success, userActivity: nil))
}
else {
// Creating our own user activity to include error information.
let userActivity = NSUserActivity(activityType: String(describing: INSendMessageIntent.self))
userActivity.userInfo = [NSString(string: "error"):NSString(string: "UserLoggedOut")]
completion(INSendMessageIntentResponse(code: .failureRequiringAppLaunch, userActivity: userActivity))
}
}
// MARK: 3. Handle
func handle(sendMessage intent: INSendMessageIntent, completion: @escaping (INSendMessageIntentResponse) -> Swift.Void) {
if intent.recipients != nil && intent.content != nil {
// Send the message.
let success = UCAccount.shared().sendMessage(intent.content, toRecipients: intent.recipients)
completion(INSendMessageIntentResponse(code: success ? .success : .failure, userActivity: nil))
}
else {
completion(INSendMessageIntentResponse(code: .failure, userActivity: nil))
}
}
}

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="ObA-dk-sSI">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Intent View Controller-->
<scene sceneID="7MM-of-jgj">
<objects>
<viewController id="ObA-dk-sSI" customClass="IntentViewController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="qkL-Od-lgU"/>
<viewControllerLayoutGuide type="bottom" id="n38-gi-rB5"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="zMn-AG-sqS">
<rect key="frame" x="0.0" y="0.0" width="320" height="150"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<size key="freeformSize" width="320" height="150"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="X47-rx-isc" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

View File

@ -0,0 +1,38 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>SiriUIExtension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>IntentsSupported</key>
<array>
<string>INSendMessageIntent</string>
</array>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.intents-ui-service</string>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,56 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The view controller providing a user interface for the intent.
*/
import IntentsUI
import UnicornCore
class IntentViewController: UIViewController, INUIHostedViewControlling, INUIHostedViewSiriProviding {
// MARK: INUIHostedViewControlling
func configure(with interaction: INInteraction!, context: INUIHostedViewContext, completion: ((CGSize) -> Void)!) {
var size: CGSize
// Check if the interaction describes a SendMessageIntent.
if interaction.representsSendMessageIntent {
// If it is, let's set up a view controller.
let chatViewController = UCChatViewController()
chatViewController.messageContent = interaction.messageContent
let contact = UCContact()
contact.name = interaction.recipientName
chatViewController.recipient = contact
switch interaction.intentHandlingStatus {
case .unspecified, .inProgress, .ready, .failure:
chatViewController.isSent = false
case .success, .deferredToApplication:
chatViewController.isSent = true
}
present(chatViewController, animated: false, completion: nil)
size = desiredSize
}
else {
// Otherwise, we'll tell the host to draw us at zero size.
size = CGSize.zero
}
completion(size)
}
var desiredSize: CGSize {
return extensionContext!.hostedViewMaximumAllowedSize
}
var displaysMessage: Bool {
return true
}
}

View File

@ -0,0 +1,808 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
522FAE651D08855B009BC1A0 /* chatmockdraft.png in Resources */ = {isa = PBXBuildFile; fileRef = 522FAE641D08855B009BC1A0 /* chatmockdraft.png */; };
522FAE661D08855B009BC1A0 /* chatmockdraft.png in Resources */ = {isa = PBXBuildFile; fileRef = 522FAE641D08855B009BC1A0 /* chatmockdraft.png */; };
522FAE681D0885A4009BC1A0 /* chatmock.png in Resources */ = {isa = PBXBuildFile; fileRef = 522FAE671D0885A4009BC1A0 /* chatmock.png */; };
522FAE691D0885A4009BC1A0 /* chatmock.png in Resources */ = {isa = PBXBuildFile; fileRef = 522FAE671D0885A4009BC1A0 /* chatmock.png */; };
5253B67C1CFDD60600F67727 /* UCChatViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5253B67A1CFDD60600F67727 /* UCChatViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
5253B67D1CFDD60600F67727 /* UCChatViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5253B67B1CFDD60600F67727 /* UCChatViewController.m */; };
5253B6831CFDD73800F67727 /* UCChatView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5253B6811CFDD73800F67727 /* UCChatView.h */; };
5253B6841CFDD73800F67727 /* UCChatView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5253B6821CFDD73800F67727 /* UCChatView.m */; };
5253B68A1CFDDD3D00F67727 /* IntentsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 520CB0D21CEA2617003E80C1 /* IntentsUI.framework */; };
5253B68D1CFDDD3D00F67727 /* IntentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5253B68C1CFDDD3D00F67727 /* IntentViewController.swift */; };
5253B6901CFDDD3D00F67727 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5253B68E1CFDDD3D00F67727 /* MainInterface.storyboard */; };
5253B6941CFDDD3D00F67727 /* SiriUIExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 5253B6891CFDDD3D00F67727 /* SiriUIExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
843FAC4B1CFE99CE0079D035 /* UnicornCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84AC3F1C1CF9170F00D3D08A /* UnicornCore.framework */; };
84AC3F1F1CF9170F00D3D08A /* UnicornCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AC3F1E1CF9170F00D3D08A /* UnicornCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
84AC3F241CF9170F00D3D08A /* UnicornCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 84AC3F1C1CF9170F00D3D08A /* UnicornCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
84AC3F2E1CF9187F00D3D08A /* UnicornCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84AC3F1C1CF9170F00D3D08A /* UnicornCore.framework */; };
84AC3F311CF9195400D3D08A /* UCContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AC3F2F1CF9195400D3D08A /* UCContact.h */; settings = {ATTRIBUTES = (Public, ); }; };
84AC3F321CF9195400D3D08A /* UCContact.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AC3F301CF9195400D3D08A /* UCContact.m */; };
84C6A78A1CE433A200E22048 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C6A7891CE433A200E22048 /* AppDelegate.swift */; };
84C6A78C1CE433A200E22048 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C6A78B1CE433A200E22048 /* ViewController.swift */; };
84C6A78F1CE433A200E22048 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84C6A78D1CE433A200E22048 /* Main.storyboard */; };
84C6A7911CE433A200E22048 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84C6A7901CE433A200E22048 /* Assets.xcassets */; };
84C6A7941CE433A200E22048 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84C6A7921CE433A200E22048 /* LaunchScreen.storyboard */; };
84C6A7A21CE4413400E22048 /* UCIntentsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C6A7A11CE4413400E22048 /* UCIntentsHandler.swift */; };
84C6A7A61CE4413400E22048 /* SiriExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 84C6A79F1CE4413400E22048 /* SiriExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
84C6A7AC1CE4573E00E22048 /* UCSendMessageIntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C6A7AB1CE4573E00E22048 /* UCSendMessageIntentHandler.swift */; };
84D39A4E1CFD0DBB00C8241D /* UCAddressBookManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D39A4C1CFD0DBB00C8241D /* UCAddressBookManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
84D39A4F1CFD0DBB00C8241D /* UCAddressBookManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D39A4D1CFD0DBB00C8241D /* UCAddressBookManager.m */; };
84D39A521CFD5D9000C8241D /* UCAccount.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D39A501CFD5D9000C8241D /* UCAccount.h */; settings = {ATTRIBUTES = (Public, ); }; };
84D39A531CFD5D9000C8241D /* UCAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D39A511CFD5D9000C8241D /* UCAccount.m */; };
92508E351D02381800944860 /* INInteraction+UnicornCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 92508E331D02381800944860 /* INInteraction+UnicornCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
92508E361D02381800944860 /* INInteraction+UnicornCore.m in Sources */ = {isa = PBXBuildFile; fileRef = 92508E341D02381800944860 /* INInteraction+UnicornCore.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
5253B6921CFDDD3D00F67727 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 84C6A77E1CE433A200E22048 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 5253B6881CFDDD3D00F67727;
remoteInfo = SiriUIExtension;
};
84AC3F211CF9170F00D3D08A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 84C6A77E1CE433A200E22048 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 84AC3F1B1CF9170F00D3D08A;
remoteInfo = UnicornCore;
};
84AC3F2C1CF9183500D3D08A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 84C6A77E1CE433A200E22048 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 84AC3F1B1CF9170F00D3D08A;
remoteInfo = UnicornCore;
};
84C6A7A41CE4413400E22048 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 84C6A77E1CE433A200E22048 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 84C6A79E1CE4413400E22048;
remoteInfo = SiriExtension;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
84AC3F281CF9170F00D3D08A /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
84AC3F241CF9170F00D3D08A /* UnicornCore.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
84C6A7AA1CE4413400E22048 /* Embed App Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
84C6A7A61CE4413400E22048 /* SiriExtension.appex in Embed App Extensions */,
5253B6941CFDDD3D00F67727 /* SiriUIExtension.appex in Embed App Extensions */,
);
name = "Embed App Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
520CB0D21CEA2617003E80C1 /* IntentsUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IntentsUI.framework; path = System/Library/Frameworks/IntentsUI.framework; sourceTree = SDKROOT; };
522FAE641D08855B009BC1A0 /* chatmockdraft.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chatmockdraft.png; sourceTree = "<group>"; };
522FAE671D0885A4009BC1A0 /* chatmock.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chatmock.png; sourceTree = "<group>"; };
5253B67A1CFDD60600F67727 /* UCChatViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UCChatViewController.h; sourceTree = "<group>"; };
5253B67B1CFDD60600F67727 /* UCChatViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UCChatViewController.m; sourceTree = "<group>"; };
5253B6811CFDD73800F67727 /* UCChatView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UCChatView.h; sourceTree = "<group>"; };
5253B6821CFDD73800F67727 /* UCChatView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UCChatView.m; sourceTree = "<group>"; };
5253B6891CFDDD3D00F67727 /* SiriUIExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SiriUIExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
5253B68C1CFDDD3D00F67727 /* IntentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntentViewController.swift; sourceTree = "<group>"; };
5253B68F1CFDDD3D00F67727 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = "<group>"; };
5253B6911CFDDD3D00F67727 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
84AC3F1C1CF9170F00D3D08A /* UnicornCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = UnicornCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
84AC3F1E1CF9170F00D3D08A /* UnicornCore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UnicornCore.h; sourceTree = "<group>"; };
84AC3F201CF9170F00D3D08A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
84AC3F2F1CF9195400D3D08A /* UCContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UCContact.h; sourceTree = "<group>"; };
84AC3F301CF9195400D3D08A /* UCContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UCContact.m; sourceTree = "<group>"; };
84C6A7861CE433A200E22048 /* UnicornChat.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UnicornChat.app; sourceTree = BUILT_PRODUCTS_DIR; };
84C6A7891CE433A200E22048 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
84C6A78B1CE433A200E22048 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
84C6A78E1CE433A200E22048 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
84C6A7901CE433A200E22048 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
84C6A7931CE433A200E22048 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
84C6A7951CE433A200E22048 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
84C6A79F1CE4413400E22048 /* SiriExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SiriExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
84C6A7A11CE4413400E22048 /* UCIntentsHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UCIntentsHandler.swift; sourceTree = "<group>"; };
84C6A7A31CE4413400E22048 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
84C6A7AB1CE4573E00E22048 /* UCSendMessageIntentHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UCSendMessageIntentHandler.swift; sourceTree = "<group>"; };
84D39A4C1CFD0DBB00C8241D /* UCAddressBookManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UCAddressBookManager.h; sourceTree = "<group>"; };
84D39A4D1CFD0DBB00C8241D /* UCAddressBookManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UCAddressBookManager.m; sourceTree = "<group>"; };
84D39A501CFD5D9000C8241D /* UCAccount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UCAccount.h; sourceTree = "<group>"; };
84D39A511CFD5D9000C8241D /* UCAccount.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UCAccount.m; sourceTree = "<group>"; };
92508E331D02381800944860 /* INInteraction+UnicornCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "INInteraction+UnicornCore.h"; sourceTree = "<group>"; };
92508E341D02381800944860 /* INInteraction+UnicornCore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "INInteraction+UnicornCore.m"; sourceTree = "<group>"; };
B5E465061D9F11E900F114F1 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
5253B6861CFDDD3D00F67727 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
843FAC4B1CFE99CE0079D035 /* UnicornCore.framework in Frameworks */,
5253B68A1CFDDD3D00F67727 /* IntentsUI.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
84AC3F181CF9170F00D3D08A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
84C6A7831CE433A200E22048 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
84C6A79C1CE4413400E22048 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
84AC3F2E1CF9187F00D3D08A /* UnicornCore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
520CB0D11CEA2617003E80C1 /* Frameworks */ = {
isa = PBXGroup;
children = (
84AC3F1D1CF9170F00D3D08A /* UnicornCore */,
520CB0D21CEA2617003E80C1 /* IntentsUI.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
5253B6801CFDD72200F67727 /* Internal */ = {
isa = PBXGroup;
children = (
522FAE641D08855B009BC1A0 /* chatmockdraft.png */,
522FAE671D0885A4009BC1A0 /* chatmock.png */,
5253B6811CFDD73800F67727 /* UCChatView.h */,
5253B6821CFDD73800F67727 /* UCChatView.m */,
);
name = Internal;
sourceTree = "<group>";
};
5253B68B1CFDDD3D00F67727 /* SiriUIExtension */ = {
isa = PBXGroup;
children = (
5253B68C1CFDDD3D00F67727 /* IntentViewController.swift */,
5253B68E1CFDDD3D00F67727 /* MainInterface.storyboard */,
5253B6911CFDDD3D00F67727 /* Info.plist */,
);
path = SiriUIExtension;
sourceTree = "<group>";
};
84AC3F1D1CF9170F00D3D08A /* UnicornCore */ = {
isa = PBXGroup;
children = (
92508E331D02381800944860 /* INInteraction+UnicornCore.h */,
92508E341D02381800944860 /* INInteraction+UnicornCore.m */,
5253B67A1CFDD60600F67727 /* UCChatViewController.h */,
5253B67B1CFDD60600F67727 /* UCChatViewController.m */,
84D39A4C1CFD0DBB00C8241D /* UCAddressBookManager.h */,
84D39A4D1CFD0DBB00C8241D /* UCAddressBookManager.m */,
84AC3F1E1CF9170F00D3D08A /* UnicornCore.h */,
84AC3F2F1CF9195400D3D08A /* UCContact.h */,
84AC3F301CF9195400D3D08A /* UCContact.m */,
84D39A501CFD5D9000C8241D /* UCAccount.h */,
84D39A511CFD5D9000C8241D /* UCAccount.m */,
5253B6801CFDD72200F67727 /* Internal */,
84AC3F201CF9170F00D3D08A /* Info.plist */,
);
path = UnicornCore;
sourceTree = "<group>";
};
84C6A77D1CE433A200E22048 = {
isa = PBXGroup;
children = (
B5E465061D9F11E900F114F1 /* README.md */,
84C6A7881CE433A200E22048 /* UnicornChat */,
84C6A7A01CE4413400E22048 /* SiriExtension */,
5253B68B1CFDDD3D00F67727 /* SiriUIExtension */,
520CB0D11CEA2617003E80C1 /* Frameworks */,
84C6A7871CE433A200E22048 /* Products */,
);
sourceTree = "<group>";
};
84C6A7871CE433A200E22048 /* Products */ = {
isa = PBXGroup;
children = (
84C6A7861CE433A200E22048 /* UnicornChat.app */,
84C6A79F1CE4413400E22048 /* SiriExtension.appex */,
84AC3F1C1CF9170F00D3D08A /* UnicornCore.framework */,
5253B6891CFDDD3D00F67727 /* SiriUIExtension.appex */,
);
name = Products;
sourceTree = "<group>";
};
84C6A7881CE433A200E22048 /* UnicornChat */ = {
isa = PBXGroup;
children = (
84C6A7891CE433A200E22048 /* AppDelegate.swift */,
84C6A78B1CE433A200E22048 /* ViewController.swift */,
84C6A78D1CE433A200E22048 /* Main.storyboard */,
84C6A7901CE433A200E22048 /* Assets.xcassets */,
84C6A7921CE433A200E22048 /* LaunchScreen.storyboard */,
84C6A7951CE433A200E22048 /* Info.plist */,
);
path = UnicornChat;
sourceTree = "<group>";
};
84C6A7A01CE4413400E22048 /* SiriExtension */ = {
isa = PBXGroup;
children = (
84C6A7A11CE4413400E22048 /* UCIntentsHandler.swift */,
84C6A7A31CE4413400E22048 /* Info.plist */,
84C6A7AB1CE4573E00E22048 /* UCSendMessageIntentHandler.swift */,
);
path = SiriExtension;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
84AC3F191CF9170F00D3D08A /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
84D39A4E1CFD0DBB00C8241D /* UCAddressBookManager.h in Headers */,
84AC3F1F1CF9170F00D3D08A /* UnicornCore.h in Headers */,
92508E351D02381800944860 /* INInteraction+UnicornCore.h in Headers */,
84D39A521CFD5D9000C8241D /* UCAccount.h in Headers */,
5253B6831CFDD73800F67727 /* UCChatView.h in Headers */,
5253B67C1CFDD60600F67727 /* UCChatViewController.h in Headers */,
84AC3F311CF9195400D3D08A /* UCContact.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
5253B6881CFDDD3D00F67727 /* SiriUIExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = 5253B6971CFDDD3D00F67727 /* Build configuration list for PBXNativeTarget "SiriUIExtension" */;
buildPhases = (
5253B6851CFDDD3D00F67727 /* Sources */,
5253B6861CFDDD3D00F67727 /* Frameworks */,
5253B6871CFDDD3D00F67727 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SiriUIExtension;
productName = SiriUIExtension;
productReference = 5253B6891CFDDD3D00F67727 /* SiriUIExtension.appex */;
productType = "com.apple.product-type.app-extension";
};
84AC3F1B1CF9170F00D3D08A /* UnicornCore */ = {
isa = PBXNativeTarget;
buildConfigurationList = 84AC3F271CF9170F00D3D08A /* Build configuration list for PBXNativeTarget "UnicornCore" */;
buildPhases = (
84AC3F171CF9170F00D3D08A /* Sources */,
84AC3F181CF9170F00D3D08A /* Frameworks */,
84AC3F191CF9170F00D3D08A /* Headers */,
84AC3F1A1CF9170F00D3D08A /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = UnicornCore;
productName = UnicornCore;
productReference = 84AC3F1C1CF9170F00D3D08A /* UnicornCore.framework */;
productType = "com.apple.product-type.framework";
};
84C6A7851CE433A200E22048 /* UnicornChat */ = {
isa = PBXNativeTarget;
buildConfigurationList = 84C6A7981CE433A200E22048 /* Build configuration list for PBXNativeTarget "UnicornChat" */;
buildPhases = (
84C6A7821CE433A200E22048 /* Sources */,
84C6A7831CE433A200E22048 /* Frameworks */,
84C6A7841CE433A200E22048 /* Resources */,
84C6A7AA1CE4413400E22048 /* Embed App Extensions */,
84AC3F281CF9170F00D3D08A /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
84C6A7A51CE4413400E22048 /* PBXTargetDependency */,
84AC3F221CF9170F00D3D08A /* PBXTargetDependency */,
5253B6931CFDDD3D00F67727 /* PBXTargetDependency */,
);
name = UnicornChat;
productName = UnicornChat;
productReference = 84C6A7861CE433A200E22048 /* UnicornChat.app */;
productType = "com.apple.product-type.application";
};
84C6A79E1CE4413400E22048 /* SiriExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = 84C6A7A71CE4413400E22048 /* Build configuration list for PBXNativeTarget "SiriExtension" */;
buildPhases = (
84C6A79B1CE4413400E22048 /* Sources */,
84C6A79C1CE4413400E22048 /* Frameworks */,
84C6A79D1CE4413400E22048 /* Resources */,
);
buildRules = (
);
dependencies = (
84AC3F2D1CF9183500D3D08A /* PBXTargetDependency */,
);
name = SiriExtension;
productName = SiriExtension;
productReference = 84C6A79F1CE4413400E22048 /* SiriExtension.appex */;
productType = "com.apple.product-type.app-extension";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
84C6A77E1CE433A200E22048 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = "Apple Inc";
TargetAttributes = {
5253B6881CFDDD3D00F67727 = {
CreatedOnToolsVersion = 8.0;
ProvisioningStyle = Automatic;
};
84AC3F1B1CF9170F00D3D08A = {
CreatedOnToolsVersion = 8.0;
ProvisioningStyle = Automatic;
};
84C6A7851CE433A200E22048 = {
CreatedOnToolsVersion = 8.0;
ProvisioningStyle = Automatic;
};
84C6A79E1CE4413400E22048 = {
CreatedOnToolsVersion = 8.0;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 84C6A7811CE433A200E22048 /* Build configuration list for PBXProject "UnicornChat" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 84C6A77D1CE433A200E22048;
productRefGroup = 84C6A7871CE433A200E22048 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
84C6A7851CE433A200E22048 /* UnicornChat */,
84C6A79E1CE4413400E22048 /* SiriExtension */,
5253B6881CFDDD3D00F67727 /* SiriUIExtension */,
84AC3F1B1CF9170F00D3D08A /* UnicornCore */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
5253B6871CFDDD3D00F67727 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5253B6901CFDDD3D00F67727 /* MainInterface.storyboard in Resources */,
522FAE651D08855B009BC1A0 /* chatmockdraft.png in Resources */,
522FAE681D0885A4009BC1A0 /* chatmock.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
84AC3F1A1CF9170F00D3D08A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
522FAE691D0885A4009BC1A0 /* chatmock.png in Resources */,
522FAE661D08855B009BC1A0 /* chatmockdraft.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
84C6A7841CE433A200E22048 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
84C6A7941CE433A200E22048 /* LaunchScreen.storyboard in Resources */,
84C6A7911CE433A200E22048 /* Assets.xcassets in Resources */,
84C6A78F1CE433A200E22048 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
84C6A79D1CE4413400E22048 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
5253B6851CFDDD3D00F67727 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5253B68D1CFDDD3D00F67727 /* IntentViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
84AC3F171CF9170F00D3D08A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5253B67D1CFDD60600F67727 /* UCChatViewController.m in Sources */,
5253B6841CFDD73800F67727 /* UCChatView.m in Sources */,
84D39A4F1CFD0DBB00C8241D /* UCAddressBookManager.m in Sources */,
92508E361D02381800944860 /* INInteraction+UnicornCore.m in Sources */,
84AC3F321CF9195400D3D08A /* UCContact.m in Sources */,
84D39A531CFD5D9000C8241D /* UCAccount.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
84C6A7821CE433A200E22048 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
84C6A78C1CE433A200E22048 /* ViewController.swift in Sources */,
84C6A78A1CE433A200E22048 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
84C6A79B1CE4413400E22048 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
84C6A7A21CE4413400E22048 /* UCIntentsHandler.swift in Sources */,
84C6A7AC1CE4573E00E22048 /* UCSendMessageIntentHandler.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
5253B6931CFDDD3D00F67727 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 5253B6881CFDDD3D00F67727 /* SiriUIExtension */;
targetProxy = 5253B6921CFDDD3D00F67727 /* PBXContainerItemProxy */;
};
84AC3F221CF9170F00D3D08A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 84AC3F1B1CF9170F00D3D08A /* UnicornCore */;
targetProxy = 84AC3F211CF9170F00D3D08A /* PBXContainerItemProxy */;
};
84AC3F2D1CF9183500D3D08A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 84AC3F1B1CF9170F00D3D08A /* UnicornCore */;
targetProxy = 84AC3F2C1CF9183500D3D08A /* PBXContainerItemProxy */;
};
84C6A7A51CE4413400E22048 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 84C6A79E1CE4413400E22048 /* SiriExtension */;
targetProxy = 84C6A7A41CE4413400E22048 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
5253B68E1CFDDD3D00F67727 /* MainInterface.storyboard */ = {
isa = PBXVariantGroup;
children = (
5253B68F1CFDDD3D00F67727 /* Base */,
);
name = MainInterface.storyboard;
sourceTree = "<group>";
};
84C6A78D1CE433A200E22048 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
84C6A78E1CE433A200E22048 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
84C6A7921CE433A200E22048 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
84C6A7931CE433A200E22048 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
5253B6951CFDDD3D00F67727 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = SiriUIExtension/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.UnicornChat.SiriUIExtension";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
5253B6961CFDDD3D00F67727 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = SiriUIExtension/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.UnicornChat.SiriUIExtension";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
84AC3F251CF9170F00D3D08A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = UnicornCore/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.UnicornChat.UnicornCore";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
84AC3F261CF9170F00D3D08A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = UnicornCore/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.UnicornChat.UnicornCore";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
84C6A7961CE433A200E22048 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPRESSION = lossless;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
84C6A7971CE433A200E22048 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPRESSION = "respect-asset-catalog";
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
84C6A7991CE433A200E22048 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
INFOPLIST_FILE = UnicornChat/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.UnicornChat";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
84C6A79A1CE433A200E22048 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
INFOPLIST_FILE = UnicornChat/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.UnicornChat";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
84C6A7A81CE4413400E22048 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = SiriExtension/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.UnicornChat.SiriExtension";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
84C6A7A91CE4413400E22048 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = SiriExtension/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.example.apple-samplecode.UnicornChat.SiriExtension";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
5253B6971CFDDD3D00F67727 /* Build configuration list for PBXNativeTarget "SiriUIExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5253B6951CFDDD3D00F67727 /* Debug */,
5253B6961CFDDD3D00F67727 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
84AC3F271CF9170F00D3D08A /* Build configuration list for PBXNativeTarget "UnicornCore" */ = {
isa = XCConfigurationList;
buildConfigurations = (
84AC3F251CF9170F00D3D08A /* Debug */,
84AC3F261CF9170F00D3D08A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
84C6A7811CE433A200E22048 /* Build configuration list for PBXProject "UnicornChat" */ = {
isa = XCConfigurationList;
buildConfigurations = (
84C6A7961CE433A200E22048 /* Debug */,
84C6A7971CE433A200E22048 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
84C6A7981CE433A200E22048 /* Build configuration list for PBXNativeTarget "UnicornChat" */ = {
isa = XCConfigurationList;
buildConfigurations = (
84C6A7991CE433A200E22048 /* Debug */,
84C6A79A1CE433A200E22048 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
84C6A7A71CE4413400E22048 /* Build configuration list for PBXNativeTarget "SiriExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
84C6A7A81CE4413400E22048 /* Debug */,
84C6A7A91CE4413400E22048 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 84C6A77E1CE433A200E22048 /* Project object */;
}

View File

@ -0,0 +1,21 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The application delegate
*/
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
// implement to handle user activity created by Siri or by our SiriExtension
return true
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,86 @@
{
"images" : [
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Carl 58-1.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Carl 87.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Carl 80.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Carl 120-1.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Carl 120-2.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Carl 180.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Carl 29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Carl 58.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Carl 40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Carl 80-2.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Carl 76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Carl 152.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Carl 167.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>

View File

@ -0,0 +1,49 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleDisplayName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</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>
</dict>
</plist>

View File

@ -0,0 +1,12 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The application's view controller
*/
import UIKit
class ViewController: UIViewController {
}

View File

@ -0,0 +1,17 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
Convinience category on INInteraction to get information relevant to UnicornCore.
*/
#import <Intents/Intents.h>
@interface INInteraction (UnicornCore)
@property (nonatomic, assign, readonly) BOOL representsSendMessageIntent;
@property (nonatomic, copy, readonly) NSString *recipientName;
@property (nonatomic, copy, readonly) NSString *messageContent;
@end

View File

@ -0,0 +1,56 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
Convinience category on INInteraction to get information relevant to UnicornCore.
*/
#import "INInteraction+UnicornCore.h"
@interface INIntent (UnicornCore)
- (BOOL)isSendMessageIntent;
- (INSendMessageIntent *)sendMessageIntent;
@end
@implementation INIntent (UnicornCore)
- (BOOL)isSendMessageIntent {
return NO;
}
- (INSendMessageIntent *)sendMessageIntent {
return nil;
}
@end
@implementation INSendMessageIntent (UnicornCore)
- (BOOL)isSendMessageIntent {
return YES;
}
- (INSendMessageIntent *)sendMessageIntent {
return self;
}
@end
@implementation INInteraction (UnicornCore)
- (BOOL)representsSendMessageIntent {
return [[self intent] isSendMessageIntent];
}
- (NSString *)messageContent {
return [[[self intent] sendMessageIntent] content];
}
- (NSString *)recipientName {
return [[[[[self intent] sendMessageIntent] recipients] firstObject] displayName];
}
@end

View File

@ -0,0 +1,26 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,21 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The class that manages the current user account status, and sending/receiving messages.
*/
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface UCAccount : NSObject
@property (nonatomic) BOOL hasValidAuthentication;
+ (instancetype)sharedAccount;
- (BOOL)sendMessage:(nullable NSString *)message toRecipients:(nullable NSArray *)recipients;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,25 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The class that manages the current user account status, and sending/receiving messages.
*/
#import "UCAccount.h"
@implementation UCAccount
+ (instancetype)sharedAccount {
UCAccount *shared = [[UCAccount alloc] init];
[shared setHasValidAuthentication:YES];
return shared;
}
- (BOOL)sendMessage:(NSString *)message toRecipients:(NSArray *)recipients {
// Sending a message here...
return YES;
}
@end

View File

@ -0,0 +1,19 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The class that manages UnicornChat's own address book.
*/
#import <Foundation/Foundation.h>
@class UCContact;
NS_ASSUME_NONNULL_BEGIN
@interface UCAddressBookManager : NSObject
- (NSArray<UCContact *> *)contactsMatchingName:(NSString *)name;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,50 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The class that manages UnicornChat's own address book.
*/
#import "UCAddressBookManager.h"
#import "UCContact.h"
@implementation UCAddressBookManager
- (NSArray<UCContact *> *)contactsMatchingName:(NSString *)name {
NSMutableArray<UCContact *> *results = [[NSMutableArray alloc] init];
for (UCContact *contact in [self allContacts]) {
if ([[[contact name] lowercaseString] containsString:[name lowercaseString]]) {
[results addObject:contact];
}
}
return results;
}
- (NSArray<UCContact *> *)allContacts {
UCContact *contact1 = [[UCContact alloc] init];
[contact1 setName:@"Bill James"];
[contact1 setUnicornName:@"Sparkle Sparkly"];
UCContact *contact2 = [[UCContact alloc] init];
[contact2 setName:@"Tom Clark"];
[contact2 setUnicornName:@"Celestra"];
UCContact *contact3 = [[UCContact alloc] init];
[contact3 setName:@"Juan Chavez"];
[contact3 setUnicornName:@"Dandelion Prince"];
UCContact *contact4 = [[UCContact alloc] init];
[contact4 setName:@"Anne Johnson"];
[contact4 setUnicornName:@"Pinky Nose"];
NSArray<UCContact *> *allContacts = @[contact1,
contact2,
contact3,
contact4,
];
return allContacts;
}
@end

View File

@ -0,0 +1,17 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The view that displays messages in UnicornChat.
*/
#import <UIKit/UIKit.h>
@interface UCChatView : UIView
@property (nonatomic, copy) NSString *recipientName;
@property (nonatomic, copy) NSString *content;
@property (nonatomic, assign, getter=isSent) BOOL sent;
@end

View File

@ -0,0 +1,85 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The view that displays messages in UnicornChat.
*/
#import "UCChatView.h"
@implementation UCChatView {
UILabel *_recipientLabel;
UILabel *_contentLabel;
UIImageView *_mockView;
UIImage *_draftMock;
UIImage *_sentMock;
}
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
_draftMock = [UIImage imageNamed:@"chatmockdraft.png"];
_sentMock = [UIImage imageNamed:@"chatmock.png"];
_mockView = [[UIImageView alloc] initWithImage:_draftMock];
[_mockView setContentMode:UIViewContentModeScaleToFill];
[self addSubview:_mockView];
_recipientLabel = [[UILabel alloc] init];
[_recipientLabel setNumberOfLines:0];
[_recipientLabel setLineBreakMode:NSLineBreakByWordWrapping];
[_recipientLabel setTextColor:[UIColor whiteColor]];
[self addSubview:_recipientLabel];
_contentLabel = [[UILabel alloc] init];
[_contentLabel setNumberOfLines:0];
[_contentLabel setLineBreakMode:NSLineBreakByWordWrapping];
[self addSubview:_contentLabel];
}
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
[_mockView setFrame:[self bounds]];
[_recipientLabel setText:_recipientName];
[_recipientLabel setFrame:CGRectMake(65.0, 22.0, 62.0, 30.0)];
[_contentLabel setText:_content];
[_contentLabel setFrame:CGRectMake(113.0, 85.0, 150.0, 75.0)];
}
- (void)setSent:(BOOL)sent {
if (_sent == sent) {
return;
}
_sent = sent;
UIImage *mockImage = (_sent ? _sentMock : _draftMock);
[_mockView setImage:mockImage];
}
- (void)setContent:(NSString *)content {
if ([_content isEqualToString:content]) {
return;
}
_content = content;
[self setNeedsLayout];
}
- (void)setRecipientName:(NSString *)recipientName {
if ([_recipientName isEqualToString:recipientName]) {
return;
}
_recipientName = recipientName;
[self setNeedsLayout];
}
@end

View File

@ -0,0 +1,20 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The view controller to display messages.
*/
#import <UIKit/UIKit.h>
@class NSString;
@class UCContact;
@interface UCChatViewController : UIViewController
@property (nonatomic, strong) UCContact *recipient;
@property (nonatomic, strong) NSString *messageContent;
@property (nonatomic, assign, getter=isSent) BOOL sent;
@end

View File

@ -0,0 +1,54 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
The view controller to display messages.
*/
#import "UCChatViewController.h"
#import "UCChatView.h"
#import "UCContact.h"
#import <Foundation/Foundation.h>
@interface UCChatViewController ()
@property (null_resettable, nonatomic, strong) UCChatView *view;
@end
@implementation UCChatViewController
@dynamic view;
- (void)loadView {
UCChatView *chatView = [[UCChatView alloc] init];
[self setView:chatView];
}
- (void)setRecipient:(UCContact *)recipient {
if (![_recipient isEqual:recipient]) {
_recipient = recipient;
[[self view] setRecipientName:[recipient name]];
}
}
- (NSString *)messageContent {
return [[self view] content];
}
- (void)setMessageContent:(NSString *)messageContent {
[[self view] setContent:messageContent];
}
- (void)setSent:(BOOL)sent {
[[self view] setSent:sent];
}
- (BOOL)isSent {
return [[self view] isSent];
}
@end

View File

@ -0,0 +1,26 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
Data model class for contact object in UnicornChat.
*/
#import <Foundation/Foundation.h>
@class INPerson;
NS_ASSUME_NONNULL_BEGIN
@interface UCContact : NSObject
@property (nonatomic, copy, nullable) NSString *name;
@property (nonatomic, copy, nullable) NSString *unicornName;
@property (nonatomic) BOOL favorite;
- (INPerson *)inPerson;
@end
NS_ASSUME_NONNULL_END

View File

@ -0,0 +1,19 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
Data model class for contact object in UnicornChat.
*/
#import "UCContact.h"
#import <Intents/Intents.h>
@implementation UCContact
- (INPerson *)inPerson {
INPersonHandle *handle = [[INPersonHandle alloc] initWithValue:_unicornName type:INPersonHandleTypeUnknown];
return [[INPerson alloc] initWithPersonHandle:handle nameComponents:nil displayName:_name image:nil contactIdentifier:_unicornName customIdentifier:nil];
}
@end

View File

@ -0,0 +1,21 @@
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this samples licensing information
Abstract:
Embedded framework used among the main application and the extensions.
*/
#import <UIKit/UIKit.h>
//! Project version number for UnicornCore.
FOUNDATION_EXPORT double UnicornCoreVersionNumber;
//! Project version string for UnicornCore.
FOUNDATION_EXPORT const unsigned char UnicornCoreVersionString[];
#import <UnicornCore/INInteraction+UnicornCore.h>
#import <UnicornCore/UCChatViewController.h>
#import <UnicornCore/UCContact.h>
#import <UnicornCore/UCAddressBookManager.h>
#import <UnicornCore/UCAccount.h>

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB