├── .gitignore
├── .gitmodules
├── LICENSE.txt
├── README.md
├── simple-chat-playground
├── Playground.playground
│ ├── Pages
│ │ ├── Chat Bot.xcplaygroundpage
│ │ │ └── Contents.swift
│ │ ├── Conversation.xcplaygroundpage
│ │ │ └── Contents.swift
│ │ ├── Speech to Text.xcplaygroundpage
│ │ │ └── Contents.swift
│ │ └── Text to Speech.xcplaygroundpage
│ │ │ └── Contents.swift
│ ├── Resources
│ │ └── TurnRadioOn.wav
│ ├── contents.xcplayground
│ └── playground.xcworkspace
│ │ └── contents.xcworkspacedata
└── Playground.xcworkspace
│ └── contents.xcworkspacedata
├── simple-chat
├── Cartfile
├── Cartfile.resolved
├── Podfile
├── Podfile.lock
├── Pods
│ ├── JSQMessagesViewController
│ │ ├── JSQMessagesViewController
│ │ │ ├── Assets
│ │ │ │ └── JSQMessagesAssets.bundle
│ │ │ │ │ ├── Base.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── Images
│ │ │ │ │ ├── bubble_min.png
│ │ │ │ │ ├── bubble_min@2x.png
│ │ │ │ │ ├── bubble_min@3x.png
│ │ │ │ │ ├── bubble_min_tailless.png
│ │ │ │ │ ├── bubble_min_tailless@2x.png
│ │ │ │ │ ├── bubble_min_tailless@3x.png
│ │ │ │ │ ├── bubble_regular.png
│ │ │ │ │ ├── bubble_regular@2x.png
│ │ │ │ │ ├── bubble_regular@3x.png
│ │ │ │ │ ├── bubble_stroked.png
│ │ │ │ │ ├── bubble_stroked@2x.png
│ │ │ │ │ ├── bubble_stroked@3x.png
│ │ │ │ │ ├── bubble_stroked_tailless.png
│ │ │ │ │ ├── bubble_stroked_tailless@2x.png
│ │ │ │ │ ├── bubble_stroked_tailless@3x.png
│ │ │ │ │ ├── bubble_tailless.png
│ │ │ │ │ ├── bubble_tailless@2x.png
│ │ │ │ │ ├── bubble_tailless@3x.png
│ │ │ │ │ ├── clip.png
│ │ │ │ │ ├── clip@2x.png
│ │ │ │ │ ├── clip@3x.png
│ │ │ │ │ ├── pause.png
│ │ │ │ │ ├── pause@2x.png
│ │ │ │ │ ├── pause@3x.png
│ │ │ │ │ ├── play.png
│ │ │ │ │ ├── play@2x.png
│ │ │ │ │ ├── play@3x.png
│ │ │ │ │ ├── typing.png
│ │ │ │ │ ├── typing@2x.png
│ │ │ │ │ └── typing@3x.png
│ │ │ │ │ ├── Sounds
│ │ │ │ │ ├── message_received.aiff
│ │ │ │ │ └── message_sent.aiff
│ │ │ │ │ ├── ar.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── de.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── en.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── es.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── fi.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── fr.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── he.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── id.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── it.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── ja.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── ko.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── ms.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── nb.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── nl.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── pl.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── pt.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── ro.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── ru.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── th.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── tr.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── vi.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ ├── zh-Hans.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ │ │ └── zh-Hant.lproj
│ │ │ │ │ └── JSQMessages.strings
│ │ │ ├── Categories
│ │ │ │ ├── JSQSystemSoundPlayer+JSQMessages.h
│ │ │ │ ├── JSQSystemSoundPlayer+JSQMessages.m
│ │ │ │ ├── NSBundle+JSQMessages.h
│ │ │ │ ├── NSBundle+JSQMessages.m
│ │ │ │ ├── NSString+JSQMessages.h
│ │ │ │ ├── NSString+JSQMessages.m
│ │ │ │ ├── UIColor+JSQMessages.h
│ │ │ │ ├── UIColor+JSQMessages.m
│ │ │ │ ├── UIDevice+JSQMessages.h
│ │ │ │ ├── UIDevice+JSQMessages.m
│ │ │ │ ├── UIImage+JSQMessages.h
│ │ │ │ ├── UIImage+JSQMessages.m
│ │ │ │ ├── UIView+JSQMessages.h
│ │ │ │ └── UIView+JSQMessages.m
│ │ │ ├── Controllers
│ │ │ │ ├── JSQMessagesKeyboardController.h
│ │ │ │ ├── JSQMessagesKeyboardController.m
│ │ │ │ ├── JSQMessagesViewController.h
│ │ │ │ ├── JSQMessagesViewController.m
│ │ │ │ └── JSQMessagesViewController.xib
│ │ │ ├── Factories
│ │ │ │ ├── JSQMessagesAvatarImageFactory.h
│ │ │ │ ├── JSQMessagesAvatarImageFactory.m
│ │ │ │ ├── JSQMessagesBubbleImageFactory.h
│ │ │ │ ├── JSQMessagesBubbleImageFactory.m
│ │ │ │ ├── JSQMessagesMediaViewBubbleImageMasker.h
│ │ │ │ ├── JSQMessagesMediaViewBubbleImageMasker.m
│ │ │ │ ├── JSQMessagesTimestampFormatter.h
│ │ │ │ ├── JSQMessagesTimestampFormatter.m
│ │ │ │ ├── JSQMessagesToolbarButtonFactory.h
│ │ │ │ └── JSQMessagesToolbarButtonFactory.m
│ │ │ ├── JSQMessages.h
│ │ │ ├── Layout
│ │ │ │ ├── JSQAudioMediaViewAttributes.h
│ │ │ │ ├── JSQAudioMediaViewAttributes.m
│ │ │ │ ├── JSQMessagesBubbleSizeCalculating.h
│ │ │ │ ├── JSQMessagesBubblesSizeCalculator.h
│ │ │ │ ├── JSQMessagesBubblesSizeCalculator.m
│ │ │ │ ├── JSQMessagesCollectionViewFlowLayout.h
│ │ │ │ ├── JSQMessagesCollectionViewFlowLayout.m
│ │ │ │ ├── JSQMessagesCollectionViewFlowLayoutInvalidationContext.h
│ │ │ │ ├── JSQMessagesCollectionViewFlowLayoutInvalidationContext.m
│ │ │ │ ├── JSQMessagesCollectionViewLayoutAttributes.h
│ │ │ │ └── JSQMessagesCollectionViewLayoutAttributes.m
│ │ │ ├── Model
│ │ │ │ ├── JSQAudioMediaItem.h
│ │ │ │ ├── JSQAudioMediaItem.m
│ │ │ │ ├── JSQLocationMediaItem.h
│ │ │ │ ├── JSQLocationMediaItem.m
│ │ │ │ ├── JSQMediaItem.h
│ │ │ │ ├── JSQMediaItem.m
│ │ │ │ ├── JSQMessage.h
│ │ │ │ ├── JSQMessage.m
│ │ │ │ ├── JSQMessageAvatarImageDataSource.h
│ │ │ │ ├── JSQMessageBubbleImageDataSource.h
│ │ │ │ ├── JSQMessageData.h
│ │ │ │ ├── JSQMessageMediaData.h
│ │ │ │ ├── JSQMessagesAvatarImage.h
│ │ │ │ ├── JSQMessagesAvatarImage.m
│ │ │ │ ├── JSQMessagesBubbleImage.h
│ │ │ │ ├── JSQMessagesBubbleImage.m
│ │ │ │ ├── JSQMessagesCollectionViewDataSource.h
│ │ │ │ ├── JSQMessagesCollectionViewDelegateFlowLayout.h
│ │ │ │ ├── JSQPhotoMediaItem.h
│ │ │ │ ├── JSQPhotoMediaItem.m
│ │ │ │ ├── JSQVideoMediaItem.h
│ │ │ │ └── JSQVideoMediaItem.m
│ │ │ └── Views
│ │ │ │ ├── JSQMessagesCellTextView.h
│ │ │ │ ├── JSQMessagesCellTextView.m
│ │ │ │ ├── JSQMessagesCollectionView.h
│ │ │ │ ├── JSQMessagesCollectionView.m
│ │ │ │ ├── JSQMessagesCollectionViewCell.h
│ │ │ │ ├── JSQMessagesCollectionViewCell.m
│ │ │ │ ├── JSQMessagesCollectionViewCellIncoming.h
│ │ │ │ ├── JSQMessagesCollectionViewCellIncoming.m
│ │ │ │ ├── JSQMessagesCollectionViewCellIncoming.xib
│ │ │ │ ├── JSQMessagesCollectionViewCellOutgoing.h
│ │ │ │ ├── JSQMessagesCollectionViewCellOutgoing.m
│ │ │ │ ├── JSQMessagesCollectionViewCellOutgoing.xib
│ │ │ │ ├── JSQMessagesComposerTextView.h
│ │ │ │ ├── JSQMessagesComposerTextView.m
│ │ │ │ ├── JSQMessagesInputToolbar.h
│ │ │ │ ├── JSQMessagesInputToolbar.m
│ │ │ │ ├── JSQMessagesLabel.h
│ │ │ │ ├── JSQMessagesLabel.m
│ │ │ │ ├── JSQMessagesLoadEarlierHeaderView.h
│ │ │ │ ├── JSQMessagesLoadEarlierHeaderView.m
│ │ │ │ ├── JSQMessagesLoadEarlierHeaderView.xib
│ │ │ │ ├── JSQMessagesMediaPlaceholderView.h
│ │ │ │ ├── JSQMessagesMediaPlaceholderView.m
│ │ │ │ ├── JSQMessagesToolbarContentView.h
│ │ │ │ ├── JSQMessagesToolbarContentView.m
│ │ │ │ ├── JSQMessagesToolbarContentView.xib
│ │ │ │ ├── JSQMessagesTypingIndicatorFooterView.h
│ │ │ │ ├── JSQMessagesTypingIndicatorFooterView.m
│ │ │ │ └── JSQMessagesTypingIndicatorFooterView.xib
│ │ ├── LICENSE
│ │ └── README.md
│ ├── JSQSystemSoundPlayer
│ │ ├── JSQSystemSoundPlayer
│ │ │ └── Classes
│ │ │ │ ├── JSQSystemSoundPlayer.h
│ │ │ │ └── JSQSystemSoundPlayer.m
│ │ ├── LICENSE
│ │ └── README.md
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ │ └── project.pbxproj
│ └── Target Support Files
│ │ ├── JSQMessagesViewController
│ │ ├── Info.plist
│ │ ├── JSQMessagesViewController-dummy.m
│ │ ├── JSQMessagesViewController-prefix.pch
│ │ ├── JSQMessagesViewController-umbrella.h
│ │ ├── JSQMessagesViewController.modulemap
│ │ └── JSQMessagesViewController.xcconfig
│ │ ├── JSQSystemSoundPlayer
│ │ ├── Info.plist
│ │ ├── JSQSystemSoundPlayer-dummy.m
│ │ ├── JSQSystemSoundPlayer-prefix.pch
│ │ ├── JSQSystemSoundPlayer-umbrella.h
│ │ ├── JSQSystemSoundPlayer.modulemap
│ │ └── JSQSystemSoundPlayer.xcconfig
│ │ └── Pods-Simple Chat
│ │ ├── Info.plist
│ │ ├── Pods-Simple Chat-acknowledgements.markdown
│ │ ├── Pods-Simple Chat-acknowledgements.plist
│ │ ├── Pods-Simple Chat-dummy.m
│ │ ├── Pods-Simple Chat-frameworks.sh
│ │ ├── Pods-Simple Chat-resources.sh
│ │ ├── Pods-Simple Chat-umbrella.h
│ │ ├── Pods-Simple Chat.debug.xcconfig
│ │ ├── Pods-Simple Chat.modulemap
│ │ └── Pods-Simple Chat.release.xcconfig
├── Simple Chat.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
├── Simple Chat.xcworkspace
│ └── contents.xcworkspacedata
└── Simple Chat
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Contents.json
│ ├── microphone-hollow.imageset
│ │ ├── Contents.json
│ │ ├── microphone-hollow.png
│ │ ├── microphone-hollow@2x.png
│ │ └── microphone-hollow@3x.png
│ ├── microphone.imageset
│ │ ├── Contents.json
│ │ ├── speechIcon.png
│ │ ├── speechIcon@2x.png
│ │ └── speechIcon@3x.png
│ └── watson_avatar.imageset
│ │ ├── Contents.json
│ │ └── watson_avatar.pdf
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Credentials.swift.example
│ ├── Info.plist
│ ├── User.swift
│ └── ViewController.swift
├── tutorial-images
└── simple-chat.gif
└── tutorial.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Custom
2 | Credentials.swift
3 |
4 | # Build generated
5 | build/
6 | DerivedData/
7 |
8 | # Various settings
9 | *.pbxuser
10 | !default.pbxuser
11 | *.mode1v3
12 | !default.mode1v3
13 | *.mode2v3
14 | !default.mode2v3
15 | *.perspectivev3
16 | !default.perspectivev3
17 | xcuserdata/
18 |
19 | # Other
20 | .DS_Store
21 | *.moved-aside
22 | *.xcuserstate
23 |
24 | # Obj-C/Swift specific
25 | *.hmap
26 | *.ipa
27 |
28 | # Playgrounds
29 | # timeline.xctimeline
30 | # playground.xcworkspace
31 |
32 | # Swift Package Manager
33 | Packages/
34 | .build/
35 |
36 | # Carthage
37 | Carthage/
38 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "simple-chat-playground/swift-sdk"]
2 | path = simple-chat-playground/swift-sdk
3 | url = https://github.com/watson-developer-cloud/swift-sdk
4 | [submodule "simple-chat-playground/Starscream"]
5 | path = simple-chat-playground/Starscream
6 | url = https://github.com/daltoniam/Starscream.git
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Simple Chat (Swift)
2 |
3 | ## DEPRECATED: this repo is no longer actively maintained. It can still be used as reference, but may contain outdated or unpatched code.
4 |
5 | This repository contains an example application to demonstrate the [Watson Developer Cloud Swift SDK](https://github.com/watson-developer-cloud/swift-sdk). It combines the [Speech to Text](https://www.ibm.com/watson/developercloud/speech-to-text.html), [Conversation](https://www.ibm.com/watson/developercloud/conversation.html), and [Text to Speech](https://www.ibm.com/watson/developercloud/text-to-speech.html) services to build a voice-to-voice chat app.
6 |
7 | 
8 |
9 | ## Tutorial
10 |
11 | If you'd prefer to learn by building this app yourself, feel free to follow along with the [tutorial](tutorial.md).
12 |
13 | ## Project Setup
14 |
15 | To run the sample playground or iOS app, be sure to clone the repository and download the Watson Developer Cloud Swift SDK dependency. The dependency will be loaded twice, once as a Git submodule (for use in the playground) and again with Carthage (for use in the iOS app).
16 |
17 | ```bash
18 | $ git clone https://github.com/watson-developer-cloud/simple-chat-swift.git
19 | $ cd simple-chat-swift/simple-chat
20 | $ git submodule init
21 | $ git submodule update
22 | $ carthage update --platform iOS
23 | ```
24 |
25 | ## Provision Services
26 |
27 | The sample playground and iOS app both use the Speech to Text, Conversation, and Text to Speech services. Each service must be provisioned. You will need to [sign up for a Bluemix account](https://console.ng.bluemix.net/registration/) if you do not already have one.
28 |
29 | To provision each service:
30 |
31 | 1. Open the [Bluemix services dashboard](https://console.ng.bluemix.net/dashboard/services).
32 | 2. Select the "Create Service" button.
33 | 3. Select the "Watson" category from the left-hand menu.
34 | 4. Select the service to provision.
35 | 5. Select "Create" to continue. (The default configuration options are fine for this tutorial.)
36 |
37 | ## Credentials
38 |
39 | Each of the services you provisioned has its own username and password credentials. The playground and iOS app expect to find these credentials in a `Credentials.swift` file.
40 |
41 | Start by renaming the `Credentials.swift.example` file in your project directory to `Credentials.swift`. Then open `Credentials.swift` in Xcode. This file will record our service credentials.
42 |
43 | 1. Open the [Bluemix services dashboard](https://console.ng.bluemix.net/dashboard/services).
44 | 2. Select the service whose credentials you would like to record.
45 | 3. Select "Service credentials" from the left-hand navigation menu.
46 | 4. Select "View credentials".
47 | 5. Copy the username and password into `Credentials.swift`.
48 |
49 | Repeat these steps to copy the username and password credentials for the Speech to Text, Conversation, and Text to Speech services.
50 |
51 | ## Resources
52 |
53 | Watson Developer Cloud:
54 | - [Watson Developer Cloud](https://www.ibm.com/watson/developercloud/)
55 | - [Watson Developer Cloud GitHub](https://github.com/watson-developer-cloud)
56 | - [Watson Developer Cloud Swift SDK](https://github.com/watson-developer-cloud/swift-sdk)
57 |
58 | Watson Swift SDK:
59 | - [Readme](https://github.com/watson-developer-cloud/swift-sdk/blob/master/README.md)
60 | - [Quick Start Guide](https://github.com/watson-developer-cloud/swift-sdk/blob/master/docs/quickstart.md)
61 | - [Sample Apps](https://github.com/watson-developer-cloud/swift-sdk#sample-applications)
62 | - [Documentation](http://watson-developer-cloud.github.io/swift-sdk/)
63 |
64 | Swift@IBM:
65 | - [Swift@IBM Developer Center](https://developer.ibm.com/swift/)
66 | - [Kitura Developer Center](https://developer.ibm.com/swift/kitura/)
67 |
--------------------------------------------------------------------------------
/simple-chat-playground/Playground.playground/Pages/Chat Bot.xcplaygroundpage/Contents.swift:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright IBM Corporation 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | **/
16 |
17 | import PlaygroundSupport
18 | import AVFoundation
19 | import SpeechToTextV1
20 | import ConversationV1
21 | import TextToSpeechV1
22 |
23 | // Configure playground environment
24 | PlaygroundPage.current.needsIndefiniteExecution = true
25 | URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
26 |
27 | // Instantiate services
28 | let speechToText = SpeechToText(
29 | username: Credentials.SpeechToTextUsername,
30 | password: Credentials.SpeechToTextPassword
31 | )
32 | let conversation = Conversation(
33 | username: Credentials.ConversationUsername,
34 | password: Credentials.ConversationPassword,
35 | version: "2017-05-26"
36 | )
37 | let textToSpeech = TextToSpeech(
38 | username: Credentials.TextToSpeechUsername,
39 | password: Credentials.TextToSpeechPassword
40 | )
41 |
42 | // Instantiate audio player
43 | var audioPlayer: AVAudioPlayer?
44 |
45 | // Set conversation workspace
46 | let workspace = Credentials.ConversationWorkspace
47 |
48 | // Load audio recording
49 | let recordingPath = Bundle.main.path(forResource: "TurnRadioOn", ofType: "wav")!
50 | let recording = URL(fileURLWithPath: recordingPath)
51 |
52 | // Transcribe audio recording
53 | let settings = RecognitionSettings(contentType: .wav)
54 | speechToText.recognize(audio: recording, settings: settings) { text in
55 | print("Transcription: \(text.bestTranscript)")
56 |
57 | // Send transcription as conversation request
58 | conversation.message(workspaceID: workspace) { response in
59 | let input = InputData(text: text.bestTranscript)
60 | let request = MessageRequest(input: input, context: response.context)
61 | conversation.message(workspaceID: workspace, request: request) { response in
62 | let reply = response.output.text.joined()
63 | print("Reply: \(reply)")
64 |
65 | // Synthesize response to spoken word
66 | textToSpeech.synthesize(reply) { audio in
67 | audioPlayer = try! AVAudioPlayer(data: audio)
68 | audioPlayer?.prepareToPlay()
69 | audioPlayer?.play()
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/simple-chat-playground/Playground.playground/Pages/Conversation.xcplaygroundpage/Contents.swift:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright IBM Corporation 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | **/
16 |
17 | import PlaygroundSupport
18 | import ConversationV1
19 |
20 | // Configure playground environment
21 | PlaygroundPage.current.needsIndefiniteExecution = true
22 | URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
23 |
24 | // Instantiate service
25 | let conversation = Conversation(
26 | username: Credentials.ConversationUsername,
27 | password: Credentials.ConversationPassword,
28 | version: "2017-05-26"
29 | )
30 |
31 | // Set conversation workspace
32 | let workspace = Credentials.ConversationWorkspace
33 |
34 | // Start conversation
35 | conversation.message(workspaceID: workspace) { response in
36 | print(response.context.conversationID)
37 | print(response.output.text.joined())
38 |
39 | // Continue conversation
40 | let input = InputData(text: " turn the radio on ")
41 | let request = MessageRequest(input: input, context: response.context)
42 | conversation.message(workspaceID: workspace, request: request) { response in
43 | print(response.output.text.joined())
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/simple-chat-playground/Playground.playground/Pages/Speech to Text.xcplaygroundpage/Contents.swift:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright IBM Corporation 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | **/
16 |
17 | import PlaygroundSupport
18 | import SpeechToTextV1
19 |
20 | // Configure playground environment
21 | PlaygroundPage.current.needsIndefiniteExecution = true
22 | URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
23 |
24 | // Instantiate service
25 | let speechToText = SpeechToText(
26 | username: Credentials.SpeechToTextUsername,
27 | password: Credentials.SpeechToTextPassword
28 | )
29 |
30 | // Load audio recording
31 | let recordingPath = Bundle.main.path(forResource: "TurnRadioOn", ofType: "wav")!
32 | let recording = URL(fileURLWithPath: recordingPath)
33 |
34 | // Transcribe audio recording
35 | let settings = RecognitionSettings(contentType: .wav)
36 | speechToText.recognize(audio: recording, settings: settings) { text in
37 | print(text.bestTranscript)
38 | }
39 |
--------------------------------------------------------------------------------
/simple-chat-playground/Playground.playground/Pages/Text to Speech.xcplaygroundpage/Contents.swift:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright IBM Corporation 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | **/
16 |
17 | import PlaygroundSupport
18 | import AVFoundation
19 | import TextToSpeechV1
20 |
21 | // Configure playground environment
22 | PlaygroundPage.current.needsIndefiniteExecution = true
23 | URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
24 |
25 | // Instantiate service
26 | let textToSpeech = TextToSpeech(
27 | username: Credentials.TextToSpeechUsername,
28 | password: Credentials.TextToSpeechPassword
29 | )
30 |
31 | // Instantiate audio player
32 | var audioPlayer: AVAudioPlayer?
33 |
34 | // Synthesize text to spoken word
35 | let text = "Sure thing! Which genre would you prefer? Jazz is my personal favorite."
36 | textToSpeech.synthesize(text) { audio in
37 | audioPlayer = try! AVAudioPlayer(data: audio)
38 | audioPlayer?.prepareToPlay()
39 | audioPlayer?.play()
40 | }
41 |
--------------------------------------------------------------------------------
/simple-chat-playground/Playground.playground/Resources/TurnRadioOn.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat-playground/Playground.playground/Resources/TurnRadioOn.wav
--------------------------------------------------------------------------------
/simple-chat-playground/Playground.playground/contents.xcplayground:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/simple-chat-playground/Playground.playground/playground.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/simple-chat-playground/Playground.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/simple-chat/Cartfile:
--------------------------------------------------------------------------------
1 | github "watson-developer-cloud/swift-sdk"
2 |
--------------------------------------------------------------------------------
/simple-chat/Cartfile.resolved:
--------------------------------------------------------------------------------
1 | github "daltoniam/Starscream" "3.0.4"
2 | github "daltoniam/common-crypto-spm" "1.1.0"
3 | github "daltoniam/zlib-spm" "1.1.0"
4 | github "watson-developer-cloud/swift-sdk" "v0.21.0"
5 |
--------------------------------------------------------------------------------
/simple-chat/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | target 'Simple Chat' do
5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
6 | use_frameworks!
7 |
8 | # Pods for Simple Chat
9 | pod 'JSQMessagesViewController'
10 |
11 | end
12 |
--------------------------------------------------------------------------------
/simple-chat/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - JSQMessagesViewController (7.3.5):
3 | - JSQSystemSoundPlayer (~> 2.0.1)
4 | - JSQSystemSoundPlayer (2.0.1)
5 |
6 | DEPENDENCIES:
7 | - JSQMessagesViewController
8 |
9 | SPEC CHECKSUMS:
10 | JSQMessagesViewController: 6587f56aedbcb150a8ba1d968e1ef58b1bc758b7
11 | JSQSystemSoundPlayer: c5850e77a4363ffd374cd851154b9af93264ed8d
12 |
13 | PODFILE CHECKSUM: 7d1ef276401e740a2993e6e057ce81cb7928e4af
14 |
15 | COCOAPODS: 1.3.1
16 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Base.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Load Earlier Messages";
26 |
27 | "send" = "Send";
28 |
29 | "new_message" = "New Message";
30 |
31 | "text_message_accessibility_label" = "%@: %@";
32 |
33 | "media_message_accessibility_label" = "%@: media message";
34 |
35 | "accessory_button_accessibility_label" = "Share media";
36 |
37 | "new_message_received_accessibility_announcement" = "New message received";
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min@2x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min@3x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless@2x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_min_tailless@3x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular@2x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_regular@3x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked@2x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked@3x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless@2x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_stroked_tailless@3x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless@2x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/bubble_tailless@3x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip@2x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/clip@3x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause@2x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/pause@3x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play@2x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/play@3x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing@2x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Images/typing@3x.png
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Sounds/message_received.aiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Sounds/message_received.aiff
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Sounds/message_sent.aiff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/Sounds/message_sent.aiff
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ar.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "تحميل الرسائل السابقة";
26 |
27 | "send" = "أرسال";
28 |
29 | "new_message" = "رسالة جديدة";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/de.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Ältere Nachrichten laden";
26 |
27 | "send" = "Senden";
28 |
29 | "new_message" = "Neue Nachricht";
30 |
31 | "text_message_accessibility_label" = "%@: %@";
32 |
33 | "media_message_accessibility_label" = "%@: media Nachricht";
34 |
35 | "accessory_button_accessibility_label" = "Aktien media";
36 |
37 | "new_message_received_accessibility_announcement" = "Neue Nachricht empfangen";
38 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/en.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Load Earlier Messages";
26 |
27 | "send" = "Send";
28 |
29 | "new_message" = "New Message";
30 |
31 | "text_message_accessibility_label" = "%@: %@";
32 |
33 | "media_message_accessibility_label" = "%@: media message";
34 |
35 | "accessory_button_accessibility_label" = "Share media";
36 |
37 | "new_message_received_accessibility_announcement" = "New message received";
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/es.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Cargar mensajes anteriores";
26 |
27 | "send" = "Enviar";
28 |
29 | "new_message" = "Nuevo mensaje";
30 |
31 | "text_message_accessibility_label" = "%@: %@";
32 |
33 | "media_message_accessibility_label" = "%@: imagen";
34 |
35 | "accessory_button_accessibility_label" = "Intercambio de archivos";
36 |
37 | "new_message_received_accessibility_announcement" = "mensaje recibido";
38 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/fi.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Lataa aiempia viestejä";
26 |
27 | "send" = "Lähetä";
28 |
29 | "new_message" = "Uusi viesti";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/fr.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Messages précedents";
26 |
27 | "send" = "Envoyer";
28 |
29 | "new_message" = "Nouveau message";
30 |
31 | "text_message_accessibility_label" = "%@: %@";
32 |
33 | "media_message_accessibility_label" = "%@: image";
34 |
35 | "accessory_button_accessibility_label" = "Partager fichier";
36 |
37 | "new_message_received_accessibility_announcement" = "Nouveau message reçu";
38 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/he.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "טען הודעות קודמות";
26 |
27 | "send" = "שלח";
28 |
29 | "new_message" = "הודעה חדשה";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/id.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Muat Pesan Sebelumnya";
26 |
27 | "send" = "Kirim";
28 |
29 | "new_message" = "Pesan Baru";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/it.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Carica messaggi precedenti";
26 |
27 | "send" = "Invia";
28 |
29 | "new_message" = "Nuovo Messaggio";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ja.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "古いメッセージを読み込む";
26 |
27 | "send" = "送信";
28 |
29 | "new_message" = "新しいメッセージ";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ko.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "이전 메시지 불러오기";
26 |
27 | "send" = "전송";
28 |
29 | "new_message" = "새로운 메시지";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ms.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Muat Turun Mesej Lama";
26 |
27 | "send" = "Hantar";
28 |
29 | "new_message" = "Mesej Baru";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/nb.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Last tidligere beskjeder";
26 |
27 | "send" = "Send";
28 |
29 | "new_message" = "Ny melding";
30 |
31 | "text_message_accessibility_label" = "%@: %@";
32 |
33 | "media_message_accessibility_label" = "%@: mediamelding";
34 |
35 | "accessory_button_accessibility_label" = "Del media";
36 |
37 | "new_message_received_accessibility_announcement" = "Ny melding mottatt";
38 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/nl.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Laad eerdere berichten";
26 |
27 | "send" = "Stuur";
28 |
29 | "new_message" = "Nieuw bericht";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/pl.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Otwórz wcześniejsze wiadomości";
26 |
27 | "send" = "Wyślij";
28 |
29 | "new_message" = "Nowa wiadomość";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/pt.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Carregar mensagens anteriores";
26 |
27 | "send" = "Enviar";
28 |
29 | "new_message" = "Nova Mensagem";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ro.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Încărcați mesajele anterioare";
26 |
27 | "send" = "Trimiteți";
28 |
29 | "new_message" = "Mesaj nou";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/ru.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Предыдущие сообщения";
26 |
27 | "send" = "Отпр";
28 |
29 | "new_message" = "Сообщение";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/th.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "โหลดข้อความก่อนหน้า";
26 |
27 | "send" = "ส่ง";
28 |
29 | "new_message" = "ข้อความใหม่";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/tr.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Eski mesajları yükle";
26 |
27 | "send" = "Gönder";
28 |
29 | "new_message" = "Yeni Mesaj";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/vi.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "Tải thêm tin nhắn";
26 |
27 | "send" = "Gửi";
28 |
29 | "new_message" = "Tin nhắn mới";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/zh-Hans.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "载入较早的信息";
26 |
27 | "send" = "发送";
28 |
29 | "new_message" = "新信息";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Assets/JSQMessagesAssets.bundle/zh-Hant.lproj/JSQMessages.strings:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | // ********************************
20 | // Special thanks to the localization contributors!
21 | //
22 | // https://github.com/jessesquires/JSQMessagesViewController/issues/237
23 | // ********************************
24 |
25 | "load_earlier_messages" = "載入之前的訊息";
26 |
27 | "send" = "傳送";
28 |
29 | "new_message" = "新信息";
30 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/JSQSystemSoundPlayer+JSQMessages.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | @interface JSQSystemSoundPlayer (JSQMessages)
22 |
23 | /**
24 | * Plays the default sound for received messages.
25 | */
26 | + (void)jsq_playMessageReceivedSound;
27 |
28 | /**
29 | * Plays the default sound for received messages *as an alert*, invoking device vibration if available.
30 | */
31 | + (void)jsq_playMessageReceivedAlert;
32 |
33 | /**
34 | * Plays the default sound for sent messages.
35 | */
36 | + (void)jsq_playMessageSentSound;
37 |
38 | /**
39 | * Plays the default sound for sent messages *as an alert*, invoking device vibration if available.
40 | */
41 | + (void)jsq_playMessageSentAlert;
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/JSQSystemSoundPlayer+JSQMessages.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQSystemSoundPlayer+JSQMessages.h"
20 |
21 | #import "NSBundle+JSQMessages.h"
22 |
23 |
24 | static NSString * const kJSQMessageReceivedSoundName = @"message_received";
25 | static NSString * const kJSQMessageSentSoundName = @"message_sent";
26 |
27 |
28 | @implementation JSQSystemSoundPlayer (JSQMessages)
29 |
30 | #pragma mark - Public
31 |
32 | + (void)jsq_playMessageReceivedSound
33 | {
34 | [self jsq_playSoundFromJSQMessagesBundleWithName:kJSQMessageReceivedSoundName asAlert:NO];
35 | }
36 |
37 | + (void)jsq_playMessageReceivedAlert
38 | {
39 | [self jsq_playSoundFromJSQMessagesBundleWithName:kJSQMessageReceivedSoundName asAlert:YES];
40 | }
41 |
42 | + (void)jsq_playMessageSentSound
43 | {
44 | [self jsq_playSoundFromJSQMessagesBundleWithName:kJSQMessageSentSoundName asAlert:NO];
45 | }
46 |
47 | + (void)jsq_playMessageSentAlert
48 | {
49 | [self jsq_playSoundFromJSQMessagesBundleWithName:kJSQMessageSentSoundName asAlert:YES];
50 | }
51 |
52 | #pragma mark - Private
53 |
54 | + (void)jsq_playSoundFromJSQMessagesBundleWithName:(NSString *)soundName asAlert:(BOOL)asAlert
55 | {
56 | // save sound player original bundle
57 | NSString *originalPlayerBundleIdentifier = [JSQSystemSoundPlayer sharedPlayer].bundle.bundleIdentifier;
58 |
59 | // search for sounds in this library's bundle
60 | [JSQSystemSoundPlayer sharedPlayer].bundle = [NSBundle jsq_messagesBundle];
61 |
62 | NSString *fileName = [NSString stringWithFormat:@"JSQMessagesAssets.bundle/Sounds/%@", soundName];
63 |
64 | if (asAlert) {
65 | [[JSQSystemSoundPlayer sharedPlayer] playAlertSoundWithFilename:fileName fileExtension:kJSQSystemSoundTypeAIFF];
66 | }
67 | else {
68 | [[JSQSystemSoundPlayer sharedPlayer] playSoundWithFilename:fileName fileExtension:kJSQSystemSoundTypeAIFF];
69 | }
70 |
71 | // restore original bundle
72 | [JSQSystemSoundPlayer sharedPlayer].bundle = [NSBundle bundleWithIdentifier:originalPlayerBundleIdentifier];
73 | }
74 |
75 | @end
76 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/NSBundle+JSQMessages.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | @interface NSBundle (JSQMessages)
22 |
23 | /**
24 | * @return The bundle for JSQMessagesViewController.
25 | */
26 | + (NSBundle *)jsq_messagesBundle;
27 |
28 | /**
29 | * @return The bundle for assets in JSQMessagesViewController.
30 | */
31 | + (NSBundle *)jsq_messagesAssetBundle;
32 |
33 | /**
34 | * Returns a localized version of the string designated by the specified key and residing in the JSQMessages table.
35 | *
36 | * @param key The key for a string in the JSQMessages table.
37 | *
38 | * @return A localized version of the string designated by key in the JSQMessages table.
39 | */
40 | + (NSString *)jsq_localizedStringForKey:(NSString *)key;
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/NSBundle+JSQMessages.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "NSBundle+JSQMessages.h"
20 |
21 | #import "JSQMessagesViewController.h"
22 |
23 | @implementation NSBundle (JSQMessages)
24 |
25 | + (NSBundle *)jsq_messagesBundle
26 | {
27 | return [NSBundle bundleForClass:[JSQMessagesViewController class]];
28 | }
29 |
30 | + (NSBundle *)jsq_messagesAssetBundle
31 | {
32 | NSString *bundleResourcePath = [NSBundle jsq_messagesBundle].resourcePath;
33 | NSString *assetPath = [bundleResourcePath stringByAppendingPathComponent:@"JSQMessagesAssets.bundle"];
34 | return [NSBundle bundleWithPath:assetPath];
35 | }
36 |
37 | + (NSString *)jsq_localizedStringForKey:(NSString *)key
38 | {
39 | return NSLocalizedStringFromTableInBundle(key, @"JSQMessages", [NSBundle jsq_messagesAssetBundle], nil);
40 | }
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/NSString+JSQMessages.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | @interface NSString (JSQMessages)
22 |
23 | /**
24 | * @return A copy of the receiver with all leading and trailing whitespace removed.
25 | */
26 | - (NSString *)jsq_stringByTrimingWhitespace;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/NSString+JSQMessages.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "NSString+JSQMessages.h"
20 |
21 | @implementation NSString (JSQMessages)
22 |
23 | - (NSString *)jsq_stringByTrimingWhitespace
24 | {
25 | return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/UIColor+JSQMessages.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | @interface UIColor (JSQMessages)
22 |
23 | #pragma mark - Message bubble colors
24 |
25 | /**
26 | * @return A color object containing HSB values similar to the iOS 7 messages app green bubble color.
27 | */
28 | + (UIColor *)jsq_messageBubbleGreenColor;
29 |
30 | /**
31 | * @return A color object containing HSB values similar to the iOS 7 messages app blue bubble color.
32 | */
33 | + (UIColor *)jsq_messageBubbleBlueColor;
34 |
35 | /**
36 | * @return A color object containing HSB values similar to the iOS 7 red color.
37 | */
38 | + (UIColor *)jsq_messageBubbleRedColor;
39 |
40 | /**
41 | * @return A color object containing HSB values similar to the iOS 7 messages app light gray bubble color.
42 | */
43 | + (UIColor *)jsq_messageBubbleLightGrayColor;
44 |
45 | #pragma mark - Utilities
46 |
47 | /**
48 | * Creates and returns a new color object whose brightness component is decreased by the given value, using the initial color values of the receiver.
49 | *
50 | * @param value A floating point value describing the amount by which to decrease the brightness of the receiver.
51 | *
52 | * @return A new color object whose brightness is decreased by the given values. The other color values remain the same as the receiver.
53 | */
54 | - (UIColor *)jsq_colorByDarkeningColorWithValue:(CGFloat)value;
55 |
56 | @end
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/UIColor+JSQMessages.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "UIColor+JSQMessages.h"
20 |
21 | @implementation UIColor (JSQMessages)
22 |
23 | #pragma mark - Message bubble colors
24 |
25 | + (UIColor *)jsq_messageBubbleGreenColor
26 | {
27 | return [UIColor colorWithHue:130.0f / 360.0f
28 | saturation:0.68f
29 | brightness:0.84f
30 | alpha:1.0f];
31 | }
32 |
33 | + (UIColor *)jsq_messageBubbleBlueColor
34 | {
35 | return [UIColor colorWithHue:210.0f / 360.0f
36 | saturation:0.94f
37 | brightness:1.0f
38 | alpha:1.0f];
39 | }
40 |
41 | + (UIColor *)jsq_messageBubbleRedColor
42 | {
43 | return [UIColor colorWithHue:0.0f / 360.0f
44 | saturation:0.79f
45 | brightness:1.0f
46 | alpha:1.0f];
47 | }
48 |
49 | + (UIColor *)jsq_messageBubbleLightGrayColor
50 | {
51 | return [UIColor colorWithHue:240.0f / 360.0f
52 | saturation:0.02f
53 | brightness:0.92f
54 | alpha:1.0f];
55 | }
56 |
57 | #pragma mark - Utilities
58 |
59 | - (UIColor *)jsq_colorByDarkeningColorWithValue:(CGFloat)value
60 | {
61 | NSUInteger totalComponents = CGColorGetNumberOfComponents(self.CGColor);
62 | BOOL isGreyscale = (totalComponents == 2) ? YES : NO;
63 |
64 | CGFloat *oldComponents = (CGFloat *)CGColorGetComponents(self.CGColor);
65 | CGFloat newComponents[4];
66 |
67 | if (isGreyscale) {
68 | newComponents[0] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value;
69 | newComponents[1] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value;
70 | newComponents[2] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value;
71 | newComponents[3] = oldComponents[1];
72 | }
73 | else {
74 | newComponents[0] = oldComponents[0] - value < 0.0f ? 0.0f : oldComponents[0] - value;
75 | newComponents[1] = oldComponents[1] - value < 0.0f ? 0.0f : oldComponents[1] - value;
76 | newComponents[2] = oldComponents[2] - value < 0.0f ? 0.0f : oldComponents[2] - value;
77 | newComponents[3] = oldComponents[3];
78 | }
79 |
80 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
81 | CGColorRef newColor = CGColorCreate(colorSpace, newComponents);
82 | CGColorSpaceRelease(colorSpace);
83 |
84 | UIColor *retColor = [UIColor colorWithCGColor:newColor];
85 | CGColorRelease(newColor);
86 |
87 | return retColor;
88 | }
89 |
90 | @end
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/UIDevice+JSQMessages.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | @interface UIDevice (JSQMessages)
22 |
23 | /**
24 | * @return Whether or not the current device is running a version of iOS before 8.0.
25 | */
26 | + (BOOL)jsq_isCurrentDeviceBeforeiOS8;
27 |
28 | /**
29 | * @return Whether or not the current device is running a version of iOS after 9.0.
30 | */
31 | + (BOOL)jsq_isCurrentDeviceAfteriOS9;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/UIDevice+JSQMessages.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "UIDevice+JSQMessages.h"
20 |
21 | @implementation UIDevice (JSQMessages)
22 |
23 | + (BOOL)jsq_isCurrentDeviceBeforeiOS8
24 | {
25 | // iOS < 8.0
26 | return [[UIDevice currentDevice].systemVersion compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending;
27 | }
28 |
29 | + (BOOL)jsq_isCurrentDeviceAfteriOS9
30 | {
31 | // iOS > 9.0
32 | return [[UIDevice currentDevice].systemVersion compare:@"9.0" options:NSNumericSearch] == NSOrderedDescending;
33 | }
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/UIImage+JSQMessages.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | @interface UIImage (JSQMessages)
22 |
23 | /**
24 | * Creates and returns a new image object that is masked with the specified mask color.
25 | *
26 | * @param maskColor The color value for the mask. This value must not be `nil`.
27 | *
28 | * @return A new image object masked with the specified color.
29 | */
30 | - (UIImage *)jsq_imageMaskedWithColor:(UIColor *)maskColor;
31 |
32 | /**
33 | * @return The regular message bubble image.
34 | */
35 | + (UIImage *)jsq_bubbleRegularImage;
36 |
37 | /**
38 | * @return The regular message bubble image without a tail.
39 | */
40 | + (UIImage *)jsq_bubbleRegularTaillessImage;
41 |
42 | /**
43 | * @return The regular message bubble image stroked, not filled.
44 | */
45 | + (UIImage *)jsq_bubbleRegularStrokedImage;
46 |
47 | /**
48 | * @return The regular message bubble image stroked, not filled and without a tail.
49 | */
50 | + (UIImage *)jsq_bubbleRegularStrokedTaillessImage;
51 |
52 | /**
53 | * @return The compact message bubble image.
54 | *
55 | * @discussion This is the default bubble image used by `JSQMessagesBubbleImageFactory`.
56 | */
57 | + (UIImage *)jsq_bubbleCompactImage;
58 |
59 | /**
60 | * @return The compact message bubble image without a tail.
61 | */
62 | + (UIImage *)jsq_bubbleCompactTaillessImage;
63 |
64 | /**
65 | * @return The default input toolbar accessory image.
66 | */
67 | + (UIImage *)jsq_defaultAccessoryImage;
68 |
69 | /**
70 | * @return The default typing indicator image.
71 | */
72 | + (UIImage *)jsq_defaultTypingIndicatorImage;
73 |
74 | /**
75 | * @return The default play icon image.
76 | */
77 | + (UIImage *)jsq_defaultPlayImage;
78 |
79 | /**
80 | * @return The default pause icon image.
81 | */
82 | + (UIImage *)jsq_defaultPauseImage;
83 |
84 | @end
85 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/UIImage+JSQMessages.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "UIImage+JSQMessages.h"
20 |
21 | #import "NSBundle+JSQMessages.h"
22 |
23 |
24 | @implementation UIImage (JSQMessages)
25 |
26 | - (UIImage *)jsq_imageMaskedWithColor:(UIColor *)maskColor
27 | {
28 | NSParameterAssert(maskColor != nil);
29 |
30 | CGRect imageRect = CGRectMake(0.0f, 0.0f, self.size.width, self.size.height);
31 | UIImage *newImage = nil;
32 |
33 | UIGraphicsBeginImageContextWithOptions(imageRect.size, NO, self.scale);
34 | {
35 | CGContextRef context = UIGraphicsGetCurrentContext();
36 |
37 | CGContextScaleCTM(context, 1.0f, -1.0f);
38 | CGContextTranslateCTM(context, 0.0f, -(imageRect.size.height));
39 |
40 | CGContextClipToMask(context, imageRect, self.CGImage);
41 | CGContextSetFillColorWithColor(context, maskColor.CGColor);
42 | CGContextFillRect(context, imageRect);
43 |
44 | newImage = UIGraphicsGetImageFromCurrentImageContext();
45 | }
46 | UIGraphicsEndImageContext();
47 |
48 | return newImage;
49 | }
50 |
51 | + (UIImage *)jsq_bubbleImageFromBundleWithName:(NSString *)name
52 | {
53 | NSBundle *bundle = [NSBundle jsq_messagesAssetBundle];
54 | NSString *path = [bundle pathForResource:name ofType:@"png" inDirectory:@"Images"];
55 | return [UIImage imageWithContentsOfFile:path];
56 | }
57 |
58 | + (UIImage *)jsq_bubbleRegularImage
59 | {
60 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_regular"];
61 | }
62 |
63 | + (UIImage *)jsq_bubbleRegularTaillessImage
64 | {
65 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_tailless"];
66 | }
67 |
68 | + (UIImage *)jsq_bubbleRegularStrokedImage
69 | {
70 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_stroked"];
71 | }
72 |
73 | + (UIImage *)jsq_bubbleRegularStrokedTaillessImage
74 | {
75 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_stroked_tailless"];
76 | }
77 |
78 | + (UIImage *)jsq_bubbleCompactImage
79 | {
80 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_min"];
81 | }
82 |
83 | + (UIImage *)jsq_bubbleCompactTaillessImage
84 | {
85 | return [UIImage jsq_bubbleImageFromBundleWithName:@"bubble_min_tailless"];
86 | }
87 |
88 | + (UIImage *)jsq_defaultAccessoryImage
89 | {
90 | return [UIImage jsq_bubbleImageFromBundleWithName:@"clip"];
91 | }
92 |
93 | + (UIImage *)jsq_defaultTypingIndicatorImage
94 | {
95 | return [UIImage jsq_bubbleImageFromBundleWithName:@"typing"];
96 | }
97 |
98 | + (UIImage *)jsq_defaultPlayImage
99 | {
100 | return [UIImage jsq_bubbleImageFromBundleWithName:@"play"];
101 | }
102 |
103 | + (UIImage *)jsq_defaultPauseImage
104 | {
105 | return [UIImage jsq_bubbleImageFromBundleWithName:@"pause"];
106 | }
107 |
108 | @end
109 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/UIView+JSQMessages.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | @interface UIView (JSQMessages)
22 |
23 | /**
24 | * Pins the subview of the receiver to the edge of its frame, as specified by the given attribute, by adding a layout constraint.
25 | *
26 | * @param subview The subview to which the receiver will be pinned.
27 | * @param attribute The layout constraint attribute specifying one of `NSLayoutAttributeBottom`, `NSLayoutAttributeTop`, `NSLayoutAttributeLeading`, `NSLayoutAttributeTrailing`.
28 | */
29 | - (void)jsq_pinSubview:(UIView *)subview toEdge:(NSLayoutAttribute)attribute;
30 |
31 | /**
32 | * Pins all edges of the specified subview to the receiver.
33 | *
34 | * @param subview The subview to which the receiver will be pinned.
35 | */
36 | - (void)jsq_pinAllEdgesOfSubview:(UIView *)subview;
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/UIView+JSQMessages.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "UIView+JSQMessages.h"
20 |
21 | @implementation UIView (JSQMessages)
22 |
23 | - (void)jsq_pinSubview:(UIView *)subview toEdge:(NSLayoutAttribute)attribute
24 | {
25 | [self addConstraint:[NSLayoutConstraint constraintWithItem:self
26 | attribute:attribute
27 | relatedBy:NSLayoutRelationEqual
28 | toItem:subview
29 | attribute:attribute
30 | multiplier:1.0f
31 | constant:0.0f]];
32 | }
33 |
34 | - (void)jsq_pinAllEdgesOfSubview:(UIView *)subview
35 | {
36 | [self jsq_pinSubview:subview toEdge:NSLayoutAttributeBottom];
37 | [self jsq_pinSubview:subview toEdge:NSLayoutAttributeTop];
38 | [self jsq_pinSubview:subview toEdge:NSLayoutAttributeLeading];
39 | [self jsq_pinSubview:subview toEdge:NSLayoutAttributeTrailing];
40 | }
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Controllers/JSQMessagesViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Factories/JSQMessagesBubbleImageFactory.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | #import "JSQMessagesBubbleImage.h"
23 |
24 | /**
25 | * `JSQMessagesBubbleImageFactory` is a factory that provides a means for creating and styling
26 | * `JSQMessagesBubbleImage` objects to be displayed in a `JSQMessagesCollectionViewCell` of a `JSQMessagesCollectionView`.
27 | */
28 | @interface JSQMessagesBubbleImageFactory : NSObject
29 |
30 | /**
31 | * Creates and returns a new instance of `JSQMessagesBubbleImageFactory` that uses the
32 | * default bubble image assets and cap insets.
33 | *
34 | * @return An initialized `JSQMessagesBubbleImageFactory` object if created successfully, `nil` otherwise.
35 | */
36 | - (instancetype)init;
37 |
38 | /**
39 | * Creates and returns a new instance of `JSQMessagesBubbleImageFactory` having the specified
40 | * bubbleImage and capInsets. These values are used internally in the factory to produce
41 | * `JSQMessagesBubbleImage` objects.
42 | *
43 | * @param bubbleImage A template bubble image from which all images will be generated.
44 | * The image should represent the *outgoing* message bubble image, which will be flipped
45 | * horizontally for generating the corresponding *incoming* message bubble images. This value must not be `nil`.
46 | *
47 | * @param capInsets The values to use for the cap insets that define the unstretchable regions of the image.
48 | * Specify `UIEdgeInsetsZero` to have the factory create insets that allow the image to stretch from its center point.
49 | *
50 | * @return An initialized `JSQMessagesBubbleImageFactory` object if created successfully, `nil` otherwise.
51 | */
52 | - (instancetype)initWithBubbleImage:(UIImage *)bubbleImage capInsets:(UIEdgeInsets)capInsets;
53 |
54 | /**
55 | * Creates and returns a `JSQMessagesBubbleImage` object with the specified color for *outgoing* message image bubbles.
56 | * The `messageBubbleImage` property of the `JSQMessagesBubbleImage` is configured with a flat bubble image, masked to the given color.
57 | * The `messageBubbleHighlightedImage` property is configured similarly, but with a darkened version of the given color.
58 | *
59 | * @param color The color of the bubble image in the image view. This value must not be `nil`.
60 | *
61 | * @return An initialized `JSQMessagesBubbleImage` object if created successfully, `nil` otherwise.
62 | */
63 | - (JSQMessagesBubbleImage *)outgoingMessagesBubbleImageWithColor:(UIColor *)color;
64 |
65 | /**
66 | * Creates and returns a `JSQMessagesBubbleImage` object with the specified color for *incoming* message image bubbles.
67 | * The `messageBubbleImage` property of the `JSQMessagesBubbleImage` is configured with a flat bubble image, masked to the given color.
68 | * The `messageBubbleHighlightedImage` property is configured similarly, but with a darkened version of the given color.
69 | *
70 | * @param color The color of the bubble image in the image view. This value must not be `nil`.
71 | *
72 | * @return An initialized `JSQMessagesBubbleImage` object if created successfully, `nil` otherwise.
73 | */
74 | - (JSQMessagesBubbleImage *)incomingMessagesBubbleImageWithColor:(UIColor *)color;
75 |
76 | @end
77 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Factories/JSQMessagesBubbleImageFactory.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesBubbleImageFactory.h"
20 |
21 | #import "UIImage+JSQMessages.h"
22 | #import "UIColor+JSQMessages.h"
23 |
24 |
25 | @interface JSQMessagesBubbleImageFactory ()
26 |
27 | @property (strong, nonatomic, readonly) UIImage *bubbleImage;
28 | @property (assign, nonatomic, readonly) UIEdgeInsets capInsets;
29 |
30 | @end
31 |
32 |
33 |
34 | @implementation JSQMessagesBubbleImageFactory
35 |
36 | #pragma mark - Initialization
37 |
38 | - (instancetype)initWithBubbleImage:(UIImage *)bubbleImage capInsets:(UIEdgeInsets)capInsets
39 | {
40 | NSParameterAssert(bubbleImage != nil);
41 |
42 | self = [super init];
43 | if (self) {
44 | _bubbleImage = bubbleImage;
45 |
46 | if (UIEdgeInsetsEqualToEdgeInsets(capInsets, UIEdgeInsetsZero)) {
47 | _capInsets = [self jsq_centerPointEdgeInsetsForImageSize:bubbleImage.size];
48 | }
49 | else {
50 | _capInsets = capInsets;
51 | }
52 | }
53 | return self;
54 | }
55 |
56 | - (instancetype)init
57 | {
58 | return [self initWithBubbleImage:[UIImage jsq_bubbleCompactImage] capInsets:UIEdgeInsetsZero];
59 | }
60 |
61 | #pragma mark - Public
62 |
63 | - (JSQMessagesBubbleImage *)outgoingMessagesBubbleImageWithColor:(UIColor *)color
64 | {
65 | return [self jsq_messagesBubbleImageWithColor:color flippedForIncoming:NO];
66 | }
67 |
68 | - (JSQMessagesBubbleImage *)incomingMessagesBubbleImageWithColor:(UIColor *)color
69 | {
70 | return [self jsq_messagesBubbleImageWithColor:color flippedForIncoming:YES];
71 | }
72 |
73 | #pragma mark - Private
74 |
75 | - (UIEdgeInsets)jsq_centerPointEdgeInsetsForImageSize:(CGSize)bubbleImageSize
76 | {
77 | // make image stretchable from center point
78 | CGPoint center = CGPointMake(bubbleImageSize.width / 2.0f, bubbleImageSize.height / 2.0f);
79 | return UIEdgeInsetsMake(center.y, center.x, center.y, center.x);
80 | }
81 |
82 | - (JSQMessagesBubbleImage *)jsq_messagesBubbleImageWithColor:(UIColor *)color flippedForIncoming:(BOOL)flippedForIncoming
83 | {
84 | NSParameterAssert(color != nil);
85 |
86 | UIImage *normalBubble = [self.bubbleImage jsq_imageMaskedWithColor:color];
87 | UIImage *highlightedBubble = [self.bubbleImage jsq_imageMaskedWithColor:[color jsq_colorByDarkeningColorWithValue:0.12f]];
88 |
89 | if (flippedForIncoming) {
90 | normalBubble = [self jsq_horizontallyFlippedImageFromImage:normalBubble];
91 | highlightedBubble = [self jsq_horizontallyFlippedImageFromImage:highlightedBubble];
92 | }
93 |
94 | normalBubble = [self jsq_stretchableImageFromImage:normalBubble withCapInsets:self.capInsets];
95 | highlightedBubble = [self jsq_stretchableImageFromImage:highlightedBubble withCapInsets:self.capInsets];
96 |
97 | return [[JSQMessagesBubbleImage alloc] initWithMessageBubbleImage:normalBubble highlightedImage:highlightedBubble];
98 | }
99 |
100 | - (UIImage *)jsq_horizontallyFlippedImageFromImage:(UIImage *)image
101 | {
102 | return [UIImage imageWithCGImage:image.CGImage
103 | scale:image.scale
104 | orientation:UIImageOrientationUpMirrored];
105 | }
106 |
107 | - (UIImage *)jsq_stretchableImageFromImage:(UIImage *)image withCapInsets:(UIEdgeInsets)capInsets
108 | {
109 | return [image resizableImageWithCapInsets:capInsets resizingMode:UIImageResizingModeStretch];
110 | }
111 |
112 | @end
113 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Factories/JSQMessagesMediaViewBubbleImageMasker.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | @class JSQMessagesBubbleImageFactory;
23 |
24 | /**
25 | * An instance of `JSQMessagesMediaViewBubbleImageMasker` is an object that masks
26 | * media views for a `JSQMessageMediaData` object. Given a view, it will mask the view
27 | * with a bubble image for an outgoing or incoming media view.
28 | *
29 | * @see JSQMessageMediaData.
30 | * @see JSQMessagesBubbleImageFactory.
31 | * @see JSQMessagesBubbleImage.
32 | */
33 | @interface JSQMessagesMediaViewBubbleImageMasker : NSObject
34 |
35 | /**
36 | * Returns the bubble image factory that the masker uses to mask media views.
37 | */
38 | @property (strong, nonatomic, readonly) JSQMessagesBubbleImageFactory *bubbleImageFactory;
39 |
40 | /**
41 | * Creates and returns a new instance of `JSQMessagesMediaViewBubbleImageMasker`
42 | * that uses a default instance of `JSQMessagesBubbleImageFactory`. The masker uses the `JSQMessagesBubbleImage`
43 | * objects returned by the factory to mask media views.
44 | *
45 | * @return An initialized `JSQMessagesMediaViewBubbleImageMasker` object if created successfully, `nil` otherwise.
46 | *
47 | * @see JSQMessagesBubbleImageFactory.
48 | * @see JSQMessagesBubbleImage.
49 | */
50 | - (instancetype)init;
51 |
52 | /**
53 | * Creates and returns a new instance of `JSQMessagesMediaViewBubbleImageMasker`
54 | * having the specified bubbleImageFactory. The masker uses the `JSQMessagesBubbleImage`
55 | * objects returned by the factory to mask media views.
56 | *
57 | * @param bubbleImageFactory An initialized `JSQMessagesBubbleImageFactory` object to use for masking media views. This value must not be `nil`.
58 | *
59 | * @return An initialized `JSQMessagesMediaViewBubbleImageMasker` object if created successfully, `nil` otherwise.
60 | *
61 | * @see JSQMessagesBubbleImageFactory.
62 | * @see JSQMessagesBubbleImage.
63 | */
64 | - (instancetype)initWithBubbleImageFactory:(JSQMessagesBubbleImageFactory *)bubbleImageFactory NS_DESIGNATED_INITIALIZER;
65 |
66 | /**
67 | * Applies an outgoing bubble image mask to the specified mediaView.
68 | *
69 | * @param mediaView The media view to mask.
70 | */
71 | - (void)applyOutgoingBubbleImageMaskToMediaView:(UIView *)mediaView;
72 |
73 | /**
74 | * Applies an incoming bubble image mask to the specified mediaView.
75 | *
76 | * @param mediaView The media view to mask.
77 | */
78 | - (void)applyIncomingBubbleImageMaskToMediaView:(UIView *)mediaView;
79 |
80 | /**
81 | * A convenience method for applying a bubble image mask to the specified mediaView.
82 | * This method uses the default instance of `JSQMessagesBubbleImageFactory`.
83 | *
84 | * @param mediaView The media view to mask.
85 | * @param isOutgoing A boolean value specifiying whether or not the mask should be for an outgoing or incoming view.
86 | * Specify `YES` for outgoing and `NO` for incoming.
87 | */
88 | + (void)applyBubbleImageMaskToMediaView:(UIView *)mediaView isOutgoing:(BOOL)isOutgoing;
89 |
90 | @end
91 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Factories/JSQMessagesMediaViewBubbleImageMasker.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesMediaViewBubbleImageMasker.h"
20 |
21 | #import "JSQMessagesBubbleImageFactory.h"
22 |
23 |
24 | @implementation JSQMessagesMediaViewBubbleImageMasker
25 |
26 | #pragma mark - Initialization
27 |
28 | - (instancetype)init
29 | {
30 | return [self initWithBubbleImageFactory:[[JSQMessagesBubbleImageFactory alloc] init]];
31 | }
32 |
33 | - (instancetype)initWithBubbleImageFactory:(JSQMessagesBubbleImageFactory *)bubbleImageFactory
34 | {
35 | NSParameterAssert(bubbleImageFactory != nil);
36 |
37 | self = [super init];
38 | if (self) {
39 | _bubbleImageFactory = bubbleImageFactory;
40 | }
41 | return self;
42 | }
43 |
44 | #pragma mark - View masking
45 |
46 | - (void)applyOutgoingBubbleImageMaskToMediaView:(UIView *)mediaView
47 | {
48 | JSQMessagesBubbleImage *bubbleImageData = [self.bubbleImageFactory outgoingMessagesBubbleImageWithColor:[UIColor whiteColor]];
49 | [self jsq_maskView:mediaView withImage:[bubbleImageData messageBubbleImage]];
50 | }
51 |
52 | - (void)applyIncomingBubbleImageMaskToMediaView:(UIView *)mediaView
53 | {
54 | JSQMessagesBubbleImage *bubbleImageData = [self.bubbleImageFactory incomingMessagesBubbleImageWithColor:[UIColor whiteColor]];
55 | [self jsq_maskView:mediaView withImage:[bubbleImageData messageBubbleImage]];
56 | }
57 |
58 | + (void)applyBubbleImageMaskToMediaView:(UIView *)mediaView isOutgoing:(BOOL)isOutgoing
59 | {
60 | JSQMessagesMediaViewBubbleImageMasker *masker = [[JSQMessagesMediaViewBubbleImageMasker alloc] init];
61 |
62 | if (isOutgoing) {
63 | [masker applyOutgoingBubbleImageMaskToMediaView:mediaView];
64 | }
65 | else {
66 | [masker applyIncomingBubbleImageMaskToMediaView:mediaView];
67 | }
68 | }
69 |
70 | #pragma mark - Private
71 |
72 | - (void)jsq_maskView:(UIView *)view withImage:(UIImage *)image
73 | {
74 | NSParameterAssert(view != nil);
75 | NSParameterAssert(image != nil);
76 |
77 | UIImageView *imageViewMask = [[UIImageView alloc] initWithImage:image];
78 | imageViewMask.frame = CGRectInset(view.frame, 2.0f, 2.0f);
79 |
80 | view.layer.mask = imageViewMask.layer;
81 | }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Factories/JSQMessagesTimestampFormatter.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | /**
23 | * An instance of `JSQMessagesTimestampFormatter` is a singleton object that provides an efficient means
24 | * for creating attributed and non-attributed string representations of `NSDate` objects.
25 | * It is intended to be used as the method by which you display timestamps in a `JSQMessagesCollectionView`.
26 | */
27 | @interface JSQMessagesTimestampFormatter : NSObject
28 |
29 | /**
30 | * Returns the cached date formatter object used by the `JSQMessagesTimestampFormatter` shared instance.
31 | */
32 | @property (strong, nonatomic, readonly) NSDateFormatter *dateFormatter;
33 |
34 | /**
35 | * The text attributes to apply to the day, month, and year components of the string representation of a given date.
36 | * The default value is a dictionary containing attributes that specify centered, light gray text and the bold system font at size `12.0f`.
37 | */
38 | @property (copy, nonatomic) NSDictionary *dateTextAttributes;
39 |
40 | /**
41 | * The text attributes to apply to the minute and hour componenents of the string representation of a given date.
42 | * The default value is a dictionary containing attributes that specify centered, light gray text and the system font at size `12.0f`.
43 | */
44 | @property (copy, nonatomic) NSDictionary *timeTextAttributes;
45 |
46 | /**
47 | * Returns the shared timestamp formatter object.
48 | *
49 | * @return The shared timestamp formatter object.
50 | */
51 | + (JSQMessagesTimestampFormatter *)sharedFormatter;
52 |
53 | /**
54 | * Returns a string representation of the given date formatted in the current locale using `NSDateFormatterMediumStyle` for the date style
55 | * and `NSDateFormatterShortStyle` for the time style. It uses relative date formatting where possible.
56 | *
57 | * @param date The date to format.
58 | *
59 | * @return A formatted string representation of date.
60 | */
61 | - (NSString *)timestampForDate:(NSDate *)date;
62 |
63 | /**
64 | * Returns an attributed string representation of the given date formatted as described in `timestampForDate:`.
65 | * It applies the attributes in `dateTextAttributes` and `timeTextAttributes`, respectively.
66 | *
67 | * @param date The date to format.
68 | *
69 | * @return A formatted, attributed string representation of date.
70 | *
71 | * @see `timestampForDate:`.
72 | * @see `dateTextAttributes`.
73 | * @see `timeTextAttributes`.
74 | */
75 | - (NSAttributedString *)attributedTimestampForDate:(NSDate *)date;
76 |
77 | /**
78 | * Returns a string representation of *only* the minute and hour components of the given date formatted in the current locale styled using `NSDateFormatterShortStyle`.
79 | *
80 | * @param date The date to format.
81 | *
82 | * @return A formatted string representation of the minute and hour components of date.
83 | */
84 | - (NSString *)timeForDate:(NSDate *)date;
85 |
86 | /**
87 | * Returns a string representation of *only* the day, month, and year components of the given date formatted in the current locale styled using `NSDateFormatterMediumStyle`.
88 | *
89 | * @param date The date to format.
90 | *
91 | * @return A formatted string representation of the day, month, and year components of date.
92 | */
93 | - (NSString *)relativeDateForDate:(NSDate *)date;
94 |
95 | @end
96 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Factories/JSQMessagesToolbarButtonFactory.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | /**
23 | * `JSQMessagesToolbarButtonFactory` is a factory that provides a means for creating the default
24 | * toolbar button items to be displayed in the content view of a `JSQMessagesInputToolbar`.
25 | */
26 | @interface JSQMessagesToolbarButtonFactory : NSObject
27 |
28 | /**
29 | * Creates and returns a new button that is styled as the default accessory button.
30 | * The button has a paper clip icon image and no text.
31 | *
32 | * @return A newly created button.
33 | */
34 | + (UIButton *)defaultAccessoryButtonItem;
35 |
36 | /**
37 | * Creates and returns a new button that is styled as the default send button.
38 | * The button has title text `@"Send"` and no image.
39 | *
40 | * @return A newly created button.
41 | */
42 | + (UIButton *)defaultSendButtonItem;
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Factories/JSQMessagesToolbarButtonFactory.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesToolbarButtonFactory.h"
20 |
21 | #import "UIColor+JSQMessages.h"
22 | #import "UIImage+JSQMessages.h"
23 | #import "NSBundle+JSQMessages.h"
24 |
25 |
26 | @implementation JSQMessagesToolbarButtonFactory
27 |
28 | + (UIButton *)defaultAccessoryButtonItem
29 | {
30 | UIImage *accessoryImage = [UIImage jsq_defaultAccessoryImage];
31 | UIImage *normalImage = [accessoryImage jsq_imageMaskedWithColor:[UIColor lightGrayColor]];
32 | UIImage *highlightedImage = [accessoryImage jsq_imageMaskedWithColor:[UIColor darkGrayColor]];
33 |
34 | UIButton *accessoryButton = [[UIButton alloc] initWithFrame:CGRectMake(0.0f, 0.0f, accessoryImage.size.width, 32.0f)];
35 | [accessoryButton setImage:normalImage forState:UIControlStateNormal];
36 | [accessoryButton setImage:highlightedImage forState:UIControlStateHighlighted];
37 |
38 | accessoryButton.contentMode = UIViewContentModeScaleAspectFit;
39 | accessoryButton.backgroundColor = [UIColor clearColor];
40 | accessoryButton.tintColor = [UIColor lightGrayColor];
41 |
42 | accessoryButton.accessibilityLabel = [NSBundle jsq_localizedStringForKey:@"accessory_button_accessibility_label"];
43 |
44 | return accessoryButton;
45 | }
46 |
47 | + (UIButton *)defaultSendButtonItem
48 | {
49 | NSString *sendTitle = [NSBundle jsq_localizedStringForKey:@"send"];
50 |
51 | UIButton *sendButton = [[UIButton alloc] initWithFrame:CGRectZero];
52 | [sendButton setTitle:sendTitle forState:UIControlStateNormal];
53 | [sendButton setTitleColor:[UIColor jsq_messageBubbleBlueColor] forState:UIControlStateNormal];
54 | [sendButton setTitleColor:[[UIColor jsq_messageBubbleBlueColor] jsq_colorByDarkeningColorWithValue:0.1f] forState:UIControlStateHighlighted];
55 | [sendButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
56 |
57 | sendButton.titleLabel.font = [UIFont boldSystemFontOfSize:17.0f];
58 | sendButton.titleLabel.adjustsFontSizeToFitWidth = YES;
59 | sendButton.titleLabel.minimumScaleFactor = 0.85f;
60 | sendButton.contentMode = UIViewContentModeCenter;
61 | sendButton.backgroundColor = [UIColor clearColor];
62 | sendButton.tintColor = [UIColor jsq_messageBubbleBlueColor];
63 |
64 | CGFloat maxHeight = 32.0f;
65 |
66 | CGRect sendTitleRect = [sendTitle boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, maxHeight)
67 | options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading
68 | attributes:@{ NSFontAttributeName : sendButton.titleLabel.font }
69 | context:nil];
70 |
71 | sendButton.frame = CGRectMake(0.0f,
72 | 0.0f,
73 | CGRectGetWidth(CGRectIntegral(sendTitleRect)),
74 | maxHeight);
75 |
76 | return sendButton;
77 | }
78 |
79 | @end
80 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/JSQMessages.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #ifndef JSQMessages_JSQMessages_h
20 | #define JSQMessages_JSQMessages_h
21 |
22 | #import "JSQMessagesViewController.h"
23 |
24 | // Views
25 | #import "JSQMessagesCollectionView.h"
26 | #import "JSQMessagesCollectionViewCellIncoming.h"
27 | #import "JSQMessagesCollectionViewCellOutgoing.h"
28 | #import "JSQMessagesTypingIndicatorFooterView.h"
29 | #import "JSQMessagesLoadEarlierHeaderView.h"
30 |
31 | // Layout
32 | #import "JSQMessagesBubbleSizeCalculating.h"
33 | #import "JSQMessagesBubblesSizeCalculator.h"
34 | #import "JSQMessagesCollectionViewFlowLayout.h"
35 | #import "JSQMessagesCollectionViewLayoutAttributes.h"
36 | #import "JSQMessagesCollectionViewFlowLayoutInvalidationContext.h"
37 | #import "JSQAudioMediaViewAttributes.h"
38 |
39 | // Toolbar
40 | #import "JSQMessagesComposerTextView.h"
41 | #import "JSQMessagesInputToolbar.h"
42 | #import "JSQMessagesToolbarContentView.h"
43 |
44 | // Model
45 | #import "JSQMessage.h"
46 |
47 | #import "JSQMediaItem.h"
48 | #import "JSQAudioMediaItem.h"
49 | #import "JSQPhotoMediaItem.h"
50 | #import "JSQLocationMediaItem.h"
51 | #import "JSQVideoMediaItem.h"
52 |
53 | #import "JSQMessagesBubbleImage.h"
54 | #import "JSQMessagesAvatarImage.h"
55 |
56 | #import "JSQAudioMediaViewAttributes.h"
57 |
58 | // Protocols
59 | #import "JSQMessageData.h"
60 | #import "JSQMessageMediaData.h"
61 | #import "JSQMessageAvatarImageDataSource.h"
62 | #import "JSQMessageBubbleImageDataSource.h"
63 | #import "JSQMessagesCollectionViewDataSource.h"
64 | #import "JSQMessagesCollectionViewDelegateFlowLayout.h"
65 |
66 | // Factories
67 | #import "JSQMessagesAvatarImageFactory.h"
68 | #import "JSQMessagesBubbleImageFactory.h"
69 | #import "JSQMessagesMediaViewBubbleImageMasker.h"
70 | #import "JSQMessagesTimestampFormatter.h"
71 | #import "JSQMessagesToolbarButtonFactory.h"
72 |
73 | // Categories
74 | #import "JSQSystemSoundPlayer+JSQMessages.h"
75 | #import "NSString+JSQMessages.h"
76 | #import "UIColor+JSQMessages.h"
77 | #import "UIImage+JSQMessages.h"
78 | #import "UIView+JSQMessages.h"
79 | #import "NSBundle+JSQMessages.h"
80 |
81 | #endif
82 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Layout/JSQMessagesBubbleSizeCalculating.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | @class JSQMessagesCollectionViewFlowLayout;
23 | @protocol JSQMessageData;
24 |
25 | /**
26 | * The `JSQMessagesBubbleSizeCalculating` protocol defines the common interface through which
27 | * an object provides layout information to an instance of `JSQMessagesCollectionViewFlowLayout`.
28 | *
29 | * A concrete class that conforms to this protocol is provided in the library.
30 | * See `JSQMessagesBubbleSizeCalculator`.
31 | */
32 | @protocol JSQMessagesBubbleSizeCalculating
33 |
34 | /**
35 | * Computes and returns the size of the `messageBubbleImageView` property
36 | * of a `JSQMessagesCollectionViewCell` for the specified messageData at indexPath.
37 | *
38 | * @param messageData A message data object.
39 | * @param indexPath The index path at which messageData is located.
40 | * @param layout The layout object asking for this information.
41 | *
42 | * @return A sizes that specifies the required dimensions to display the entire message contents.
43 | * Note, this is *not* the entire cell, but only its message bubble.
44 | */
45 | - (CGSize)messageBubbleSizeForMessageData:(id)messageData
46 | atIndexPath:(NSIndexPath *)indexPath
47 | withLayout:(JSQMessagesCollectionViewFlowLayout *)layout;
48 |
49 | /**
50 | * Notifies the receiver that the layout will be reset.
51 | * Use this method to clear any cached layout information, if necessary.
52 | *
53 | * @param layout The layout object notifying the receiver.
54 | */
55 | - (void)prepareForResettingLayout:(JSQMessagesCollectionViewFlowLayout *)layout;
56 |
57 | @end
58 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Layout/JSQMessagesBubblesSizeCalculator.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | #import "JSQMessagesBubbleSizeCalculating.h"
22 |
23 | /**
24 | * An instance of `JSQMessagesBubblesSizeCalculator` is responsible for calculating
25 | * message bubble sizes for an instance of `JSQMessagesCollectionViewFlowLayout`.
26 | */
27 | @interface JSQMessagesBubblesSizeCalculator : NSObject
28 |
29 | /**
30 | * Initializes and returns a bubble size calculator with the given cache and minimumBubbleWidth.
31 | *
32 | * @param cache A cache object used to store layout information.
33 | * @param minimumBubbleWidth The minimum width for any given message bubble.
34 | * @param usesFixedWidthBubbles Specifies whether or not to use fixed-width bubbles.
35 | * If `NO` (the default), then bubbles will resize when rotating to landscape.
36 | *
37 | * @return An initialized `JSQMessagesBubblesSizeCalculator` object if successful, `nil` otherwise.
38 | */
39 | - (instancetype)initWithCache:(NSCache *)cache
40 | minimumBubbleWidth:(NSUInteger)minimumBubbleWidth
41 | usesFixedWidthBubbles:(BOOL)usesFixedWidthBubbles NS_DESIGNATED_INITIALIZER;
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Layout/JSQMessagesCollectionViewFlowLayoutInvalidationContext.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | /**
22 | * A `JSQMessagesCollectionViewFlowLayoutInvalidationContext` object specifies properties for
23 | * determining whether to recompute the size of items or their position in the layout.
24 | * The flow layout object creates instances of this class when it needs to invalidate its contents
25 | * in response to changes. You can also create instances when invalidating the flow layout manually.
26 | *
27 | */
28 | @interface JSQMessagesCollectionViewFlowLayoutInvalidationContext : UICollectionViewFlowLayoutInvalidationContext
29 |
30 | /**
31 | * A boolean indicating whether to empty the messages layout information cache for items and views in the layout.
32 | * The default value is `NO`.
33 | */
34 | @property (nonatomic, assign) BOOL invalidateFlowLayoutMessagesCache;
35 |
36 | /**
37 | * Creates and returns a new `JSQMessagesCollectionViewFlowLayoutInvalidationContext` object.
38 | *
39 | * @discussion When you need to invalidate the `JSQMessagesCollectionViewFlowLayout` object for your
40 | * `JSQMessagesViewController` subclass, you should use this method to instantiate a new invalidation
41 | * context and pass this object to `invalidateLayoutWithContext:`.
42 | *
43 | * @return An initialized invalidation context object if successful, otherwise `nil`.
44 | */
45 | + (instancetype)context;
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Layout/JSQMessagesCollectionViewFlowLayoutInvalidationContext.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesCollectionViewFlowLayoutInvalidationContext.h"
20 |
21 | @implementation JSQMessagesCollectionViewFlowLayoutInvalidationContext
22 |
23 | #pragma mark - Initialization
24 |
25 | - (instancetype)init
26 | {
27 | self = [super init];
28 | if (self) {
29 | self.invalidateFlowLayoutDelegateMetrics = NO;
30 | self.invalidateFlowLayoutAttributes = NO;
31 | _invalidateFlowLayoutMessagesCache = NO;
32 | }
33 | return self;
34 | }
35 |
36 | + (instancetype)context
37 | {
38 | JSQMessagesCollectionViewFlowLayoutInvalidationContext *context = [[JSQMessagesCollectionViewFlowLayoutInvalidationContext alloc] init];
39 | context.invalidateFlowLayoutDelegateMetrics = YES;
40 | context.invalidateFlowLayoutAttributes = YES;
41 | return context;
42 | }
43 |
44 | #pragma mark - NSObject
45 |
46 | - (NSString *)description
47 | {
48 | return [NSString stringWithFormat:@"<%@: invalidateFlowLayoutDelegateMetrics=%@, invalidateFlowLayoutAttributes=%@, invalidateDataSourceCounts=%@, invalidateFlowLayoutMessagesCache=%@>",
49 | [self class], @(self.invalidateFlowLayoutDelegateMetrics), @(self.invalidateFlowLayoutAttributes), @(self.invalidateDataSourceCounts), @(self.invalidateFlowLayoutMessagesCache)];
50 | }
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQLocationMediaItem.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | /**
23 | * A completion handler block for a `JSQLocationMediaItem`. See `setLocation: withCompletionHandler:`.
24 | */
25 | typedef void (^JSQLocationMediaItemCompletionBlock)(void);
26 |
27 |
28 | #import "JSQMediaItem.h"
29 |
30 | /**
31 | * The `JSQLocationMediaItem` class is a concrete `JSQMediaItem` subclass that implements the `JSQMessageMediaData` protocol
32 | * and represents a location media message. An initialized `JSQLocationMediaItem` object can be passed
33 | * to a `JSQMediaMessage` object during its initialization to construct a valid media message object.
34 | * You may wish to subclass `JSQLocationMediaItem` to provide additional functionality or behavior.
35 | */
36 | @interface JSQLocationMediaItem : JSQMediaItem
37 |
38 | /**
39 | * The location for the media item. The default value is `nil`.
40 | */
41 | @property (copy, nonatomic) CLLocation *location;
42 |
43 | /**
44 | * The coordinate of the location property.
45 | */
46 | @property (readonly, nonatomic) CLLocationCoordinate2D coordinate;
47 |
48 | /**
49 | * Initializes and returns a location media item object having the given location.
50 | *
51 | * @param location The location for the media item. This value may be `nil`.
52 | *
53 | * @return An initialized `JSQLocationMediaItem` if successful, `nil` otherwise.
54 | *
55 | * @discussion If the location data must be dowloaded from the network,
56 | * you may initialize a `JSQLocationMediaItem` object with a `nil` location.
57 | * Once the location data has been retrieved, you can then set the location property
58 | * using `setLocation: withCompletionHandler:`
59 | */
60 | - (instancetype)initWithLocation:(CLLocation *)location;
61 |
62 | /**
63 | * Sets the specified location for the location media item and immediately begins creating
64 | * a map view snapshot image on a background thread. The map view zooms to a default region whose center point
65 | * is the location coordinate and whose span is 500 meters for both the latitudinal and longitudinal meters.
66 | *
67 | * The specified block is executed upon completion of creating the snapshot image and is executed on the app’s main thread.
68 | *
69 | * @param location The location for the media item.
70 | * @param completion The block to call after the map view snapshot for the given location has been created.
71 | */
72 | - (void)setLocation:(CLLocation *)location withCompletionHandler:(JSQLocationMediaItemCompletionBlock)completion;
73 |
74 | /**
75 | * Sets the specified location for the location media item and immediately begins creating
76 | * a map view snapshot image on a background thread.
77 | *
78 | * The specified block is executed upon completion of creating the snapshot image and is executed on the app’s main thread.
79 | *
80 | * @param location The location for the media item.
81 | * @param region The map region that you want to capture.
82 | * @param completion The block to call after the map view snapshot for the given location has been created.
83 | */
84 | - (void)setLocation:(CLLocation *)location
85 | region:(MKCoordinateRegion)region withCompletionHandler:(JSQLocationMediaItemCompletionBlock)completion;
86 | @end
87 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQMediaItem.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessageMediaData.h"
20 |
21 | /**
22 | * The `JSQMediaItem` class is an abstract base class for media item model objects that represents
23 | * a single media attachment for a user message. It provides some default behavior for media items,
24 | * including a default mediaViewDisplaySize, a default mediaPlaceholderView, and view masking as
25 | * specified by appliesMediaViewMaskAsOutgoing.
26 | *
27 | * @warning This class is intended to be subclassed. You should not use it directly.
28 | *
29 | * @see JSQLocationMediaItem.
30 | * @see JSQPhotoMediaItem.
31 | * @see JSQVideoMediaItem.
32 | */
33 | @interface JSQMediaItem : NSObject
34 |
35 | /**
36 | * A boolean value indicating whether this media item should apply
37 | * an outgoing or incoming bubble image mask to its media views.
38 | * Specify `YES` for an outgoing mask, and `NO` for an incoming mask.
39 | * The default value is `YES`.
40 | */
41 | @property (assign, nonatomic) BOOL appliesMediaViewMaskAsOutgoing;
42 |
43 | /**
44 | * Initializes and returns a media item with the specified value for maskAsOutgoing.
45 | *
46 | * @param maskAsOutgoing A boolean value indicating whether this media item should apply
47 | * an outgoing or incoming bubble image mask to its media views.
48 | *
49 | * @return An initialized `JSQMediaItem` object if successful, `nil` otherwise.
50 | */
51 | - (instancetype)initWithMaskAsOutgoing:(BOOL)maskAsOutgoing;
52 |
53 | /**
54 | * Clears any media view or media placeholder view that the item has cached.
55 | */
56 | - (void)clearCachedMediaViews;
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQMessageAvatarImageDataSource.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | /**
23 | * The `JSQMessageAvatarImageDataSource` protocol defines the common interface through which
24 | * a `JSQMessagesViewController` and `JSQMessagesCollectionView` interact with avatar image model objects.
25 | *
26 | * It declares the required and optional methods that a class must implement so that instances
27 | * of that class can be display properly within a `JSQMessagesCollectionViewCell`.
28 | *
29 | * A concrete class that conforms to this protocol is provided in the library. See `JSQMessagesAvatarImage`.
30 | *
31 | * @see JSQMessagesAvatarImage.
32 | */
33 | @protocol JSQMessageAvatarImageDataSource
34 |
35 | @required
36 |
37 | /**
38 | * @return The avatar image for a regular display state.
39 | *
40 | * @discussion You may return `nil` from this method while the image is being downloaded.
41 | */
42 | - (UIImage *)avatarImage;
43 |
44 | /**
45 | * @return The avatar image for a highlighted display state.
46 | *
47 | * @discussion You may return `nil` from this method if this does not apply.
48 | */
49 | - (UIImage *)avatarHighlightedImage;
50 |
51 | /**
52 | * @return A placeholder avatar image to be displayed if avatarImage is not yet available, or `nil`.
53 | * For example, if avatarImage needs to be downloaded, this placeholder image
54 | * will be used until avatarImage is not `nil`.
55 | *
56 | * @discussion If you do not need support for a placeholder image, that is, your images
57 | * are stored locally on the device, then you may simply return the same value as avatarImage here.
58 | *
59 | * @warning You must not return `nil` from this method.
60 | */
61 | - (UIImage *)avatarPlaceholderImage;
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQMessageBubbleImageDataSource.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | /**
23 | * The `JSQMessageBubbleImageDataSource` protocol defines the common interface through which
24 | * a `JSQMessagesViewController` and `JSQMessagesCollectionView` interact with
25 | * message bubble image model objects.
26 | *
27 | * It declares the required and optional methods that a class must implement so that instances
28 | * of that class can be display properly within a `JSQMessagesCollectionViewCell`.
29 | *
30 | * A concrete class that conforms to this protocol is provided in the library. See `JSQMessagesBubbleImage`.
31 | *
32 | * @see JSQMessagesBubbleImage.
33 | */
34 | @protocol JSQMessageBubbleImageDataSource
35 |
36 | @required
37 |
38 | /**
39 | * @return The message bubble image for a regular display state.
40 | *
41 | * @warning You must not return `nil` from this method.
42 | */
43 | - (UIImage *)messageBubbleImage;
44 |
45 | /**
46 | * @return The message bubble image for a highlighted display state.
47 | *
48 | * @warning You must not return `nil` from this method.
49 | */
50 | - (UIImage *)messageBubbleHighlightedImage;
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQMessageData.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | #import "JSQMessageMediaData.h"
22 |
23 | /**
24 | * The `JSQMessageData` protocol defines the common interface through which
25 | * a `JSQMessagesViewController` and `JSQMessagesCollectionView` interact with message model objects.
26 | *
27 | * It declares the required and optional methods that a class must implement so that instances of that class
28 | * can be displayed properly within a `JSQMessagesCollectionViewCell`.
29 | *
30 | * The class that conforms to this protocol is provided in the library. See `JSQMessage`.
31 | *
32 | * @see JSQMessage.
33 | */
34 | @protocol JSQMessageData
35 |
36 | @required
37 |
38 | /**
39 | * @return A string identifier that uniquely identifies the user who sent the message.
40 | *
41 | * @discussion If you need to generate a unique identifier, consider using
42 | * `[[NSProcessInfo processInfo] globallyUniqueString]`
43 | *
44 | * @warning You must not return `nil` from this method. This value must be unique.
45 | */
46 | - (NSString *)senderId;
47 |
48 | /**
49 | * @return The display name for the user who sent the message.
50 | *
51 | * @warning You must not return `nil` from this method.
52 | */
53 | - (NSString *)senderDisplayName;
54 |
55 | /**
56 | * @return The date that the message was sent.
57 | *
58 | * @warning You must not return `nil` from this method.
59 | */
60 | - (NSDate *)date;
61 |
62 | /**
63 | * This method is used to determine if the message data item contains text or media.
64 | * If this method returns `YES`, an instance of `JSQMessagesViewController` will ignore
65 | * the `text` method of this protocol when dequeuing a `JSQMessagesCollectionViewCell`
66 | * and only call the `media` method.
67 | *
68 | * Similarly, if this method returns `NO` then the `media` method will be ignored and
69 | * and only the `text` method will be called.
70 | *
71 | * @return A boolean value specifying whether or not this is a media message or a text message.
72 | * Return `YES` if this item is a media message, and `NO` if it is a text message.
73 | */
74 | - (BOOL)isMediaMessage;
75 |
76 | /**
77 | * @return An integer that can be used as a table address in a hash table structure.
78 | *
79 | * @discussion This value must be unique for each message with distinct contents.
80 | * This value is used to cache layout information in the collection view.
81 | */
82 | - (NSUInteger)messageHash;
83 |
84 | @optional
85 |
86 | /**
87 | * @return The body text of the message.
88 | *
89 | * @warning You must not return `nil` from this method.
90 | */
91 | - (NSString *)text;
92 |
93 | /**
94 | * @return The media item of the message.
95 | *
96 | * @warning You must not return `nil` from this method.
97 | */
98 | - (id)media;
99 |
100 | @end
101 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQMessageMediaData.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | /**
23 | * The `JSQMessageMediaData` protocol defines the common interface through which
24 | * a `JSQMessagesViewController` and `JSQMessagesCollectionView` interact with media message model objects.
25 | *
26 | * It declares the required and optional methods that a class must implement so that instances of that class
27 | * can be displayed properly within a `JSQMessagesCollectionViewCell`.
28 | *
29 | * This library provides a few concrete classes that conform to this protocol. You may use them as-is,
30 | * but they will likely require some modifications or extensions to conform to your particular data models.
31 | * These concrete media items are: `JSQPhotoMediaItem`, `JSQLocationMediaItem`, `JSQVideoMediaItem`.
32 | *
33 | * @see JSQPhotoMediaItem.
34 | * @see JSQLocationMediaItem.
35 | * @see JSQVideoMediaItem.
36 | */
37 | @protocol JSQMessageMediaData
38 |
39 | @required
40 |
41 | /**
42 | * @return An initialized `UIView` object that represents the data for this media object.
43 | *
44 | * @discussion You may return `nil` from this method while the media data is being downloaded.
45 | */
46 | - (UIView *)mediaView;
47 |
48 | /**
49 | * @return The frame size for the mediaView when displayed in a `JSQMessagesCollectionViewCell`.
50 | *
51 | * @discussion You should return an appropriate size value to be set for the mediaView's frame
52 | * based on the contents of the view, and the frame and layout of the `JSQMessagesCollectionViewCell`
53 | * in which mediaView will be displayed.
54 | *
55 | * @warning You must return a size with non-zero, positive width and height values.
56 | */
57 | - (CGSize)mediaViewDisplaySize;
58 |
59 | /**
60 | * @return A placeholder media view to be displayed if mediaView is not yet available, or `nil`.
61 | * For example, if mediaView will be constructed based on media data that must be downloaded,
62 | * this placeholder view will be used until mediaView is not `nil`.
63 | *
64 | * @discussion If you do not need support for a placeholder view, then you may simply return the
65 | * same value here as mediaView. Otherwise, consider using `JSQMessagesMediaPlaceholderView`.
66 | *
67 | * @warning You must not return `nil` from this method.
68 | *
69 | * @see JSQMessagesMediaPlaceholderView.
70 | */
71 | - (UIView *)mediaPlaceholderView;
72 |
73 | /**
74 | * @return An integer that can be used as a table address in a hash table structure.
75 | *
76 | * @discussion This value must be unique for each media item with distinct contents.
77 | * This value is used to cache layout information in the collection view.
78 | */
79 | - (NSUInteger)mediaHash;
80 |
81 | @end
82 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQMessagesAvatarImage.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | #import "JSQMessageAvatarImageDataSource.h"
23 |
24 | /**
25 | * A `JSQMessagesAvatarImage` model object represents an avatar image.
26 | * This is a concrete class that implements the `JSQMessageAvatarImageDataSource` protocol.
27 | * It contains a regular avatar image, a highlighted avatar image, and a placeholder avatar image.
28 | *
29 | * @see JSQMessagesAvatarImageFactory.
30 | */
31 | @interface JSQMessagesAvatarImage : NSObject
32 |
33 | /**
34 | * The avatar image for a regular display state.
35 | */
36 | @property (nonatomic, strong) UIImage *avatarImage;
37 |
38 | /**
39 | * The avatar image for a highlighted display state.
40 | */
41 | @property (nonatomic, strong) UIImage *avatarHighlightedImage;
42 |
43 | /**
44 | * Returns the placeholder image for an avatar to display if avatarImage is `nil`.
45 | */
46 | @property (nonatomic, strong, readonly) UIImage *avatarPlaceholderImage;
47 |
48 | /**
49 | * Initializes and returns an avatar image object having the specified image.
50 | *
51 | * @param image The image for this avatar image. This image will be used for the all of the following
52 | * properties: avatarImage, avatarHighlightedImage, avatarPlaceholderImage;
53 | * This value must not be `nil`.
54 | *
55 | * @return An initialized `JSQMessagesAvatarImage` object if successful, `nil` otherwise.
56 | */
57 | + (instancetype)avatarWithImage:(UIImage *)image;
58 |
59 | /**
60 | * Initializes and returns an avatar image object having the specified placeholder image.
61 | *
62 | * @param placeholderImage The placeholder image for this avatar image. This value must not be `nil`.
63 | *
64 | * @return An initialized `JSQMessagesAvatarImage` object if successful, `nil` otherwise.
65 | */
66 | + (instancetype)avatarImageWithPlaceholder:(UIImage *)placeholderImage;
67 |
68 | /**
69 | * Initializes and returns an avatar image object having the specified regular, highlighed, and placeholder images.
70 | *
71 | * @param avatarImage The avatar image for a regular display state.
72 | * @param highlightedImage The avatar image for a highlighted display state.
73 | * @param placeholderImage The placeholder image for this avatar image. This value must not be `nil`.
74 | *
75 | * @return An initialized `JSQMessagesAvatarImage` object if successful, `nil` otherwise.
76 | */
77 | - (instancetype)initWithAvatarImage:(UIImage *)avatarImage
78 | highlightedImage:(UIImage *)highlightedImage
79 | placeholderImage:(UIImage *)placeholderImage NS_DESIGNATED_INITIALIZER;
80 |
81 | /**
82 | * Not a valid initializer.
83 | */
84 | - (id)init NS_UNAVAILABLE;
85 |
86 | @end
87 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQMessagesAvatarImage.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesAvatarImage.h"
20 |
21 | @implementation JSQMessagesAvatarImage
22 |
23 | #pragma mark - Initialization
24 |
25 | + (instancetype)avatarWithImage:(UIImage *)image
26 | {
27 | NSParameterAssert(image != nil);
28 |
29 | return [[JSQMessagesAvatarImage alloc] initWithAvatarImage:image
30 | highlightedImage:image
31 | placeholderImage:image];
32 | }
33 |
34 | + (instancetype)avatarImageWithPlaceholder:(UIImage *)placeholderImage
35 | {
36 | return [[JSQMessagesAvatarImage alloc] initWithAvatarImage:nil
37 | highlightedImage:nil
38 | placeholderImage:placeholderImage];
39 | }
40 |
41 | - (instancetype)initWithAvatarImage:(UIImage *)avatarImage
42 | highlightedImage:(UIImage *)highlightedImage
43 | placeholderImage:(UIImage *)placeholderImage
44 | {
45 | NSParameterAssert(placeholderImage != nil);
46 |
47 | self = [super init];
48 | if (self) {
49 | _avatarImage = avatarImage;
50 | _avatarHighlightedImage = highlightedImage;
51 | _avatarPlaceholderImage = placeholderImage;
52 | }
53 | return self;
54 | }
55 |
56 | #pragma mark - NSObject
57 |
58 | - (NSString *)description
59 | {
60 | return [NSString stringWithFormat:@"<%@: avatarImage=%@, avatarHighlightedImage=%@, avatarPlaceholderImage=%@>",
61 | [self class], self.avatarImage, self.avatarHighlightedImage, self.avatarPlaceholderImage];
62 | }
63 |
64 | - (id)debugQuickLookObject
65 | {
66 | return [[UIImageView alloc] initWithImage:self.avatarImage ?: self.avatarPlaceholderImage];
67 | }
68 |
69 | #pragma mark - NSCopying
70 |
71 | - (instancetype)copyWithZone:(NSZone *)zone
72 | {
73 | return [[[self class] allocWithZone:zone] initWithAvatarImage:[UIImage imageWithCGImage:self.avatarImage.CGImage]
74 | highlightedImage:[UIImage imageWithCGImage:self.avatarHighlightedImage.CGImage]
75 | placeholderImage:[UIImage imageWithCGImage:self.avatarPlaceholderImage.CGImage]];
76 | }
77 |
78 | @end
79 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQMessagesBubbleImage.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | #import "JSQMessageBubbleImageDataSource.h"
23 |
24 | /**
25 | * A `JSQMessagesBubbleImage` model object represents a message bubble image, and is immutable.
26 | * This is a concrete class that implements the `JSQMessageBubbleImageDataSource` protocol.
27 | * It contains a regular message bubble image and a highlighted message bubble image.
28 | *
29 | * @see JSQMessagesBubbleImageFactory.
30 | */
31 | @interface JSQMessagesBubbleImage : NSObject
32 |
33 | /**
34 | * Returns the message bubble image for a regular display state.
35 | */
36 | @property (strong, nonatomic, readonly) UIImage *messageBubbleImage;
37 |
38 | /**
39 | * Returns the message bubble image for a highlighted display state.
40 | */
41 | @property (strong, nonatomic, readonly) UIImage *messageBubbleHighlightedImage;
42 |
43 | /**
44 | * Initializes and returns a message bubble image object having the specified regular image and highlighted image.
45 | *
46 | * @param image The regular message bubble image. This value must not be `nil`.
47 | * @param highlightedImage The highlighted message bubble image. This value must not be `nil`.
48 | *
49 | * @return An initialized `JSQMessagesBubbleImage` object if successful, `nil` otherwise.
50 | *
51 | * @see JSQMessagesBubbleImageFactory.
52 | */
53 | - (instancetype)initWithMessageBubbleImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage NS_DESIGNATED_INITIALIZER;
54 |
55 | /**
56 | * Not a valid initializer.
57 | */
58 | - (id)init NS_UNAVAILABLE;
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQMessagesBubbleImage.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesBubbleImage.h"
20 |
21 | @implementation JSQMessagesBubbleImage
22 |
23 | #pragma mark - Initialization
24 |
25 | - (instancetype)initWithMessageBubbleImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage
26 | {
27 | NSParameterAssert(image != nil);
28 | NSParameterAssert(highlightedImage != nil);
29 |
30 | self = [super init];
31 | if (self) {
32 | _messageBubbleImage = image;
33 | _messageBubbleHighlightedImage = highlightedImage;
34 | }
35 | return self;
36 | }
37 |
38 | #pragma mark - NSObject
39 |
40 | - (NSString *)description
41 | {
42 | return [NSString stringWithFormat:@"<%@: messageBubbleImage=%@, messageBubbleHighlightedImage=%@>",
43 | [self class], self.messageBubbleImage, self.messageBubbleHighlightedImage];
44 | }
45 |
46 | - (id)debugQuickLookObject
47 | {
48 | return [[UIImageView alloc] initWithImage:self.messageBubbleImage highlightedImage:self.messageBubbleHighlightedImage];
49 | }
50 |
51 | #pragma mark - NSCopying
52 |
53 | - (instancetype)copyWithZone:(NSZone *)zone
54 | {
55 | return [[[self class] allocWithZone:zone] initWithMessageBubbleImage:[UIImage imageWithCGImage:self.messageBubbleImage.CGImage]
56 | highlightedImage:[UIImage imageWithCGImage:self.messageBubbleHighlightedImage.CGImage]];
57 | }
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQPhotoMediaItem.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMediaItem.h"
20 |
21 | /**
22 | * The `JSQPhotoMediaItem` class is a concrete `JSQMediaItem` subclass that implements the `JSQMessageMediaData` protocol
23 | * and represents a photo media message. An initialized `JSQPhotoMediaItem` object can be passed
24 | * to a `JSQMediaMessage` object during its initialization to construct a valid media message object.
25 | * You may wish to subclass `JSQPhotoMediaItem` to provide additional functionality or behavior.
26 | */
27 | @interface JSQPhotoMediaItem : JSQMediaItem
28 |
29 | /**
30 | * The image for the photo media item. The default value is `nil`.
31 | */
32 | @property (copy, nonatomic) UIImage *image;
33 |
34 | /**
35 | * Initializes and returns a photo media item object having the given image.
36 | *
37 | * @param image The image for the photo media item. This value may be `nil`.
38 | *
39 | * @return An initialized `JSQPhotoMediaItem` if successful, `nil` otherwise.
40 | *
41 | * @discussion If the image must be dowloaded from the network,
42 | * you may initialize a `JSQPhotoMediaItem` object with a `nil` image.
43 | * Once the image has been retrieved, you can then set the image property.
44 | */
45 | - (instancetype)initWithImage:(UIImage *)image;
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQPhotoMediaItem.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQPhotoMediaItem.h"
20 |
21 | #import "JSQMessagesMediaPlaceholderView.h"
22 | #import "JSQMessagesMediaViewBubbleImageMasker.h"
23 |
24 |
25 | @interface JSQPhotoMediaItem ()
26 |
27 | @property (strong, nonatomic) UIImageView *cachedImageView;
28 |
29 | @end
30 |
31 |
32 | @implementation JSQPhotoMediaItem
33 |
34 | #pragma mark - Initialization
35 |
36 | - (instancetype)initWithImage:(UIImage *)image
37 | {
38 | self = [super init];
39 | if (self) {
40 | _image = [image copy];
41 | _cachedImageView = nil;
42 | }
43 | return self;
44 | }
45 |
46 | - (void)clearCachedMediaViews
47 | {
48 | [super clearCachedMediaViews];
49 | _cachedImageView = nil;
50 | }
51 |
52 | #pragma mark - Setters
53 |
54 | - (void)setImage:(UIImage *)image
55 | {
56 | _image = [image copy];
57 | _cachedImageView = nil;
58 | }
59 |
60 | - (void)setAppliesMediaViewMaskAsOutgoing:(BOOL)appliesMediaViewMaskAsOutgoing
61 | {
62 | [super setAppliesMediaViewMaskAsOutgoing:appliesMediaViewMaskAsOutgoing];
63 | _cachedImageView = nil;
64 | }
65 |
66 | #pragma mark - JSQMessageMediaData protocol
67 |
68 | - (UIView *)mediaView
69 | {
70 | if (self.image == nil) {
71 | return nil;
72 | }
73 |
74 | if (self.cachedImageView == nil) {
75 | CGSize size = [self mediaViewDisplaySize];
76 | UIImageView *imageView = [[UIImageView alloc] initWithImage:self.image];
77 | imageView.frame = CGRectMake(0.0f, 0.0f, size.width, size.height);
78 | imageView.contentMode = UIViewContentModeScaleAspectFill;
79 | imageView.clipsToBounds = YES;
80 | [JSQMessagesMediaViewBubbleImageMasker applyBubbleImageMaskToMediaView:imageView isOutgoing:self.appliesMediaViewMaskAsOutgoing];
81 | self.cachedImageView = imageView;
82 | }
83 |
84 | return self.cachedImageView;
85 | }
86 |
87 | - (NSUInteger)mediaHash
88 | {
89 | return self.hash;
90 | }
91 |
92 | #pragma mark - NSObject
93 |
94 | - (NSUInteger)hash
95 | {
96 | return super.hash ^ self.image.hash;
97 | }
98 |
99 | - (NSString *)description
100 | {
101 | return [NSString stringWithFormat:@"<%@: image=%@, appliesMediaViewMaskAsOutgoing=%@>",
102 | [self class], self.image, @(self.appliesMediaViewMaskAsOutgoing)];
103 | }
104 |
105 | #pragma mark - NSCoding
106 |
107 | - (instancetype)initWithCoder:(NSCoder *)aDecoder
108 | {
109 | self = [super initWithCoder:aDecoder];
110 | if (self) {
111 | _image = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(image))];
112 | }
113 | return self;
114 | }
115 |
116 | - (void)encodeWithCoder:(NSCoder *)aCoder
117 | {
118 | [super encodeWithCoder:aCoder];
119 | [aCoder encodeObject:self.image forKey:NSStringFromSelector(@selector(image))];
120 | }
121 |
122 | #pragma mark - NSCopying
123 |
124 | - (instancetype)copyWithZone:(NSZone *)zone
125 | {
126 | JSQPhotoMediaItem *copy = [[JSQPhotoMediaItem allocWithZone:zone] initWithImage:self.image];
127 | copy.appliesMediaViewMaskAsOutgoing = self.appliesMediaViewMaskAsOutgoing;
128 | return copy;
129 | }
130 |
131 | @end
132 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Model/JSQVideoMediaItem.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMediaItem.h"
20 |
21 | /**
22 | * The `JSQVideoMediaItem` class is a concrete `JSQMediaItem` subclass that implements the `JSQMessageMediaData` protocol
23 | * and represents a video media message. An initialized `JSQVideoMediaItem` object can be passed
24 | * to a `JSQMediaMessage` object during its initialization to construct a valid media message object.
25 | * You may wish to subclass `JSQVideoMediaItem` to provide additional functionality or behavior.
26 | */
27 | @interface JSQVideoMediaItem : JSQMediaItem
28 |
29 | /**
30 | * The URL that identifies a video resource.
31 | */
32 | @property (nonatomic, strong) NSURL *fileURL;
33 |
34 | /**
35 | * A boolean value that specifies whether or not the video is ready to be played.
36 | *
37 | * @discussion When set to `YES`, the video is ready. When set to `NO` it is not ready.
38 | */
39 | @property (nonatomic, assign) BOOL isReadyToPlay;
40 |
41 | /**
42 | * Initializes and returns a video media item having the given fileURL.
43 | *
44 | * @param fileURL The URL that identifies the video resource.
45 | * @param isReadyToPlay A boolean value that specifies if the video is ready to play.
46 | *
47 | * @return An initialized `JSQVideoMediaItem` if successful, `nil` otherwise.
48 | *
49 | * @discussion If the video must be downloaded from the network,
50 | * you may initialize a `JSQVideoMediaItem` with a `nil` fileURL or specify `NO` for
51 | * isReadyToPlay. Once the video has been saved to disk, or is ready to stream, you can
52 | * set the fileURL property or isReadyToPlay property, respectively.
53 | */
54 | - (instancetype)initWithFileURL:(NSURL *)fileURL isReadyToPlay:(BOOL)isReadyToPlay;
55 |
56 | @end
57 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesCellTextView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | /**
22 | * `JSQMessagesCellTextView` is a subclass of `UITextView` that is used to display text
23 | * in a `JSQMessagesCollectionViewCell`.
24 | */
25 | @interface JSQMessagesCellTextView : UITextView
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesCellTextView.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesCellTextView.h"
20 |
21 | @implementation JSQMessagesCellTextView
22 |
23 | - (void)awakeFromNib
24 | {
25 | [super awakeFromNib];
26 |
27 | self.textColor = [UIColor whiteColor];
28 | self.editable = NO;
29 | self.selectable = YES;
30 | self.userInteractionEnabled = YES;
31 | self.dataDetectorTypes = UIDataDetectorTypeNone;
32 | self.showsHorizontalScrollIndicator = NO;
33 | self.showsVerticalScrollIndicator = NO;
34 | self.scrollEnabled = NO;
35 | self.backgroundColor = [UIColor clearColor];
36 | self.contentInset = UIEdgeInsetsZero;
37 | self.scrollIndicatorInsets = UIEdgeInsetsZero;
38 | self.contentOffset = CGPointZero;
39 | self.textContainerInset = UIEdgeInsetsZero;
40 | self.textContainer.lineFragmentPadding = 0;
41 | self.linkTextAttributes = @{ NSForegroundColorAttributeName : [UIColor whiteColor],
42 | NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle | NSUnderlinePatternSolid) };
43 | }
44 |
45 | - (void)setSelectedRange:(NSRange)selectedRange
46 | {
47 | // attempt to prevent selecting text
48 | [super setSelectedRange:NSMakeRange(NSNotFound, 0)];
49 | }
50 |
51 | - (NSRange)selectedRange
52 | {
53 | // attempt to prevent selecting text
54 | return NSMakeRange(NSNotFound, NSNotFound);
55 | }
56 |
57 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
58 | {
59 | // ignore double-tap to prevent copy/define/etc. menu from showing
60 | if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) {
61 | UITapGestureRecognizer *tap = (UITapGestureRecognizer *)gestureRecognizer;
62 | if (tap.numberOfTapsRequired == 2) {
63 | return NO;
64 | }
65 | }
66 |
67 | return YES;
68 | }
69 |
70 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
71 | {
72 | // ignore double-tap to prevent copy/define/etc. menu from showing
73 | if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) {
74 | UITapGestureRecognizer *tap = (UITapGestureRecognizer *)gestureRecognizer;
75 | if (tap.numberOfTapsRequired == 2) {
76 | return NO;
77 | }
78 | }
79 |
80 | return YES;
81 | }
82 |
83 | @end
84 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesCollectionViewCellIncoming.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesCollectionViewCell.h"
20 |
21 | /**
22 | * A `JSQMessagesCollectionViewCellIncoming` object is a concrete instance
23 | * of `JSQMessagesCollectionViewCell` that represents an incoming message data item.
24 | */
25 | @interface JSQMessagesCollectionViewCellIncoming : JSQMessagesCollectionViewCell
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesCollectionViewCellIncoming.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesCollectionViewCellIncoming.h"
20 |
21 | @implementation JSQMessagesCollectionViewCellIncoming
22 |
23 | #pragma mark - Overrides
24 |
25 | - (void)awakeFromNib
26 | {
27 | [super awakeFromNib];
28 | self.messageBubbleTopLabel.textAlignment = NSTextAlignmentLeft;
29 | self.cellBottomLabel.textAlignment = NSTextAlignmentLeft;
30 | }
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesCollectionViewCellOutgoing.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesCollectionViewCell.h"
20 |
21 | /**
22 | * A `JSQMessagesCollectionViewCellOutgoing` object is a concrete instance
23 | * of `JSQMessagesCollectionViewCell` that represents an outgoing message data item.
24 | */
25 | @interface JSQMessagesCollectionViewCellOutgoing : JSQMessagesCollectionViewCell
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesCollectionViewCellOutgoing.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesCollectionViewCellOutgoing.h"
20 |
21 | @implementation JSQMessagesCollectionViewCellOutgoing
22 |
23 | #pragma mark - Overrides
24 |
25 | - (void)awakeFromNib
26 | {
27 | [super awakeFromNib];
28 | self.messageBubbleTopLabel.textAlignment = NSTextAlignmentRight;
29 | self.cellBottomLabel.textAlignment = NSTextAlignmentRight;
30 | }
31 |
32 | @end
33 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesComposerTextView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | @class JSQMessagesComposerTextView;
22 |
23 | /**
24 | * A delegate object used to notify the receiver of paste events from a `JSQMessagesComposerTextView`.
25 | */
26 | @protocol JSQMessagesComposerTextViewPasteDelegate
27 |
28 | /**
29 | * Asks the delegate whether or not the `textView` should use the original implementation of `-[UITextView paste]`.
30 | *
31 | * @discussion Use this delegate method to implement custom pasting behavior.
32 | * You should return `NO` when you want to handle pasting.
33 | * Return `YES` to defer functionality to the `textView`.
34 | */
35 | - (BOOL)composerTextView:(JSQMessagesComposerTextView *)textView shouldPasteWithSender:(id)sender;
36 |
37 | @end
38 |
39 | /**
40 | * An instance of `JSQMessagesComposerTextView` is a subclass of `UITextView` that is styled and used
41 | * for composing messages in a `JSQMessagesViewController`. It is a subview of a `JSQMessagesToolbarContentView`.
42 | */
43 | @interface JSQMessagesComposerTextView : UITextView
44 |
45 | /**
46 | * The text to be displayed when the text view is empty. The default value is `nil`.
47 | */
48 | @property (copy, nonatomic) NSString *placeHolder;
49 |
50 | /**
51 | * The color of the place holder text. The default value is `[UIColor lightGrayColor]`.
52 | */
53 | @property (strong, nonatomic) UIColor *placeHolderTextColor;
54 |
55 | /**
56 | * The object that acts as the paste delegate of the text view.
57 | */
58 | @property (weak, nonatomic) id pasteDelegate;
59 |
60 | /**
61 | * Determines whether or not the text view contains text after trimming white space
62 | * from the front and back of its string.
63 | *
64 | * @return `YES` if the text view contains text, `NO` otherwise.
65 | */
66 | - (BOOL)hasText;
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesLabel.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | /**
22 | * `JSQMessagesLabel` is a subclass of `UILabel` that adds support for a `textInsets` property,
23 | * which is similar to the `textContainerInset` property of `UITextView`.
24 | */
25 | @interface JSQMessagesLabel : UILabel
26 |
27 | /**
28 | * The inset of the text layout area within the label's content area. The default value is `UIEdgeInsetsZero`.
29 | *
30 | * @discussion This property provides text margins for the text laid out in the label.
31 | * The inset values provided must be greater than or equal to `0.0f`.
32 | */
33 | @property (assign, nonatomic) UIEdgeInsets textInsets;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesLabel.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import "JSQMessagesLabel.h"
20 |
21 | @implementation JSQMessagesLabel
22 |
23 | #pragma mark - Initialization
24 |
25 | - (void)jsq_configureLabel
26 | {
27 | [self setTranslatesAutoresizingMaskIntoConstraints:NO];
28 | self.textInsets = UIEdgeInsetsZero;
29 | }
30 |
31 | - (instancetype)initWithFrame:(CGRect)frame
32 | {
33 | self = [super initWithFrame:frame];
34 | if (self) {
35 | [self jsq_configureLabel];
36 | }
37 | return self;
38 | }
39 |
40 | - (void)awakeFromNib
41 | {
42 | [super awakeFromNib];
43 | [self jsq_configureLabel];
44 | }
45 |
46 | #pragma mark - Setters
47 |
48 | - (void)setTextInsets:(UIEdgeInsets)textInsets
49 | {
50 | if (UIEdgeInsetsEqualToEdgeInsets(_textInsets, textInsets)) {
51 | return;
52 | }
53 |
54 | _textInsets = textInsets;
55 | [self setNeedsDisplay];
56 | }
57 |
58 | #pragma mark - Drawing
59 |
60 | - (void)drawTextInRect:(CGRect)rect
61 | {
62 | [super drawTextInRect:CGRectMake(CGRectGetMinX(rect) + self.textInsets.left,
63 | CGRectGetMinY(rect) + self.textInsets.top,
64 | CGRectGetWidth(rect) - self.textInsets.right,
65 | CGRectGetHeight(rect) - self.textInsets.bottom)];
66 | }
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesLoadEarlierHeaderView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 |
21 | @class JSQMessagesLoadEarlierHeaderView;
22 |
23 | /**
24 | * A constant defining the default height of a `JSQMessagesLoadEarlierHeaderView`.
25 | */
26 | FOUNDATION_EXPORT const CGFloat kJSQMessagesLoadEarlierHeaderViewHeight;
27 |
28 | /**
29 | * The `JSQMessagesLoadEarlierHeaderViewDelegate` defines methods that allow you to
30 | * respond to interactions within the header view.
31 | */
32 | @protocol JSQMessagesLoadEarlierHeaderViewDelegate
33 |
34 | @required
35 |
36 | /**
37 | * Tells the delegate that the loadButton has received a touch event.
38 | *
39 | * @param headerView The header view that contains the sender.
40 | * @param sender The button that received the touch.
41 | */
42 | - (void)headerView:(JSQMessagesLoadEarlierHeaderView *)headerView didPressLoadButton:(UIButton *)sender;
43 |
44 | @end
45 |
46 |
47 | /**
48 | * The `JSQMessagesLoadEarlierHeaderView` class implements a reusable view that can be placed
49 | * at the top of a `JSQMessagesCollectionView`. This view contains a "load earlier messages" button
50 | * and can be used as a way for the user to load previously sent messages.
51 | */
52 | @interface JSQMessagesLoadEarlierHeaderView : UICollectionReusableView
53 |
54 | /**
55 | * The object that acts as the delegate of the header view.
56 | */
57 | @property (weak, nonatomic) id delegate;
58 |
59 | /**
60 | * Returns the load button of the header view.
61 | */
62 | @property (weak, nonatomic, readonly) UIButton *loadButton;
63 |
64 | #pragma mark - Class methods
65 |
66 | /**
67 | * Returns the `UINib` object initialized for the collection reusable view.
68 | *
69 | * @return The initialized `UINib` object or `nil` if there were errors during
70 | * initialization or the nib file could not be located.
71 | */
72 | + (UINib *)nib;
73 |
74 | /**
75 | * Returns the default string used to identify the reusable header view.
76 | *
77 | * @return The string used to identify the reusable header view.
78 | */
79 | + (NSString *)headerReuseIdentifier;
80 |
81 | @end
82 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesLoadEarlierHeaderView.m:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 |
20 | #import "JSQMessagesLoadEarlierHeaderView.h"
21 |
22 | #import "NSBundle+JSQMessages.h"
23 |
24 |
25 | const CGFloat kJSQMessagesLoadEarlierHeaderViewHeight = 32.0f;
26 |
27 |
28 | @interface JSQMessagesLoadEarlierHeaderView ()
29 |
30 | @property (weak, nonatomic) IBOutlet UIButton *loadButton;
31 |
32 | @end
33 |
34 |
35 |
36 | @implementation JSQMessagesLoadEarlierHeaderView
37 |
38 | #pragma mark - Class methods
39 |
40 | + (UINib *)nib
41 | {
42 | return [UINib nibWithNibName:NSStringFromClass([JSQMessagesLoadEarlierHeaderView class])
43 | bundle:[NSBundle bundleForClass:[JSQMessagesLoadEarlierHeaderView class]]];
44 | }
45 |
46 | + (NSString *)headerReuseIdentifier
47 | {
48 | return NSStringFromClass([JSQMessagesLoadEarlierHeaderView class]);
49 | }
50 |
51 | #pragma mark - Initialization
52 |
53 | - (void)awakeFromNib
54 | {
55 | [super awakeFromNib];
56 | [self setTranslatesAutoresizingMaskIntoConstraints:NO];
57 |
58 | self.backgroundColor = [UIColor clearColor];
59 |
60 | [self.loadButton setTitle:[NSBundle jsq_localizedStringForKey:@"load_earlier_messages"] forState:UIControlStateNormal];
61 | self.loadButton.titleLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
62 | }
63 |
64 | - (void)dealloc
65 | {
66 | _loadButton = nil;
67 | _delegate = nil;
68 | }
69 |
70 | #pragma mark - Reusable view
71 |
72 | - (void)setBackgroundColor:(UIColor *)backgroundColor
73 | {
74 | [super setBackgroundColor:backgroundColor];
75 | self.loadButton.backgroundColor = backgroundColor;
76 | }
77 |
78 | #pragma mark - Actions
79 |
80 | - (IBAction)loadButtonPressed:(UIButton *)sender
81 | {
82 | [self.delegate headerView:self didPressLoadButton:sender];
83 | }
84 |
85 | @end
86 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesLoadEarlierHeaderView.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesTypingIndicatorFooterView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Jesse Squires
3 | // http://www.jessesquires.com
4 | //
5 | //
6 | // Documentation
7 | // http://cocoadocs.org/docsets/JSQMessagesViewController
8 | //
9 | //
10 | // GitHub
11 | // https://github.com/jessesquires/JSQMessagesViewController
12 | //
13 | //
14 | // License
15 | // Copyright (c) 2014 Jesse Squires
16 | // Released under an MIT license: http://opensource.org/licenses/MIT
17 | //
18 |
19 | #import
20 | #import
21 |
22 | /**
23 | * A constant defining the default height of a `JSQMessagesTypingIndicatorFooterView`.
24 | */
25 | FOUNDATION_EXPORT const CGFloat kJSQMessagesTypingIndicatorFooterViewHeight;
26 |
27 | /**
28 | * The `JSQMessagesTypingIndicatorFooterView` class implements a reusable view that can be placed
29 | * at the bottom of a `JSQMessagesCollectionView`. This view represents a typing indicator
30 | * for incoming messages.
31 | */
32 | @interface JSQMessagesTypingIndicatorFooterView : UICollectionReusableView
33 |
34 | #pragma mark - Class methods
35 |
36 | /**
37 | * Returns the `UINib` object initialized for the collection reusable view.
38 | *
39 | * @return The initialized `UINib` object or `nil` if there were errors during
40 | * initialization or the nib file could not be located.
41 | */
42 | + (UINib *)nib;
43 |
44 | /**
45 | * Returns the default string used to identify the reusable footer view.
46 | *
47 | * @return The string used to identify the reusable footer view.
48 | */
49 | + (NSString *)footerReuseIdentifier;
50 |
51 | #pragma mark - Typing indicator
52 |
53 | /**
54 | * Configures the receiver with the specified attributes for the given collection view.
55 | * Call this method after dequeuing the footer view.
56 | *
57 | * @param ellipsisColor The color of the typing indicator ellipsis. This value must not be `nil`.
58 | * @param messageBubbleColor The color of the typing indicator message bubble. This value must not be `nil`.
59 | * @param shouldDisplayOnLeft Specifies whether the typing indicator displays on the left or right side of the collection view when displayed.
60 | * @param collectionView The collection view in which the footer view will appear. This value must not be `nil`.
61 | */
62 | - (void)configureWithEllipsisColor:(UIColor *)ellipsisColor
63 | messageBubbleColor:(UIColor *)messageBubbleColor
64 | shouldDisplayOnLeft:(BOOL)shouldDisplayOnLeft
65 | forCollectionView:(UICollectionView *)collectionView;
66 |
67 | @end
68 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/JSQMessagesViewController/Views/JSQMessagesTypingIndicatorFooterView.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQMessagesViewController/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | MIT License
3 | Copyright (c) 2013-present Jesse Squires
4 |
5 | http://www.jessesquires.com
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
8 | associated documentation files (the "Software"), to deal in the Software without restriction, including
9 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
11 | following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
17 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/simple-chat/Pods/JSQSystemSoundPlayer/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | MIT License
3 | Copyright (c) 2013 Jesse Squires
4 |
5 | http://www.hexedbits.com
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
8 | associated documentation files (the "Software"), to deal in the Software without restriction, including
9 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
11 | following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
17 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - JSQMessagesViewController (7.3.5):
3 | - JSQSystemSoundPlayer (~> 2.0.1)
4 | - JSQSystemSoundPlayer (2.0.1)
5 |
6 | DEPENDENCIES:
7 | - JSQMessagesViewController
8 |
9 | SPEC CHECKSUMS:
10 | JSQMessagesViewController: 6587f56aedbcb150a8ba1d968e1ef58b1bc758b7
11 | JSQSystemSoundPlayer: c5850e77a4363ffd374cd851154b9af93264ed8d
12 |
13 | PODFILE CHECKSUM: 7d1ef276401e740a2993e6e057ce81cb7928e4af
14 |
15 | COCOAPODS: 1.3.1
16 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQMessagesViewController/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 7.3.5
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQMessagesViewController/JSQMessagesViewController-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_JSQMessagesViewController : NSObject
3 | @end
4 | @implementation PodsDummy_JSQMessagesViewController
5 | @end
6 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQMessagesViewController/JSQMessagesViewController-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQMessagesViewController/JSQMessagesViewController-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "JSQSystemSoundPlayer+JSQMessages.h"
14 | #import "NSBundle+JSQMessages.h"
15 | #import "NSString+JSQMessages.h"
16 | #import "UIColor+JSQMessages.h"
17 | #import "UIDevice+JSQMessages.h"
18 | #import "UIImage+JSQMessages.h"
19 | #import "UIView+JSQMessages.h"
20 | #import "JSQMessagesKeyboardController.h"
21 | #import "JSQMessagesViewController.h"
22 | #import "JSQMessagesAvatarImageFactory.h"
23 | #import "JSQMessagesBubbleImageFactory.h"
24 | #import "JSQMessagesMediaViewBubbleImageMasker.h"
25 | #import "JSQMessagesTimestampFormatter.h"
26 | #import "JSQMessagesToolbarButtonFactory.h"
27 | #import "JSQMessages.h"
28 | #import "JSQAudioMediaViewAttributes.h"
29 | #import "JSQMessagesBubbleSizeCalculating.h"
30 | #import "JSQMessagesBubblesSizeCalculator.h"
31 | #import "JSQMessagesCollectionViewFlowLayout.h"
32 | #import "JSQMessagesCollectionViewFlowLayoutInvalidationContext.h"
33 | #import "JSQMessagesCollectionViewLayoutAttributes.h"
34 | #import "JSQAudioMediaItem.h"
35 | #import "JSQLocationMediaItem.h"
36 | #import "JSQMediaItem.h"
37 | #import "JSQMessage.h"
38 | #import "JSQMessageAvatarImageDataSource.h"
39 | #import "JSQMessageBubbleImageDataSource.h"
40 | #import "JSQMessageData.h"
41 | #import "JSQMessageMediaData.h"
42 | #import "JSQMessagesAvatarImage.h"
43 | #import "JSQMessagesBubbleImage.h"
44 | #import "JSQMessagesCollectionViewDataSource.h"
45 | #import "JSQMessagesCollectionViewDelegateFlowLayout.h"
46 | #import "JSQPhotoMediaItem.h"
47 | #import "JSQVideoMediaItem.h"
48 | #import "JSQMessagesCellTextView.h"
49 | #import "JSQMessagesCollectionView.h"
50 | #import "JSQMessagesCollectionViewCell.h"
51 | #import "JSQMessagesCollectionViewCellIncoming.h"
52 | #import "JSQMessagesCollectionViewCellOutgoing.h"
53 | #import "JSQMessagesComposerTextView.h"
54 | #import "JSQMessagesInputToolbar.h"
55 | #import "JSQMessagesLabel.h"
56 | #import "JSQMessagesLoadEarlierHeaderView.h"
57 | #import "JSQMessagesMediaPlaceholderView.h"
58 | #import "JSQMessagesToolbarContentView.h"
59 | #import "JSQMessagesTypingIndicatorFooterView.h"
60 |
61 | FOUNDATION_EXPORT double JSQMessagesViewControllerVersionNumber;
62 | FOUNDATION_EXPORT const unsigned char JSQMessagesViewControllerVersionString[];
63 |
64 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQMessagesViewController/JSQMessagesViewController.modulemap:
--------------------------------------------------------------------------------
1 | framework module JSQMessagesViewController {
2 | umbrella header "JSQMessagesViewController-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQMessagesViewController/JSQMessagesViewController.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/JSQMessagesViewController
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/JSQSystemSoundPlayer"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
5 | OTHER_LDFLAGS = -framework "AVFoundation" -framework "CoreGraphics" -framework "CoreLocation" -framework "MapKit" -framework "QuartzCore"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}
9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/JSQMessagesViewController
10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | SKIP_INSTALL = YES
12 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQSystemSoundPlayer/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 2.0.1
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQSystemSoundPlayer/JSQSystemSoundPlayer-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_JSQSystemSoundPlayer : NSObject
3 | @end
4 | @implementation PodsDummy_JSQSystemSoundPlayer
5 | @end
6 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQSystemSoundPlayer/JSQSystemSoundPlayer-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQSystemSoundPlayer/JSQSystemSoundPlayer-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "JSQSystemSoundPlayer.h"
14 |
15 | FOUNDATION_EXPORT double JSQSystemSoundPlayerVersionNumber;
16 | FOUNDATION_EXPORT const unsigned char JSQSystemSoundPlayerVersionString[];
17 |
18 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQSystemSoundPlayer/JSQSystemSoundPlayer.modulemap:
--------------------------------------------------------------------------------
1 | framework module JSQSystemSoundPlayer {
2 | umbrella header "JSQSystemSoundPlayer-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/JSQSystemSoundPlayer/JSQSystemSoundPlayer.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/JSQSystemSoundPlayer
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
4 | OTHER_LDFLAGS = -framework "AudioToolbox" -framework "Foundation" -framework "UIKit"
5 | PODS_BUILD_DIR = $BUILD_DIR
6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/JSQSystemSoundPlayer
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/Pods-Simple Chat/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/Pods-Simple Chat/Pods-Simple Chat-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## JSQMessagesViewController
5 |
6 |
7 | MIT License
8 | Copyright (c) 2013-present Jesse Squires
9 |
10 | http://www.jessesquires.com
11 |
12 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
13 | associated documentation files (the "Software"), to deal in the Software without restriction, including
14 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
16 | following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in
19 | all copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
22 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
25 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 |
27 |
28 | ## JSQSystemSoundPlayer
29 |
30 |
31 | MIT License
32 | Copyright (c) 2013 Jesse Squires
33 |
34 | http://www.hexedbits.com
35 |
36 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
37 | associated documentation files (the "Software"), to deal in the Software without restriction, including
38 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
40 | following conditions:
41 |
42 | The above copyright notice and this permission notice shall be included in
43 | all copies or substantial portions of the Software.
44 |
45 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
46 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
47 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
48 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
49 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
50 |
51 | Generated by CocoaPods - https://cocoapods.org
52 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/Pods-Simple Chat/Pods-Simple Chat-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 |
18 | MIT License
19 | Copyright (c) 2013-present Jesse Squires
20 |
21 | http://www.jessesquires.com
22 |
23 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
24 | associated documentation files (the "Software"), to deal in the Software without restriction, including
25 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
27 | following conditions:
28 |
29 | The above copyright notice and this permission notice shall be included in
30 | all copies or substantial portions of the Software.
31 |
32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
33 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
34 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
35 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
36 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 |
38 | License
39 | MIT
40 | Title
41 | JSQMessagesViewController
42 | Type
43 | PSGroupSpecifier
44 |
45 |
46 | FooterText
47 |
48 | MIT License
49 | Copyright (c) 2013 Jesse Squires
50 |
51 | http://www.hexedbits.com
52 |
53 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
54 | associated documentation files (the "Software"), to deal in the Software without restriction, including
55 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
56 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
57 | following conditions:
58 |
59 | The above copyright notice and this permission notice shall be included in
60 | all copies or substantial portions of the Software.
61 |
62 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
63 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
64 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
65 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
66 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
67 |
68 | License
69 | MIT
70 | Title
71 | JSQSystemSoundPlayer
72 | Type
73 | PSGroupSpecifier
74 |
75 |
76 | FooterText
77 | Generated by CocoaPods - https://cocoapods.org
78 | Title
79 |
80 | Type
81 | PSGroupSpecifier
82 |
83 |
84 | StringsTable
85 | Acknowledgements
86 | Title
87 | Acknowledgements
88 |
89 |
90 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/Pods-Simple Chat/Pods-Simple Chat-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_Simple_Chat : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_Simple_Chat
5 | @end
6 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/Pods-Simple Chat/Pods-Simple Chat-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_Simple_ChatVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_Simple_ChatVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/Pods-Simple Chat/Pods-Simple Chat.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/JSQMessagesViewController" "$PODS_CONFIGURATION_BUILD_DIR/JSQSystemSoundPlayer"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/JSQMessagesViewController/JSQMessagesViewController.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/JSQSystemSoundPlayer/JSQSystemSoundPlayer.framework/Headers"
5 | OTHER_LDFLAGS = $(inherited) -framework "JSQMessagesViewController" -framework "JSQSystemSoundPlayer"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/Pods-Simple Chat/Pods-Simple Chat.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_Simple_Chat {
2 | umbrella header "Pods-Simple Chat-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/simple-chat/Pods/Target Support Files/Pods-Simple Chat/Pods-Simple Chat.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/JSQMessagesViewController" "$PODS_CONFIGURATION_BUILD_DIR/JSQSystemSoundPlayer"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/JSQMessagesViewController/JSQMessagesViewController.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/JSQSystemSoundPlayer/JSQSystemSoundPlayer.framework/Headers"
5 | OTHER_LDFLAGS = $(inherited) -framework "JSQMessagesViewController" -framework "JSQSystemSoundPlayer"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/simple-chat/Simple Chat.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/simple-chat/Simple Chat.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright IBM Corporation 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | **/
16 |
17 | import UIKit
18 |
19 | @UIApplicationMain
20 | class AppDelegate: UIResponder, UIApplicationDelegate {
21 |
22 | var window: UIWindow?
23 |
24 |
25 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
26 | // Override point for customization after application launch.
27 | return true
28 | }
29 |
30 | func applicationWillResignActive(_ application: UIApplication) {
31 | // 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.
32 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
33 | }
34 |
35 | func applicationDidEnterBackground(_ application: UIApplication) {
36 | // 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.
37 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
38 | }
39 |
40 | func applicationWillEnterForeground(_ application: UIApplication) {
41 | // 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.
42 | }
43 |
44 | func applicationDidBecomeActive(_ application: UIApplication) {
45 | // 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.
46 | }
47 |
48 | func applicationWillTerminate(_ application: UIApplication) {
49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
50 | }
51 |
52 |
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
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 | }
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/microphone-hollow.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "microphone-hollow.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "microphone-hollow@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "microphone-hollow@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/microphone-hollow.imageset/microphone-hollow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Simple Chat/Assets.xcassets/microphone-hollow.imageset/microphone-hollow.png
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/microphone-hollow.imageset/microphone-hollow@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Simple Chat/Assets.xcassets/microphone-hollow.imageset/microphone-hollow@2x.png
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/microphone-hollow.imageset/microphone-hollow@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Simple Chat/Assets.xcassets/microphone-hollow.imageset/microphone-hollow@3x.png
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/microphone.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "speechIcon.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "speechIcon@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "speechIcon@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/microphone.imageset/speechIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Simple Chat/Assets.xcassets/microphone.imageset/speechIcon.png
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/microphone.imageset/speechIcon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Simple Chat/Assets.xcassets/microphone.imageset/speechIcon@2x.png
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/microphone.imageset/speechIcon@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Simple Chat/Assets.xcassets/microphone.imageset/speechIcon@3x.png
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/watson_avatar.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "watson_avatar.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Assets.xcassets/watson_avatar.imageset/watson_avatar.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/simple-chat/Simple Chat/Assets.xcassets/watson_avatar.imageset/watson_avatar.pdf
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Credentials.swift.example:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright IBM Corporation 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | **/
16 |
17 | public struct Credentials {
18 | public static let ConversationUsername = "SERVICE-USERNAME-HERE"
19 | public static let ConversationPassword = "SERVICE-PASSWORD-HERE"
20 | public static let ConversationWorkspace = "SERVICE-WORKSPACE-HERE"
21 | public static let SpeechToTextUsername = "SERVICE-USERNAME-HERE"
22 | public static let SpeechToTextPassword = "SERVICE-PASSWORD-HERE"
23 | public static let TextToSpeechUsername = "SERVICE-USERNAME-HERE"
24 | public static let TextToSpeechPassword = "SERVICE-PASSWORD-HERE"
25 | }
26 |
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSMicrophoneUsageDescription
6 | Used for speech recognition.
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/simple-chat/Simple Chat/User.swift:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright IBM Corporation 2017
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | **/
16 |
17 | import Foundation
18 | import JSQMessagesViewController
19 |
20 | enum User: String {
21 | case me = "053496-4509-288"
22 | case watson = "053496-4509-289"
23 |
24 | static func getName(_ user: User) -> String {
25 | switch user {
26 | case .me: return "Me"
27 | case .watson: return "Watson"
28 | }
29 | }
30 |
31 | static func getAvatar(_ id: String) -> JSQMessagesAvatarImage? {
32 | let user = User(rawValue: id)!
33 | switch user {
34 | case .me: return nil
35 | case .watson: return avatarWatson
36 | }
37 | }
38 | }
39 |
40 | private let avatarWatson = JSQMessagesAvatarImageFactory.avatarImage(
41 | with: #imageLiteral(resourceName: "watson_avatar"),
42 | diameter: 24
43 | )
44 |
--------------------------------------------------------------------------------
/tutorial-images/simple-chat.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watson-developer-cloud/simple-chat-swift/e0e3bb08f3ad78ae1ea1e0d6e74086e94e333076/tutorial-images/simple-chat.gif
--------------------------------------------------------------------------------