Skip to content

Commit bed54d3

Browse files
committed
Merge branch 'development' into 3.0.0-swift5
2 parents 46f303d + c08efa0 commit bed54d3

17 files changed

+497
-69
lines changed

Assets/CellStructure.png

56.1 KB
Loading

Assets/ExampleA.png

510 KB
Loading

Assets/ExampleB.png

273 KB
Loading
31.3 KB
Loading

Assets/MessageInputBarLayout.png

-22.9 KB
Binary file not shown.

Assets/TypingIndicator.png

136 KB
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Embedded Framework Installation
2+
3+
- `cd` to your project directory, initialize git, and Add MessageKit as a git [submodule](https://git-scm.com/docs/git-submodule) by running the following command:
4+
5+
```bash
6+
$ git submodule add https://github.com/MessageKit/MessageKit.git
7+
```
8+
9+
- `cd` to the new `MessageKit` folder and trigger [carthage](https://github.com/Carthage/Carthage) update by the following command:
10+
11+
```bash
12+
$ carthage update --platform iOS
13+
```
14+
15+
- Open `MessageKit` folder, and drag the `MessageKit.xcodeproj` into the Project Navigator of your application's Xcode project. It should appear nested underneath your application's blue project icon.
16+
- Select the `MessageKit.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target.
17+
- Next, select your application project in the Project Navigator (blue project icon), navigate to the target configuration window and select the application target.
18+
- In the tab bar at the top of that window, open the "General" panel.
19+
- Click on the `+` button under the "Embedded Binaries" section.
20+
- You will see two different `MessageKit.xcodeproj` folders each with two different versions of the `MessageKit.framework` nested inside a `Products` folder.
21+
- Select the top `MessageKit.framework` for iOS and the bottom one for OS X.
22+
- Voila! Now you can `import MessageKit` and build the project.

Example/ChatExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
385C2946211FF38F0010B4BA /* LaunchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 385C293F211FF38F0010B4BA /* LaunchViewController.swift */; };
2626
385C2947211FF38F0010B4BA /* BasicExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 385C2940211FF38F0010B4BA /* BasicExampleViewController.swift */; };
2727
385C2948211FF38F0010B4BA /* ChatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 385C2941211FF38F0010B4BA /* ChatViewController.swift */; };
28+
38CCCC592258419300DD5482 /* AutocompleteExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38CCCC582258419300DD5482 /* AutocompleteExampleViewController.swift */; };
2829
50739F9621C5090A008CA369 /* BasicAudioController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50739F9521C5090A008CA369 /* BasicAudioController.swift */; };
2930
5074EF4E2163555900D82952 /* sound2.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 5074EF4C2163555900D82952 /* sound2.m4a */; };
3031
5074EF4F2163555900D82952 /* sound1.m4a in Resources */ = {isa = PBXBuildFile; fileRef = 5074EF4D2163555900D82952 /* sound1.m4a */; };
@@ -89,6 +90,7 @@
8990
385C293F211FF38F0010B4BA /* LaunchViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LaunchViewController.swift; sourceTree = "<group>"; };
9091
385C2940211FF38F0010B4BA /* BasicExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicExampleViewController.swift; sourceTree = "<group>"; };
9192
385C2941211FF38F0010B4BA /* ChatViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChatViewController.swift; sourceTree = "<group>"; };
93+
38CCCC582258419300DD5482 /* AutocompleteExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutocompleteExampleViewController.swift; sourceTree = "<group>"; };
9294
3B316705C4717C3B4C916D62 /* Pods_ChatExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ChatExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9395
50739F9521C5090A008CA369 /* BasicAudioController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicAudioController.swift; sourceTree = "<group>"; };
9496
5074EF4C2163555900D82952 /* sound2.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = sound2.m4a; sourceTree = "<group>"; };
@@ -189,6 +191,7 @@
189191
isa = PBXGroup;
190192
children = (
191193
385C293B211FF38E0010B4BA /* AdvancedExampleViewController.swift */,
194+
38CCCC582258419300DD5482 /* AutocompleteExampleViewController.swift */,
192195
385C2940211FF38F0010B4BA /* BasicExampleViewController.swift */,
193196
385C2941211FF38F0010B4BA /* ChatViewController.swift */,
194197
385C293F211FF38F0010B4BA /* LaunchViewController.swift */,
@@ -550,6 +553,7 @@
550553
385C2947211FF38F0010B4BA /* BasicExampleViewController.swift in Sources */,
551554
882B5E811CF7D53600B6E160 /* AppDelegate.swift in Sources */,
552555
385C292D211FF3520010B4BA /* CustomMessageFlowLayout.swift in Sources */,
556+
38CCCC592258419300DD5482 /* AutocompleteExampleViewController.swift in Sources */,
553557
);
554558
runOnlyForDeploymentPostprocessing = 0;
555559
};

Example/Sources/Data Generation/SampleData.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ final internal class SampleData {
6363
]
6464

6565
var currentSender: MockUser {
66-
return nathan
66+
return steven
6767
}
6868

6969
var now = Date()
@@ -156,7 +156,7 @@ final internal class SampleData {
156156
func randomMessage(allowedSenders: [MockUser]) -> MockMessage {
157157
let randomNumberSender = Int(arc4random_uniform(UInt32(allowedSenders.count)))
158158

159-
let uniqueID = NSUUID().uuidString
159+
let uniqueID = UUID().uuidString
160160
let user = allowedSenders[randomNumberSender]
161161
let date = dateAddingRandomTime()
162162

@@ -204,7 +204,11 @@ final internal class SampleData {
204204
// Disable Custom Messages
205205
UserDefaults.standard.set(false, forKey: "Custom Messages")
206206
for _ in 0..<count {
207-
let message = randomMessage(allowedSenders: senders)
207+
let uniqueID = UUID().uuidString
208+
let user = senders.random()!
209+
let date = dateAddingRandomTime()
210+
let randomSentence = Lorem.sentence()
211+
let message = MockMessage(text: randomSentence, user: user, messageId: uniqueID, date: date)
208212
messages.append(message)
209213
}
210214
completion(messages)
@@ -226,7 +230,11 @@ final internal class SampleData {
226230
// Disable Custom Messages
227231
UserDefaults.standard.set(false, forKey: "Custom Messages")
228232
for _ in 0..<count {
229-
let message = randomMessage(allowedSenders: allowedSenders)
233+
let uniqueID = UUID().uuidString
234+
let user = senders.random()!
235+
let date = dateAddingRandomTime()
236+
let randomSentence = Lorem.sentence()
237+
let message = MockMessage(text: randomSentence, user: user, messageId: uniqueID, date: date)
230238
messages.append(message)
231239
}
232240
completion(messages)

Example/Sources/View Controllers/AdvancedExampleViewController.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class AdvancedExampleViewController: ChatViewController {
4242
override func viewDidAppear(_ animated: Bool) {
4343
super.viewDidAppear(animated)
4444

45-
MockSocket.shared.connect(with: [SampleData.shared.steven, SampleData.shared.wu])
45+
MockSocket.shared.connect(with: [SampleData.shared.nathan, SampleData.shared.wu])
4646
.onTypingStatus { [weak self] in
4747
self?.setTypingIndicatorViewHidden(false)
4848
}.onNewMessage { [weak self] message in
@@ -147,7 +147,7 @@ final class AdvancedExampleViewController: ChatViewController {
147147
let color = isOverLimit ? .red : UIColor(white: 0.6, alpha: 1)
148148
item.setTitleColor(color, for: .normal)
149149
}
150-
let bottomItems = [makeButton(named: "ic_at"), makeButton(named: "ic_hashtag"), makeButton(named: "ic_library"), .flexibleSpace, charCountButton]
150+
let bottomItems = [.flexibleSpace, charCountButton]
151151
messageInputBar.middleContentViewPadding.bottom = 8
152152
messageInputBar.setStackViewItems(bottomItems, forStack: .bottom, animated: false)
153153

@@ -340,6 +340,7 @@ extension AdvancedExampleViewController: MessagesDisplayDelegate {
340340
// Cells are reused, so only add a button here once. For real use you would need to
341341
// ensure any subviews are removed if not needed
342342
accessoryView.subviews.forEach { $0.removeFromSuperview() }
343+
accessoryView.backgroundColor = .clear
343344

344345
let shouldShow = Int.random(in: 0...10) == 0
345346
guard shouldShow else { return }

0 commit comments

Comments
 (0)