Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
nathantannar4 committed Apr 5, 2019
2 parents d5b93a6 + 65b21b0 commit 4b00b58
Show file tree
Hide file tree
Showing 17 changed files with 80 additions and 37 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa

## [2.0.0](https://github.com/MessageKit/MessageKit/releases/tag/2.0.0)

### Added

- **Breaking Change** Added new methods to simplify using of custom messages: `customCellSizeCalculator(for:at:in:)` for `MessagesLayoutDelegate` and `customCell(for:at:in:)` for `MessagesDataSource`.
[#879](https://github.com/MessageKit/MessageKit/pull/879) by [@realbonus](https://github.com/RealBonus)

### Changed

- Change acl of `handleGesture(touchLocation:)` in `MessageLabel` from internal to open.
Expand Down Expand Up @@ -77,9 +82,6 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa
- Added `additionalBottomInset` property that allows to adjust the bottom content inset automatically set on the messages collection view by the view controller.
[#787](https://github.com/MessageKit/MessageKit/pull/787) by [@andreyvit](https://github.com/andreyvit)

- Added new methods to simplify using of custom messages: `customCellSizeCalculator(for:at:in:)` for `MessagesLayoutDelegate` and `customCell(for:at:in:)` for `MessagesDataSource`.
[#879](https://github.com/MessageKit/MessageKit/pull/879) by [@realbonus](https://github.com/RealBonus)

### Fixed

- **Breaking Change** Fixed typo of `scrollsToBottomOnKeybordBeginsEditing` to `scrollsToBottomOnKeyboardBeginsEditing`.
Expand Down Expand Up @@ -176,7 +178,7 @@ classes that are responsible for sizing the `MessagesCollectionViewCell` types p
### Changed

- **Breaking Change** Renamed `MessageData` enum to `MessageKind` and changed `MessageType`'s `data` property name to `kind`.
[#658](https://github.com/MessageKit/MessageKit/658) by [@zhongwuzw](https://github.com/zhongwuzw).
[#658](https://github.com/MessageKit/MessageKit/pull/658) by [@zhongwuzw](https://github.com/zhongwuzw).

- **Breaking Change** Changed the `messageFooterView(for:in)` and `messageHeaderView(for:in)` methods of
`MessagesDisplayDelegate` by removing the `message` parameter.
Expand Down
4 changes: 2 additions & 2 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "Quick/Quick" ~> 1.2.0
github "Quick/Nimble" ~> 7.0.3
github "Quick/Quick" ~> 2.0.0
github "Quick/Nimble" ~> 8.0.1
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "MessageKit/MessageInputBar" "0.4.0"
github "Quick/Nimble" "v7.3.1"
github "Quick/Quick" "v1.3.2"
github "Quick/Nimble" "v8.0.1"
github "Quick/Quick" "v2.0.0"
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,39 @@ To integrate MessageKit using Carthage, add the following to your `Cartfile`:
github "MessageKit/MessageKit"
````

### Manual

#### Embedded Framework

- `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:

```bash
$ git submodule add https://github.com/MessageKit/MessageKit.git
```

- `cd` to the new `MessageKit` folder and trigger [carthage](https://github.com/Carthage/Carthage) update by the following command:

```bash
$ carthage update --platform iOS
```

- 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.
- Select the `MessageKit.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target.
- Next, select your application project in the Project Navigator (blue project icon), navigate to the target configuration window and select the application target.
- In the tab bar at the top of that window, open the "General" panel.
- Click on the `+` button under the "Embedded Binaries" section.
- You will see two different `MessageKit.xcodeproj` folders each with two different versions of the `MessageKit.framework` nested inside a `Products` folder.
- Select the top `MessageKit.framework` for iOS and the bottom one for OS X.
- Voila! Now you can `import MessageKit` and build the project.


## Getting Started

Please have a look at the [Quick Start guide](https://github.com/MessageKit/MessageKit/blob/master/Documentation/QuickStart.md), the [FAQs](https://github.com/MessageKit/MessageKit/blob/master/Documentation/FAQs.md) and the [MessageInputBar docs](https://github.com/MessageKit/MessageKit/blob/master/Documentation/MessageInputBar.md).

If you have any issues have a look at the [Example](https://github.com/MessageKit/MessageKit/tree/master/Example) project or write a question with the "messagekit" tag on [Stack Overflow](https://stackoverflow.com/questions/tagged/messagekit).


## Requirements

- **iOS9** or later
Expand Down Expand Up @@ -115,6 +148,8 @@ Interested in contributing to MessageKit? Click here to join our [Slack](https:/

Add your app to the list of apps using this library and make a pull request.

- [Formacar](https://itunes.apple.com/ru/app/id1180117334)
- [HopUp](https://itunes.apple.com/us/app/hopup-airsoft-community/id1128903141?mt=8)
- [MediQuo](https://www.mediquo.com)
- [RappresentaMe](https://itunes.apple.com/it/app/rappresentame/id1330914443)
- [WiseEyes](https://itunes.apple.com/us/app/wiseeyes/id1391408511?mt=8)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Controllers/MessagesViewController+Keyboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import Foundation
import MessageInputBar

extension MessagesViewController {
extension MessagesViewController { // swiftlint:disable:this explicit_acl explicit_top_level_acl

// MARK: - Register / Unregister Observers

Expand Down
2 changes: 1 addition & 1 deletion Sources/Controllers/MessagesViewController+Menu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import Foundation
import MessageInputBar

extension MessagesViewController {
extension MessagesViewController { // swiftlint:disable:this explicit_acl explicit_top_level_acl

// MARK: - Register / Unregister Observers

Expand Down
4 changes: 2 additions & 2 deletions Sources/Extensions/Bundle+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

import Foundation

extension Bundle {
internal extension Bundle {

internal static func messageKitAssetBundle() -> Bundle {
static func messageKitAssetBundle() -> Bundle { // swiftlint:disable:this explicit_acl
let podBundle = Bundle(for: MessagesViewController.self)

guard let resourceBundleUrl = podBundle.url(forResource: "MessageKitAssets", withExtension: "bundle") else {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Extensions/CGRect+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

import Foundation

extension CGRect {
internal extension CGRect {

internal init(_ x: CGFloat, _ y: CGFloat, _ w: CGFloat, _ h: CGFloat) {
init(_ x: CGFloat, _ y: CGFloat, _ w: CGFloat, _ h: CGFloat) { // swiftlint:disable:this explicit_acl
self.init(x: x, y: y, width: w, height: h)
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/Extensions/NSAttributedString+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

import Foundation

extension NSAttributedString {
internal extension NSAttributedString {

internal func width(considering height: CGFloat) -> CGFloat {
func width(considering height: CGFloat) -> CGFloat { // swiftlint:disable:this explicit_acl

let constraintBox = CGSize(width: .greatestFiniteMagnitude, height: height)
let rect = self.boundingRect(with: constraintBox, options: [.usesLineFragmentOrigin, .usesFontLeading], context: nil)
Expand Down
14 changes: 8 additions & 6 deletions Sources/Extensions/UIColor+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@

import Foundation

extension UIColor {
// swiftlint:disable explicit_acl

internal static let incomingGray = UIColor(red: 230/255, green: 230/255, blue: 235/255, alpha: 1.0)
internal extension UIColor {

internal static let outgoingGreen = UIColor(red: 69/255, green: 214/255, blue: 93/255, alpha: 1.0)
static let incomingGray = UIColor(red: 230/255, green: 230/255, blue: 235/255, alpha: 1.0)

internal static let inputBarGray = UIColor(red: 247/255, green: 247/255, blue: 247/255, alpha: 1.0)
static let outgoingGreen = UIColor(red: 69/255, green: 214/255, blue: 93/255, alpha: 1.0)

internal static let playButtonLightGray = UIColor(red: 230/255, green: 230/255, blue: 230/255, alpha: 1.0)
static let inputBarGray = UIColor(red: 247/255, green: 247/255, blue: 247/255, alpha: 1.0)

internal static let sendButtonBlue = UIColor(red: 15/255, green: 135/255, blue: 255/255, alpha: 1.0)
static let playButtonLightGray = UIColor(red: 230/255, green: 230/255, blue: 230/255, alpha: 1.0)

static let sendButtonBlue = UIColor(red: 15/255, green: 135/255, blue: 255/255, alpha: 1.0)

}
8 changes: 5 additions & 3 deletions Sources/Extensions/UIEdgeInsets+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@

import Foundation

extension UIEdgeInsets {
// swiftlint:disable explicit_acl

internal var vertical: CGFloat {
internal extension UIEdgeInsets {

var vertical: CGFloat {
return top + bottom
}

internal var horizontal: CGFloat {
var horizontal: CGFloat {
return left + right
}

Expand Down
12 changes: 7 additions & 5 deletions Sources/Extensions/UIView+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@

import UIKit

extension UIView {
// swiftlint:disable explicit_acl

internal extension UIView {

internal func fillSuperview() {
func fillSuperview() {
guard let superview = self.superview else {
return
}
Expand All @@ -41,7 +43,7 @@ extension UIView {
NSLayoutConstraint.activate(constraints)
}

internal func centerInSuperview() {
func centerInSuperview() {
guard let superview = self.superview else {
return
}
Expand All @@ -53,7 +55,7 @@ extension UIView {
NSLayoutConstraint.activate(constraints)
}

internal func constraint(equalTo size: CGSize) {
func constraint(equalTo size: CGSize) {
guard superview != nil else { return }
translatesAutoresizingMaskIntoConstraints = false
let constraints: [NSLayoutConstraint] = [
Expand All @@ -65,7 +67,7 @@ extension UIView {
}

@discardableResult
internal func addConstraints(_ top: NSLayoutYAxisAnchor? = nil, left: NSLayoutXAxisAnchor? = nil, bottom: NSLayoutYAxisAnchor? = nil, right: NSLayoutXAxisAnchor? = nil, topConstant: CGFloat = 0, leftConstant: CGFloat = 0, bottomConstant: CGFloat = 0, rightConstant: CGFloat = 0, widthConstant: CGFloat = 0, heightConstant: CGFloat = 0) -> [NSLayoutConstraint] {
func addConstraints(_ top: NSLayoutYAxisAnchor? = nil, left: NSLayoutXAxisAnchor? = nil, bottom: NSLayoutYAxisAnchor? = nil, right: NSLayoutXAxisAnchor? = nil, topConstant: CGFloat = 0, leftConstant: CGFloat = 0, bottomConstant: CGFloat = 0, rightConstant: CGFloat = 0, widthConstant: CGFloat = 0, heightConstant: CGFloat = 0) -> [NSLayoutConstraint] {

if self.superview == nil {
return []
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/AvatarPosition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public struct AvatarPosition {

// MARK: - Equatable Conformance

extension AvatarPosition: Equatable {
extension AvatarPosition: Equatable { // swiftlint:disable:this explicit_acl explicit_top_level_acl

public static func == (lhs: AvatarPosition, rhs: AvatarPosition) -> Bool {
return lhs.vertical == rhs.vertical && lhs.horizontal == rhs.horizontal
Expand Down
6 changes: 3 additions & 3 deletions Sources/Models/HorizontalEdgeInsets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ public struct HorizontalEdgeInsets {
}
}

extension HorizontalEdgeInsets: Equatable {
extension HorizontalEdgeInsets: Equatable { // swiftlint:disable:this explicit_acl explicit_top_level_acl

public static func == (lhs: HorizontalEdgeInsets, rhs: HorizontalEdgeInsets) -> Bool {
return lhs.left == rhs.left && lhs.right == rhs.right
}
}

extension HorizontalEdgeInsets {
internal extension HorizontalEdgeInsets {

internal var horizontal: CGFloat {
var horizontal: CGFloat { // swiftlint:disable:this explicit_acl
return left + right
}
}
2 changes: 1 addition & 1 deletion Sources/Models/LabelAlignment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public struct LabelAlignment {

// MARK: - Equatable Conformance

extension LabelAlignment: Equatable {
extension LabelAlignment: Equatable { // swiftlint:disable:this explicit_acl explicit_top_level_acl

public static func == (lhs: LabelAlignment, rhs: LabelAlignment) -> Bool {
return lhs.textAlignment == rhs.textAlignment && lhs.textInsets == rhs.textInsets
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Sender.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public struct Sender {

// MARK: - Equatable Conformance

extension Sender: Equatable {
extension Sender: Equatable { // swiftlint:disable:this explicit_acl explicit_top_level_acl

/// Two senders are considered equal if they have the same id.
public static func == (left: Sender, right: Sender) -> Bool {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Protocols/MessagesDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public protocol MessagesDataSource: AnyObject {
/// - messagesCollectionView: The `MessagesCollectionView` in which this cell will be displayed.
///
/// - Note:
/// This method will call fatalError() on default. You must override this method if you are using MessageType.custom messages.
/// This method will call fatalError() on default. You must override this method if you are using MessageKind.custom messages.
func customCell(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> UICollectionViewCell
}

Expand Down

0 comments on commit 4b00b58

Please sign in to comment.