소스 검색

Merge branch 'upgrade_messagekit'

Alla Reinsch 7 년 전
부모
커밋
2e9941cd8c
5개의 변경된 파일49개의 추가작업 그리고 46개의 파일을 삭제
  1. 0 1
      .gitignore
  2. 20 0
      Podfile.lock
  3. 2 18
      deltachat-ios.xcodeproj/project.pbxproj
  4. 8 0
      deltachat-ios.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  5. 19 27
      deltachat-ios/ChatViewController.swift

+ 0 - 1
.gitignore

@@ -1,4 +1,3 @@
-Podfile.lock
 Pods
 
 # Created by https://www.gitignore.io/api/xcode

+ 20 - 0
Podfile.lock

@@ -0,0 +1,20 @@
+PODS:
+  - MessageKit (0.13.3)
+  - openssl-ios-bitcode (1.0.210)
+
+DEPENDENCIES:
+  - MessageKit
+  - openssl-ios-bitcode
+
+SPEC REPOS:
+  https://github.com/CocoaPods/Specs.git:
+    - MessageKit
+    - openssl-ios-bitcode
+
+SPEC CHECKSUMS:
+  MessageKit: 63c5811bdf1087384c76732fa4b5479b2ed11568
+  openssl-ios-bitcode: c833701a4488bd43de0051db41cfa75f6fef8109
+
+PODFILE CHECKSUM: c057d65ca0f57313f89f48ea66fc7773d4a562aa
+
+COCOAPODS: 1.5.0

+ 2 - 18
deltachat-ios.xcodeproj/project.pbxproj

@@ -449,8 +449,7 @@
 				7A9FB13C1FB061E2001FEA36 /* Sources */,
 				7A9FB13D1FB061E2001FEA36 /* Frameworks */,
 				7A9FB13E1FB061E2001FEA36 /* Resources */,
-				269B032E4F093924FBEF3924 /* [CP] Embed Pods Frameworks */,
-				5666073C703CC2D48B2D265F /* [CP] Copy Pods Resources */,
+				30C8FE37A924BE7AFF9661C1 /* [CP] Embed Pods Frameworks */,
 			);
 			buildRules = (
 			);
@@ -539,7 +538,7 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
-		269B032E4F093924FBEF3924 /* [CP] Embed Pods Frameworks */ = {
+		30C8FE37A924BE7AFF9661C1 /* [CP] Embed Pods Frameworks */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -557,21 +556,6 @@
 			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-deltachat-ios/Pods-deltachat-ios-frameworks.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		5666073C703CC2D48B2D265F /* [CP] Copy Pods Resources */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			name = "[CP] Copy Pods Resources";
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-deltachat-ios/Pods-deltachat-ios-resources.sh\"\n";
-			showEnvVarsInLog = 0;
-		};
 		58C9D79942D26B7F8F210DA1 /* [CP] Check Pods Manifest.lock */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;

+ 8 - 0
deltachat-ios.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IDEDidComputeMac32BitWarning</key>
+	<true/>
+</dict>
+</plist>

+ 19 - 27
deltachat-ios/ChatViewController.swift

@@ -91,7 +91,7 @@ class ChatViewController: MessagesViewController {
         messagesCollectionView.messageCellDelegate = self
         messageInputBar.delegate = self
         messageInputBar.sendButton.tintColor = UIColor(red: 69/255, green: 193/255, blue: 89/255, alpha: 1)
-        scrollsToBottomOnFirstLayout = true //default false
+        // scrollsToBottomOnFirstLayout = true //default false
         scrollsToBottomOnKeybordBeginsEditing = true // default false
         
         navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(named: "ic_keyboard"),
@@ -280,7 +280,7 @@ extension ChatViewController: MessagesDataSource {
 
 // MARK: - MessagesDisplayDelegate
 
-extension ChatViewController: MessagesDisplayDelegate, TextMessageDisplayDelegate {
+extension ChatViewController: MessagesDisplayDelegate {
     
     func backgroundColor(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> UIColor {
         return isFromCurrentSender(message: message) ? Constants.Color.bubble : UIColor(red: 230/255, green: 230/255, blue: 230/255, alpha: 1)
@@ -302,6 +302,9 @@ extension ChatViewController: MessagesDisplayDelegate, TextMessageDisplayDelegat
 // MARK: - MessagesLayoutDelegate
 
 extension ChatViewController: MessagesLayoutDelegate {
+    func heightForLocation(message: MessageType, at indexPath: IndexPath, with maxWidth: CGFloat, in messagesCollectionView: MessagesCollectionView) -> CGFloat {
+        return 40
+    }
     
     func messagePadding(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> UIEdgeInsets {
         if isFromCurrentSender(message: message) {
@@ -327,8 +330,8 @@ extension ChatViewController: MessagesLayoutDelegate {
         }
     }
     
-    func avatarAlignment(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> AvatarAlignment {
-        return .messageBottom
+    func avatarAlignment(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> AvatarPosition.Horizontal {
+        return AvatarPosition.Horizontal.cellLeading
     }
     
     func footerViewSize(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> CGSize {
@@ -338,40 +341,26 @@ extension ChatViewController: MessagesLayoutDelegate {
     
 }
 
-// MARK: - LocationMessageLayoutDelegate
-
-extension ChatViewController: LocationMessageLayoutDelegate {
-    
-    func heightForLocation(message: MessageType, at indexPath: IndexPath, with maxWidth: CGFloat, in messagesCollectionView: MessagesCollectionView) -> CGFloat {
-        return 200
-    }
-    
-}
-
-// MARK: - MediaMessageLayoutDelegate
-
-extension ChatViewController: MediaMessageLayoutDelegate {}
 
 // MARK: - MessageCellDelegate
 
 extension ChatViewController: MessageCellDelegate {
+    func didTapMessage(in cell: MessageCollectionViewCell) {
+        print("Message tapped")
+    }
     
-    func didTapAvatar<T>(in cell: MessageCollectionViewCell<T>) {
+    func didTapAvatar(in cell: MessageCollectionViewCell) {
         print("Avatar tapped")
-    }
     
-    func didTapMessage<T>(in cell: MessageCollectionViewCell<T>) {
-        print("Message tapped")
     }
     
-    func didTapTopLabel<T>(in cell: MessageCollectionViewCell<T>) {
+    func didTapTopLabel(in cell: MessageCollectionViewCell) {
         print("Top label tapped")
     }
-    
-    func didTapBottomLabel<T>(in cell: MessageCollectionViewCell<T>) {
-        print("Bottom label tapped")
+
+    func didTapBottomLabel(in cell: MessageCollectionViewCell) {
+        print ("Bottom label tapped")
     }
-    
 }
 
 // MARK: - MessageLabelDelegate
@@ -395,7 +384,7 @@ extension ChatViewController: MessageLabelDelegate {
     }
     
 }
-
+/*
 // MARK: - LocationMessageDisplayDelegate
 
 extension ChatViewController: LocationMessageDisplayDelegate {
@@ -420,8 +409,10 @@ extension ChatViewController: LocationMessageDisplayDelegate {
     }
     
 }
+*/
 
 // MARK: - MessageInputBarDelegate
+ 
 
 extension ChatViewController: MessageInputBarDelegate {
     
@@ -435,3 +426,4 @@ extension ChatViewController: MessageInputBarDelegate {
 //        messagesCollectionView.scrollToBottom()
     }
 }
+