├── .codecov.yml ├── .github ├── CONTRIBUTING.md └── workflows │ └── swift.yml ├── .gitignore ├── .swiftlint.yml ├── AUTHORS ├── CHANGELOG.md ├── Chatto.podspec ├── Chatto.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ ├── IDETemplateMacros.plist │ ├── IDEWorkspaceChecks.plist │ └── xcschemes │ ├── Chatto.xcscheme │ └── ChattoAdditions.xcscheme ├── Chatto ├── .swiftlint.yml ├── Chatto.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── Tests │ ├── Chat Items │ │ └── BaseChatItemPresenterTests.swift │ ├── ChatController │ │ ├── BaseChatViewControllerTestHelpers.swift │ │ ├── BaseChatViewControllerTests.swift │ │ ├── ChatCollectionViewLayoutTests.swift │ │ ├── ChatMessagesViewControllerHelpers.swift │ │ ├── ChatMessagesViewControllerTests.swift │ │ └── CollectionChangesTests.swift │ ├── ChatItemCompanionCollectionTests.swift │ ├── Info.plist │ ├── ObservableAsyncStreamTests.swift │ └── SerialTaskQueueTests.swift └── sources │ ├── Chat Items │ ├── BaseChatItemPresenter.swift │ ├── ChatItemCompanion.swift │ ├── ChatItemProtocolDefinitions.swift │ └── DummyChatItemPresenter.swift │ ├── ChatController │ ├── BaseChatViewController.swift │ ├── ChatLayoutConfiguration.swift │ ├── ChatMessages │ │ ├── ChatMessageCollectionAdapter.swift │ │ ├── ChatMessagesCollectionProtocol.swift │ │ ├── ChatMessagesViewController.swift │ │ ├── ChatMessagesViewModel.swift │ │ └── New │ │ │ ├── ChatCollectionViewLayoutModelFactory.swift │ │ │ ├── CollectionUpdateProvider.swift │ │ │ ├── CollectionUpdateProviderProtocol.swift │ │ │ ├── NewChatMessageCollectionAdapter.swift │ │ │ └── NewChatMessageCollectionAdapterConfiguration.swift │ ├── Collaborators │ │ ├── BaseChatViewControllerView.swift │ │ ├── CellPanGestureHandler.swift │ │ ├── ChatCollectionViewLayout.swift │ │ ├── ChatDataSourceProtocol.swift │ │ ├── ChatItemPresenterFactory.swift │ │ ├── ChatPanGestureRecogniserHandler.swift │ │ ├── CollectionChanges.swift │ │ └── ReplyFeedbackGenerator.swift │ ├── InputBar │ │ ├── Animations │ │ │ ├── SpringChatInputBarAnimation.swift │ │ │ └── TimingChatInputBarAnimation.swift │ │ ├── ChatInputBarPresenterProtocol.swift │ │ └── ChatInputBarPresentingController.swift │ └── UICollectionView+Scrolling.swift │ ├── ChatItemCompanionCollection.swift │ ├── Info.plist │ ├── Keyboard │ ├── KeyboardTracker.swift │ ├── KeyboardTrackingView.swift │ └── KeyboardUpdatesHandler.swift │ ├── SerialTaskQueue.swift │ └── Utils │ ├── Observable.swift │ └── Utils.swift ├── ChattoAdditions.podspec ├── ChattoAdditions ├── .swiftlint.yml ├── ChattoAdditions.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── ChattoAdditionsResources │ └── Info.plist ├── Tests │ ├── Chat Items │ │ ├── BaseMessage │ │ │ ├── BaseMessagePresenterTests.swift │ │ │ ├── CompoundMessagePresenterTests.swift │ │ │ ├── DefaultMessageContentPresenterTests.swift │ │ │ ├── FakeMessageContentFactory.swift │ │ │ ├── FakeMessageInteractionHandler.swift │ │ │ ├── FakeMessageModel.swift │ │ │ ├── FakeViewModelBuilder.swift │ │ │ ├── MessageModel+Helpers.swift │ │ │ ├── MessageViewModelTests.swift │ │ │ ├── StubCompoundBubbleViewStyle.swift │ │ │ ├── StubMessageCollectionViewCellStyle.swift │ │ │ ├── TestHelpers.swift │ │ │ └── TestableCompoundMessagePresenter.swift │ │ ├── PhotoMessages │ │ │ ├── PhotoMessagePresenterBuilderTests.swift │ │ │ └── PhotoMessagePresenterTests.swift │ │ └── TextMessages │ │ │ ├── TextMessagePresenterBuilderTests.swift │ │ │ └── TextMessagePresenterTests.swift │ ├── Common │ │ ├── CGFloat+AdditionsTests.swift │ │ ├── CGPoint+AdditionsTests.swift │ │ ├── CGRect+AdditionsTests.swift │ │ ├── CGSize+AdditionsTests.swift │ │ ├── Comparable+ClampTests.swift │ │ ├── ObservableTests.swift │ │ └── UIEdgeInets+AdditionsTests.swift │ ├── Info.plist │ └── Input │ │ ├── ChatInputBarTests.swift │ │ ├── ChatInputItemTests.swift │ │ ├── ChatInputItemViewTests.swift │ │ ├── ChatInputPresenterTests.swift │ │ ├── FakePhotosInputDataProvider.swift │ │ ├── LiveCameraCellPresenterTests.swift │ │ ├── PhotosChatInputItemTests.swift │ │ ├── PhotosInputCameraPickerTests.swift │ │ ├── PhotosInputCellProviderTests.swift │ │ ├── PhotosInputPlaceholderDataProviderTests.swift │ │ ├── PhotosInputViewItemSizeCalculatorTests.swift │ │ ├── PhotosInputWithPlaceholdersDataProviderTests.swift │ │ └── TextChatInputItemTests.swift └── sources │ ├── Chat Items │ ├── BaseMessage │ │ ├── BaseMessageModel.swift │ │ ├── BaseMessagePresenter.swift │ │ ├── BaseMessageViewModel.swift │ │ └── Views │ │ │ ├── BaseMessageCollectionViewCell.swift │ │ │ ├── BaseMessageCollectionViewCellDefaultStyle.swift │ │ │ └── ViewDefinitions.swift │ ├── ChatItemDecorationAttributes.swift │ ├── Composable │ │ ├── BaseViewComposition.swift │ │ ├── Binder.swift │ │ ├── BindingKey.swift │ │ ├── ChatItemCell.swift │ │ ├── ChatItemContentView.swift │ │ ├── ChatItemLifecycleViewModel.swift │ │ ├── ChatItemPresenter.swift │ │ ├── ChatItemPresenterBuilder.swift │ │ ├── ContainerViewProtocols.swift │ │ ├── FactoryAggregate.swift │ │ ├── IndexedSubviews.swift │ │ ├── Layout │ │ │ ├── LayoutApplicator.swift │ │ │ ├── LayoutAssembler.swift │ │ │ ├── LayoutContext.swift │ │ │ ├── LayoutModel.swift │ │ │ ├── LayoutProviderContainer.swift │ │ │ ├── LayoutProviderFactoryProtocol.swift │ │ │ ├── LayoutProviderProtocol.swift │ │ │ ├── ManualLayoutViewProtocol.swift │ │ │ └── SizeContainer.swift │ │ ├── MessageViewHierarchy.swift │ │ ├── MultipleViewComposition.swift │ │ ├── ReuseIdentifierProvider.swift │ │ ├── SingleViewComposition.swift │ │ ├── ViewAssembler.swift │ │ ├── ViewFactoryProtocol.swift │ │ ├── ViewModelBinding.swift │ │ └── ViewModelFactoryProtocol.swift │ ├── CompoundMessage │ │ ├── CompoundMessagePresenter.swift │ │ ├── CompoundMessagePresenterBuilder.swift │ │ ├── Content │ │ │ ├── DefaultMessageContentPresenter.swift │ │ │ ├── MessageContentFactoryProtocol.swift │ │ │ ├── MessageContentPresenterProtocol.swift │ │ │ └── MessageManualLayoutProvider.swift │ │ ├── Decoration │ │ │ ├── MessageDecorationViewFactory.swift │ │ │ └── MessageDecorationViewLayout.swift │ │ └── Views │ │ │ ├── CompoundBubbleLayout.swift │ │ │ ├── CompoundBubbleView.swift │ │ │ ├── CompoundBubbleViewStyle.swift │ │ │ └── CompoundMessageCollectionViewCell.swift │ ├── PhotoMessages │ │ ├── PhotoMessageModel.swift │ │ ├── PhotoMessagePresenter.swift │ │ ├── PhotoMessagePresenterBuilder.swift │ │ ├── PhotoMessageViewModel.swift │ │ └── Views │ │ │ ├── PhotoBubbleView.swift │ │ │ ├── PhotoMessageCollectionViewCell.swift │ │ │ └── PhotoMessageCollectionViewCellDefaultStyle.swift │ └── TextMessages │ │ ├── TextMessageMenuItemPresenter.swift │ │ ├── TextMessageModel.swift │ │ ├── TextMessagePresenter.swift │ │ ├── TextMessagePresenterBuilder.swift │ │ ├── TextMessageViewModel.swift │ │ └── Views │ │ ├── TextBubbleView.swift │ │ ├── TextMessageCollectionViewCell.swift │ │ └── TextMessageCollectionViewCellDefaultStyle.swift │ ├── Common │ ├── Alignment.swift │ ├── AnimationUtils.swift │ ├── Bundle+ChattoAdditionsResources.swift │ ├── CALayer+ImageMask.swift │ ├── CGFloat+Additions.swift │ ├── CGPoint+Additions.swift │ ├── CGRect+Additions.swift │ ├── CGSize+Additions.swift │ ├── Cache.swift │ ├── Comparable+Clamp.swift │ ├── HashableRepresentible.swift │ ├── ScreenMetric.swift │ ├── UIColor+Additions.swift │ ├── UIEdgeInsets+Additions.swift │ ├── UIImage+Additions.swift │ ├── UIScreen+Scale.swift │ └── UIView+Additions.swift │ ├── Info.plist │ ├── Input │ ├── ChatInputBar.swift │ ├── ChatInputBar.xib │ ├── ChatInputBarAppearance.swift │ ├── ChatInputBarPresenter.swift │ ├── ChatInputItem.swift │ ├── ChatInputItemView.swift │ ├── ExpandableChatInputBarPresenter.swift │ ├── ExpandableTextView.swift │ ├── HorizontalStackScrollView.swift │ ├── InputContainerView.swift │ ├── InterfaceOrientation.swift │ ├── PasteActionInterceptor.swift │ ├── Photos │ │ ├── Camera │ │ │ ├── DeviceImagePicker.swift │ │ │ ├── ImagePicker.swift │ │ │ ├── LiveCameraCaptureSession.swift │ │ │ ├── LiveCameraCell.swift │ │ │ ├── LiveCameraCellPresenter.swift │ │ │ ├── LiveCameraCellPresenterFactory.swift │ │ │ ├── PhotosInputCameraPicker.swift │ │ │ └── PhotosInputCameraPickerFactory.swift │ │ ├── Photo │ │ │ ├── PhotosInputCell.swift │ │ │ ├── PhotosInputCellProvider.swift │ │ │ └── PhotosInputDataProvider.swift │ │ ├── Photos.xcassets │ │ │ ├── Contents.json │ │ │ ├── camera-icon-selected.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── photo-selected.pdf │ │ │ ├── camera-icon-unselected.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── photo-normal.pdf │ │ │ ├── camera.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── camera.pdf │ │ │ ├── camera_lock.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── camera_lock.pdf │ │ │ ├── lock.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── lock.pdf │ │ │ └── photo-normal.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── photo-normal.pdf │ │ ├── PhotosChatInputItem.swift │ │ ├── PhotosInputPermissionsRequester.swift │ │ ├── PhotosInputView.swift │ │ ├── PhotosInputViewItemSizeCalculator.swift │ │ ├── PhotosInputWithPlaceholdersDataProvider.swift │ │ └── Placeholder │ │ │ ├── PhotosInputPlaceholderCell.swift │ │ │ ├── PhotosInputPlaceholderCellProvider.swift │ │ │ └── PhotosInputPlaceholderDataProvider.swift │ ├── ReusableXibView.swift │ ├── TabInputButton.swift │ └── Text │ │ └── TextChatInputItem.swift │ ├── Resources │ ├── Chat Items │ │ ├── BaseMessage │ │ │ └── Views │ │ │ │ └── BaseMessageAssets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── base-message-checked-icon.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── base-message-checked-icon.pdf │ │ │ │ ├── base-message-failed-icon.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── base-message-failed-icon.pdf │ │ │ │ ├── base-message-unchecked-icon.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── base-message-unchecked-icon.pdf │ │ │ │ ├── bubble-incoming-border-tail.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── bubble-incoming-border-tail@1x.png │ │ │ │ ├── bubble-incoming-border-tail@2x.png │ │ │ │ └── bubble-incoming-border-tail@3x.png │ │ │ │ ├── bubble-incoming-border.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── bubble-incoming-border@1x.png │ │ │ │ ├── bubble-incoming-border@2x.png │ │ │ │ └── bubble-incoming-border@3x.png │ │ │ │ ├── bubble-incoming-tail.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── bubble-incoming-tail.pdf │ │ │ │ ├── bubble-incoming.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── bubble-incoming.pdf │ │ │ │ ├── bubble-outgoing-border-tail.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── bubble-outgoing-border-tail@1x.png │ │ │ │ ├── bubble-outgoing-border-tail@2x.png │ │ │ │ └── bubble-outgoing-border-tail@3x.png │ │ │ │ ├── bubble-outgoing-border.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── bubble-outgoing-border@1x.png │ │ │ │ ├── bubble-outgoing-border@2x.png │ │ │ │ └── bubble-outgoing-border@3x.png │ │ │ │ ├── bubble-outgoing-tail.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── bubble-outgoing-tail.pdf │ │ │ │ └── bubble-outgoing.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── bubble-outgoing.pdf │ │ └── PhotoMessages │ │ │ └── Views │ │ │ └── PhotoMessageAssets.xcassets │ │ │ ├── Contents.json │ │ │ └── photo-bubble-placeholder-icon.imageset │ │ │ ├── Contents.json │ │ │ └── photo-bubble-placeholder-icon.pdf │ ├── Input │ │ └── Text │ │ │ └── Text.xcassets │ │ │ ├── Contents.json │ │ │ ├── text-icon-selected.imageset │ │ │ ├── Contents.json │ │ │ └── text-selected.pdf │ │ │ └── text-icon-unselected.imageset │ │ │ ├── Contents.json │ │ │ └── text-unselected.pdf │ └── UI Components │ │ └── CircleProgressIndicatorView │ │ └── CircleProgressIndicator.xcassets │ │ ├── Contents.json │ │ ├── infinity_icon_norm.imageset │ │ ├── Contents.json │ │ └── infinity_icon_norm@2x.png │ │ ├── tick_viewed_icon_norm.imageset │ │ ├── Contents.json │ │ └── tick_viewed_icon_norm@2x.png │ │ └── warning_icon_norm.imageset │ │ ├── Contents.json │ │ └── warning_icon_norm@2x.png │ └── UI Components │ └── CircleProgressIndicatorView │ ├── CircleIconView.swift │ ├── CircleProgressIndicatorView.swift │ └── CircleProgressView.swift ├── ChattoApp ├── .swift-version ├── .swiftlint.yml ├── ChattoApp.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── ChattoApp.xcscheme ├── ChattoApp.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDETemplateMacros.plist │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── ChattoApp │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-40.png │ │ │ ├── Icon-40@2x-1.png │ │ │ ├── Icon-40@2x.png │ │ │ ├── Icon-40@3x.png │ │ │ ├── Icon-60@2x.png │ │ │ ├── Icon-60@3x.png │ │ │ ├── Icon-76.png │ │ │ ├── Icon-76@2x.png │ │ │ ├── Icon-83.5@2x.png │ │ │ ├── Icon-Small.png │ │ │ ├── Icon-Small@2x-1.png │ │ │ ├── Icon-Small@2x.png │ │ │ └── Icon-Small@3x.png │ │ ├── Contents.json │ │ ├── bubble-incoming-tail-border.imageset │ │ │ ├── Contents.json │ │ │ └── bubble-incoming-tail-border.pdf │ │ ├── pic-test-1.imageset │ │ │ ├── Contents.json │ │ │ └── pic-test-1.jpg │ │ ├── pic-test-2.imageset │ │ │ ├── Contents.json │ │ │ └── pic-test-2.jpg │ │ ├── pic-test-3.imageset │ │ │ ├── Contents.json │ │ │ └── pic-test-3.jpg │ │ ├── reply-indicator.imageset │ │ │ ├── Contents.json │ │ │ └── reply-indicator.pdf │ │ └── userAvatar.imageset │ │ │ ├── Contents.json │ │ │ └── userAvatar.pdf │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── Info.plist │ └── Source │ │ ├── AppDelegate.swift │ │ ├── BaseMessagesSelector.swift │ │ ├── CellsViewController.swift │ │ ├── Chat Items │ │ ├── Base Message │ │ │ ├── BaseMessageCollectionViewCellAvatarStyle.swift │ │ │ ├── Composable │ │ │ │ ├── AsyncImageItem.swift │ │ │ │ ├── CompoundItem.swift │ │ │ │ ├── DummyItem.swift │ │ │ │ └── MessageItem.swift │ │ │ └── DemoMessageInteractionHandler.swift │ │ ├── Compound Messages │ │ │ ├── DemoCompoundMessageModel.swift │ │ │ ├── DemoCompoundMessageViewModel.swift │ │ │ ├── DemoDateMessageContentFactory.swift │ │ │ ├── DemoEmojiDecorationViewFactory.swift │ │ │ ├── DemoImageMessageContentFactory.swift │ │ │ ├── DemoInvisibleSplitterFactory.swift │ │ │ ├── DemoText2MessageContentFactory.swift │ │ │ └── DemoTextMessageContentFactory.swift │ │ ├── Content Aware Input │ │ │ ├── ContentAwareInputItem.swift │ │ │ └── CustomInput.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── custom-icon-selected.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── icons8-input-50-2.png │ │ │ │ └── custom-icon-unselected.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── icons8-input-50-3.png │ │ ├── Photo Messages │ │ │ ├── DemoPhotoMessageModel.swift │ │ │ └── DemoPhotoMessageViewModel.swift │ │ ├── Sending status │ │ │ ├── SendingStatusCollectionViewCell.swift │ │ │ ├── SendingStatusCollectionViewCell.xib │ │ │ └── SendingStatusPresenter.swift │ │ └── Text Messages │ │ │ ├── DemoTextMessageModel.swift │ │ │ └── DemoTextMessageViewModel.swift │ │ ├── Chat View Controllers │ │ ├── AddRandomMessageChatViewController.swift │ │ ├── AsyncAvatarLoadingViewController.swift │ │ ├── DemoChatDataSource.swift │ │ ├── DemoChatItemsDecorator.swift │ │ ├── DemoChatMessageFactory.swift │ │ ├── DemoChatMessageSender.swift │ │ ├── DemoChatViewController.swift │ │ ├── DemoReplyActionHandler.swift │ │ ├── MessagesSelectionChatViewController.swift │ │ ├── ScrollToBottomButtonChatViewController.swift │ │ ├── TestItemsReloadingViewController.swift │ │ └── UpdateItemTypeViewController.swift │ │ ├── ChatExamplesViewController.swift │ │ ├── ChatWithTabBarExamplesViewController.swift │ │ ├── MessagesSelectorProtocol.swift │ │ ├── SlidingDatasSource.swift │ │ └── Time Separator │ │ ├── TimeSeparatorCollectionViewCell.swift │ │ ├── TimeSeparatorModel.swift │ │ └── TimeSeparatorPresenter.swift ├── ChattoAppTests │ ├── Info.plist │ └── SlidingDataSourceTests.swift ├── Podfile ├── Podfile.lock └── Pods │ ├── Local Podspecs │ ├── Chatto.podspec.json │ └── ChattoAdditions.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── Chatto.xcscheme │ │ └── ChattoAdditions.xcscheme │ └── Target Support Files │ ├── Chatto │ ├── Chatto-Info.plist │ ├── Chatto-dummy.m │ ├── Chatto-prefix.pch │ ├── Chatto-umbrella.h │ ├── Chatto.debug.xcconfig │ ├── Chatto.modulemap │ ├── Chatto.release.xcconfig │ ├── Chatto.xcconfig │ └── Info.plist │ ├── ChattoAdditions │ ├── ChattoAdditions-Info.plist │ ├── ChattoAdditions-dummy.m │ ├── ChattoAdditions-prefix.pch │ ├── ChattoAdditions-umbrella.h │ ├── ChattoAdditions.debug.xcconfig │ ├── ChattoAdditions.modulemap │ ├── ChattoAdditions.release.xcconfig │ ├── ChattoAdditions.xcconfig │ ├── Info.plist │ └── ResourceBundle-ChattoAdditionsResources-ChattoAdditions-Info.plist │ └── Pods-ChattoApp │ ├── Info.plist │ ├── Pods-ChattoApp-Info.plist │ ├── Pods-ChattoApp-acknowledgements.markdown │ ├── Pods-ChattoApp-acknowledgements.plist │ ├── Pods-ChattoApp-dummy.m │ ├── Pods-ChattoApp-frameworks.sh │ ├── Pods-ChattoApp-resources.sh │ ├── Pods-ChattoApp-umbrella.h │ ├── Pods-ChattoApp.debug.xcconfig │ ├── Pods-ChattoApp.modulemap │ └── Pods-ChattoApp.release.xcconfig ├── LICENSE ├── Package.swift ├── README.md ├── readme-images ├── readme-pic-1.png ├── readme-pic-2.png ├── readme-pic-3.png └── readme-pic-4.png └── scripts └── test.sh /.codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - "./Chatto/Tests" 3 | - "./ChattoAdditions/Tests" 4 | -------------------------------------------------------------------------------- /.github/workflows/swift.yml: -------------------------------------------------------------------------------- 1 | name: Swift 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | test: 11 | runs-on: macos-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: Test Chatto 15 | run: ./scripts/test.sh chatto 16 | - name: Coverage for Chatto 17 | run: bash <(curl -s https://codecov.io/bash) -J 'Chatto' 18 | - name: Test ChattoAdditions 19 | run: ./scripts/test.sh additions 20 | - name: Coverage for ChattoAdditions 21 | run: bash <(curl -s https://codecov.io/bash) -J 'ChattoAdditions' 22 | - name: Test ChattoApp 23 | run: ./scripts/test.sh app 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | .DS_Store 20 | 21 | # CocoaPods 22 | # 23 | # We recommend against adding the Pods directory to your .gitignore. However 24 | # you should judge for yourself, the pros and cons are mentioned at: 25 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 26 | # 27 | # Pods/ 28 | 29 | # Carthage 30 | # 31 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 32 | # Carthage/Checkouts 33 | 34 | Carthage/Build 35 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | opt_in_rules: 2 | - closure_spacing 3 | - overridden_super_call 4 | - redundant_nil_coalescing 5 | - prohibited_super_call 6 | - explicit_init 7 | disabled_rules: 8 | - file_length 9 | - force_cast 10 | - function_body_length 11 | - line_length 12 | - todo 13 | - type_body_length 14 | - identifier_name 15 | - type_name 16 | - function_parameter_count 17 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name or Organization 3 | # Sorted by number of commits 4 | 5 | Anton Schukin 6 | Diego Sánchez 7 | Victor Shamanov 8 | Mikhail Gasanov 9 | Alexandr Nikishin 10 | Alexander Balaban 11 | Igor Savelev 12 | Igor Kashkuta 13 | Serhii Zabrodko 14 | Zhao Wang 15 | Artyom Loenko 16 | Ruslan Ahapkin 17 | 18 | &yet LLC 19 | Badoo 20 | -------------------------------------------------------------------------------- /Chatto.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "Chatto" 3 | s.version = "4.1.0" 4 | s.summary = "Chat framework in Swift" 5 | s.description = <<-DESC 6 | Lightweight chat framework to build Chat apps 7 | DESC 8 | s.homepage = "https://github.com/badoo/Chatto" 9 | s.license = { :type => "MIT"} 10 | s.platform = :ios, "11.1" 11 | s.authors = { 'Diego Sanchez' => 'diego.sanchezr@gmail.com', 'Anton Schukin' => 'a.p.schukin@gmail.com' } 12 | s.source = { :git => "https://github.com/badoo/Chatto.git", :tag => s.version.to_s } 13 | s.source_files = "Chatto/sources/**/*.{h,m,swift}" 14 | s.public_header_files = "Chatto/sources/**/*.h" 15 | s.requires_arc = true 16 | s.swift_version = '5.3' 17 | end 18 | -------------------------------------------------------------------------------- /Chatto.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Chatto.xcworkspace/xcshareddata/IDETemplateMacros.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FILEHEADER 6 | 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2015-present Badoo Trading Limited. 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // 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 16 | // furnished to do so, subject to the 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 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Chatto.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Chatto/.swiftlint.yml: -------------------------------------------------------------------------------- 1 | ../.swiftlint.yml -------------------------------------------------------------------------------- /Chatto/Chatto.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chatto/Tests/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 | BNDL 17 | CFBundleShortVersionString 18 | 3.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Chatto/sources/ChatController/ChatLayoutConfiguration.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | public protocol ChatLayoutConfigurationProtocol { 28 | var contentInsets: UIEdgeInsets { get } 29 | var scrollIndicatorInsets: UIEdgeInsets { get } 30 | } 31 | 32 | public struct ChatLayoutConfiguration: ChatLayoutConfigurationProtocol { 33 | public let contentInsets: UIEdgeInsets 34 | public let scrollIndicatorInsets: UIEdgeInsets 35 | 36 | public init(contentInsets: UIEdgeInsets, scrollIndicatorInsets: UIEdgeInsets) { 37 | self.contentInsets = contentInsets 38 | self.scrollIndicatorInsets = scrollIndicatorInsets 39 | } 40 | } 41 | 42 | extension ChatLayoutConfiguration { 43 | static var defaultConfiguration: ChatLayoutConfiguration { 44 | let contentInsets = UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 0) 45 | let scrollIndicatorInsets = UIEdgeInsets.zero 46 | return ChatLayoutConfiguration(contentInsets: contentInsets, 47 | scrollIndicatorInsets: scrollIndicatorInsets) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Chatto/sources/ChatController/ChatMessages/ChatMessagesViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Badoo Trading Limited, 2010-present. All rights reserved. 3 | // 4 | 5 | import Foundation 6 | 7 | public typealias BoolBlock = (Bool) -> Void 8 | 9 | public protocol ChatMessagesViewModelProtocol: AnyObject { 10 | var chatItems: [ChatItemProtocol] { get } 11 | var delegate: ChatDataSourceDelegateProtocol? { get set } 12 | var hasMoreNext: Bool { get } 13 | var hasMorePrevious: Bool { get } 14 | 15 | func adjustNumberOfMessages(preferredMaxCount: Int?, focusPosition: Double, completion: BoolBlock) 16 | func loadPrevious() 17 | func loadNext() 18 | } 19 | -------------------------------------------------------------------------------- /Chatto/sources/ChatController/ChatMessages/New/CollectionUpdateProviderProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import UIKit 25 | 26 | public protocol CollectionUpdateProviderProtocol { 27 | func setup(in collectionView: UICollectionView) 28 | func updateCollection(old collection: ChatItemCompanionCollection) -> ChatItemCompanionCollection 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Chatto/sources/ChatController/Collaborators/BaseChatViewControllerView.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | // If you wish to use your custom view instead of BaseChatViewControllerView, you must implement this protocol. 28 | public protocol BaseChatViewControllerViewProtocol: AnyObject { 29 | var bmaInputAccessoryView: UIView? { get set } 30 | } 31 | 32 | // http://stackoverflow.com/questions/24596031/uiviewcontroller-with-inputaccessoryview-is-not-deallocated 33 | final class BaseChatViewControllerView: UIView, BaseChatViewControllerViewProtocol { 34 | 35 | var bmaInputAccessoryView: UIView? 36 | 37 | override var inputAccessoryView: UIView? { 38 | get { 39 | return self.bmaInputAccessoryView 40 | } 41 | set { 42 | self.bmaInputAccessoryView = newValue 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Chatto/sources/ChatController/Collaborators/ChatDataSourceProtocol.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import Foundation 26 | 27 | @frozen 28 | public enum UpdateType: CaseIterable { 29 | case normal 30 | case firstLoad 31 | case firstSync 32 | case pagination 33 | case reload 34 | case messageCountReduction 35 | } 36 | 37 | public protocol ChatDataSourceDelegateProtocol: AnyObject { 38 | func chatDataSourceDidUpdate(_ chatDataSource: ChatDataSourceProtocol) 39 | func chatDataSourceDidUpdate(_ chatDataSource: ChatDataSourceProtocol, updateType: UpdateType) 40 | } 41 | 42 | public protocol ChatDataSourceProtocol: ChatMessagesViewModelProtocol { 43 | var hasMoreNext: Bool { get } 44 | var hasMorePrevious: Bool { get } 45 | var chatItems: [ChatItemProtocol] { get } 46 | var delegate: ChatDataSourceDelegateProtocol? { get set } 47 | 48 | func loadNext() // Should trigger chatDataSourceDidUpdate with UpdateType.Pagination 49 | func loadPrevious() // Should trigger chatDataSourceDidUpdate with UpdateType.Pagination 50 | } 51 | -------------------------------------------------------------------------------- /Chatto/sources/ChatController/Collaborators/ReplyFeedbackGenerator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import UIKit 25 | 26 | public protocol ReplyFeedbackGeneratorProtocol { 27 | func generateFeedback() 28 | } 29 | 30 | public struct ReplyFeedbackGenerator: ReplyFeedbackGeneratorProtocol { 31 | 32 | private let impactFeedbackGenerator: UIImpactFeedbackGenerator 33 | 34 | public init() { 35 | self.impactFeedbackGenerator = UIImpactFeedbackGenerator() 36 | } 37 | 38 | public func generateFeedback() { 39 | self.impactFeedbackGenerator.impactOccurred() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Chatto/sources/ChatController/InputBar/Animations/TimingChatInputBarAnimation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | 25 | import UIKit 26 | 27 | public final class TimingChatInputBarAnimation: ChatInputBarAnimationProtocol { 28 | 29 | let duration: CFTimeInterval 30 | let timingFunction: CAMediaTimingFunction 31 | 32 | public init(duration: CFTimeInterval, 33 | timingFunction: CAMediaTimingFunction) { 34 | self.duration = duration 35 | self.timingFunction = timingFunction 36 | } 37 | 38 | public func animate(view: UIView, completion: (() -> Void)?) { 39 | CATransaction.begin() 40 | CATransaction.setAnimationTimingFunction(self.timingFunction) 41 | UIView.animate( 42 | withDuration: self.duration, 43 | animations: { view.layoutIfNeeded() }, 44 | completion: { _ in } 45 | ) 46 | CATransaction.setCompletionBlock(completion) // this callback is guaranteed to be called 47 | CATransaction.commit() 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Chatto/sources/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 | 4.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Chatto/sources/Utils/Utils.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import Foundation 26 | import UIKit 27 | 28 | private let scale = UIScreen.main.scale 29 | 30 | infix operator >=~ 31 | func >=~ (lhs: CGFloat, rhs: CGFloat) -> Bool { 32 | return round(lhs * scale) >= round(rhs * scale) 33 | } 34 | 35 | extension UIScrollView { 36 | func chatto_setContentInsetAdjustment(enabled: Bool, in viewController: UIViewController) { 37 | self.contentInsetAdjustmentBehavior = enabled ? .always : .never 38 | } 39 | 40 | func chatto_setAutomaticallyAdjustsScrollIndicatorInsets(_ adjusts: Bool) { 41 | if #available(iOS 13.0, *) { 42 | self.automaticallyAdjustsScrollIndicatorInsets = adjusts 43 | } 44 | } 45 | 46 | func chatto_setVerticalScrollIndicatorInsets(_ insets: UIEdgeInsets) { 47 | self.verticalScrollIndicatorInsets = insets 48 | } 49 | } 50 | 51 | extension UICollectionView { 52 | func chatto_setIsPrefetchingEnabled(_ isPrefetchingEnabled: Bool) { 53 | self.isPrefetchingEnabled = isPrefetchingEnabled 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /ChattoAdditions.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "ChattoAdditions" 3 | s.version = "4.1.0" 4 | s.summary = "UI componentes for Chatto" 5 | s.description = <<-DESC 6 | Text and photo bubbles 7 | Input bar for text and photo messages 8 | DESC 9 | s.homepage = "https://github.com/badoo/Chatto" 10 | s.license = { :type => "MIT"} 11 | s.platform = :ios, "11.1" 12 | s.authors = { 'Diego Sanchez' => 'diego.sanchezr@gmail.com', 'Anton Schukin' => 'a.p.schukin@gmail.com' } 13 | s.source = { :git => "https://github.com/badoo/Chatto.git", :tag => s.version.to_s } 14 | s.source_files = "ChattoAdditions/sources/**/*.{h,m,swift}" 15 | s.public_header_files = "ChattoAdditions/sources/**/*.h" 16 | s.requires_arc = true 17 | s.swift_version = '5.3' 18 | s.resource_bundle = { 'ChattoAdditionsResources' => ["ChattoAdditions/sources/**/*.xib", "ChattoAdditions/sources/**/*.storyboard", "ChattoAdditions/sources/**/*.xcassets"] } 19 | s.dependency 'Chatto', s.version.to_s 20 | end 21 | -------------------------------------------------------------------------------- /ChattoAdditions/.swiftlint.yml: -------------------------------------------------------------------------------- 1 | ../.swiftlint.yml -------------------------------------------------------------------------------- /ChattoAdditions/ChattoAdditions.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ChattoAdditions/ChattoAdditionsResources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleIdentifier 8 | $(PRODUCT_BUNDLE_IDENTIFIER) 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | $(PRODUCT_NAME) 13 | CFBundlePackageType 14 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | NSHumanReadableCopyright 20 | Copyright © 2020 Badoo. All rights reserved. 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Chat Items/BaseMessage/DefaultMessageContentPresenterTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | @testable import ChattoAdditions 25 | import XCTest 26 | 27 | final class DefaultMessageContentPresenterTests: XCTestCase { 28 | 29 | func test_WhenPresenterIsUpdatedWithTheSameMessageWithAnotherId_ThenOnMessageUpdateClosureIsCalled_AndItIsCalledWithUpdatedMessage() { 30 | let message = TestHelpers.makeMessage(withId: "123") 31 | let sameMessageWithAnotherId = message.makeSameMessage(butAnotherId: "456") 32 | var isOnMessageUpdateCallsCount = 0 33 | var newMessageOnUpdate: MessageModel! 34 | let presenter = TestHelpers.makeDefaultMessageContentPresenter(with: message, onMessageUpdate: { newMessage in 35 | isOnMessageUpdateCallsCount += 1 36 | newMessageOnUpdate = newMessage 37 | }) 38 | 39 | presenter.updateMessage(sameMessageWithAnotherId) 40 | 41 | XCTAssertEqual(1, isOnMessageUpdateCallsCount) 42 | XCTAssertEqual(sameMessageWithAnotherId.uid, newMessageOnUpdate!.uid) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Chat Items/BaseMessage/FakeMessageModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Foundation 25 | import ChattoAdditions 26 | import Chatto 27 | 28 | final class FakeMessageModel: MessageModelProtocol { 29 | var uid: String = UUID().uuidString 30 | var type: ChatItemType = "fake" 31 | var senderId: String = "" 32 | var isIncoming: Bool = false 33 | var date: Date = Date(timeIntervalSince1970: 0) 34 | var status: MessageStatus = .success 35 | var canReply: Bool = false 36 | } 37 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Chat Items/PhotoMessages/PhotoMessagePresenterBuilderTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import XCTest 26 | @testable import ChattoAdditions 27 | 28 | class PhotoMessagePresenterBuilderTests: XCTestCase { 29 | 30 | func testThat_CreatesPresenter() { 31 | let messageModel = MessageModel(uid: "uid", senderId: "senderId", type: "photo-message", isIncoming: true, date: Date(), status: .success) 32 | let photoMessageModel = PhotoMessageModel(messageModel: messageModel, imageSize: CGSize(width: 30, height: 30), image: UIImage()) 33 | let builder = PhotoMessagePresenterBuilder(viewModelBuilder: PhotoMessageViewModelDefaultBuilder>(), interactionHandler: PhotoMessageTestHandler()) 34 | XCTAssertNotNil(builder.createPresenterWithChatItem(photoMessageModel)) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Chat Items/TextMessages/TextMessagePresenterBuilderTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import XCTest 26 | @testable import ChattoAdditions 27 | 28 | class TextMessagePresenterBuilderTests: XCTestCase { 29 | 30 | func testThat_CreatesPresenter() { 31 | let messageModel = MessageModel(uid: "uid", senderId: "senderId", type: "text-message", isIncoming: true, date: Date(), status: .success) 32 | let textMessageModel = TextMessageModel(messageModel: messageModel, text: "Some text") 33 | let builder = TextMessagePresenterBuilder(viewModelBuilder: TextMessageViewModelDefaultBuilder>(), interactionHandler: TextMessageTestHandler()) 34 | XCTAssertNotNil(builder.createPresenterWithChatItem(textMessageModel)) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Common/CGFloat+AdditionsTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import XCTest 26 | import ChattoAdditions 27 | 28 | class CGFloat_AdditionsTests: XCTestCase { 29 | func testThat_ItRoundsCorrectly() { 30 | let x1Scale: CGFloat = 1 31 | XCTAssertEqual(CGFloat(0.25).bma_round(scale: x1Scale), 1) 32 | 33 | let x2Scale: CGFloat = 2 34 | XCTAssertEqual(CGFloat(0.25).bma_round(scale: x2Scale), 0.5) 35 | 36 | let x3Scale: CGFloat = 3 37 | XCTAssertEqual(CGFloat(0.25).bma_round(scale: x3Scale), 1 / x3Scale) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Common/CGRect+AdditionsTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGRect+AdditionsTests.swift 3 | // ChattoAdditionsTests 4 | // 5 | // Created by Anton Schukin on 23/11/2017. 6 | // Copyright © 2017 Badoo. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class CGRect_AdditionsTests: XCTestCase { 12 | func testThat_ItReturnsCorrectBoundsRect() { 13 | let rect = CGRect(x: 10, y: 10, width: 10, height: 10) 14 | let resultRect = rect.bma_bounds 15 | let expectedRect = CGRect(x: 0, y: 0, width: 10, height: 10) 16 | XCTAssertEqual(resultRect, expectedRect) 17 | } 18 | 19 | func testThat_ItReturnsCorrectCenter() { 20 | let rect = CGRect(x: 10, y: 10, width: 10, height: 10) 21 | let resultCenter = rect.bma_center 22 | let expectedCenter = CGPoint(x: 15, y: 15) 23 | XCTAssertEqual(resultCenter, expectedCenter) 24 | } 25 | 26 | func testThat_WhenMaxYIsSet_ThenOriginChangedCorrectly() { 27 | var rect = CGRect(x: 10, y: 10, width: 10, height: 10) 28 | let newMaxY: CGFloat = 10 29 | rect.bma_maxY = newMaxY 30 | XCTAssertEqual(rect.origin, CGPoint(x: 10, y: 0)) 31 | } 32 | 33 | func testThat_ItRoundsCorrectly() { 34 | let rect = CGRect(x: 0.25, y: 0.25, width: 0.25, height: 0.25) 35 | let x1Scale: CGFloat = 1 36 | XCTAssertEqual(rect.bma_round(scale: x1Scale), CGRect(x: 1, y: 1, width: 1, height: 1)) 37 | 38 | let x2Scale: CGFloat = 2 39 | XCTAssertEqual(rect.bma_round(scale: x2Scale), CGRect(x: 0.5, y: 0.5, width: 0.5, height: 0.5)) 40 | 41 | let x3Scale: CGFloat = 3 42 | XCTAssertEqual(rect.bma_round(scale: x3Scale), CGRect(x: 1/x3Scale, y: 1/x3Scale, width: 1/x3Scale, height: 1/x3Scale)) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Common/UIEdgeInets+AdditionsTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import XCTest 26 | import ChattoAdditions 27 | 28 | class UIEdgeInets_AdditionsTests: XCTestCase { 29 | func testThat_ItReturnsCorrectHorizontalInsets() { 30 | let insets = UIEdgeInsets(top: 1, left: 2, bottom: 3, right: 4) 31 | XCTAssertEqual(insets.bma_horziontalInset, 6) 32 | } 33 | 34 | func testThat_ItReturnsCorrectVerticalInsets() { 35 | let insets = UIEdgeInsets(top: 1, left: 2, bottom: 3, right: 4) 36 | XCTAssertEqual(insets.bma_verticalInset, 4) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/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 | BNDL 17 | CFBundleShortVersionString 18 | 3.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Input/ChatInputItemTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import XCTest 26 | @testable import ChattoAdditions 27 | 28 | class ChatInputItemTests: XCTestCase { 29 | } 30 | 31 | @objc 32 | class MockInputItem: NSObject, ChatInputItemProtocol { 33 | var shouldSaveDraftMessage: Bool = false 34 | var supportsExpandableState: Bool = false 35 | var expandedStateTopMargin: CGFloat = 0.0 36 | var selected = false 37 | var presentationMode: ChatInputItemPresentationMode = .keyboard 38 | var showsSendButton = false 39 | var inputView: UIView? 40 | let tabView = UIView() 41 | 42 | private(set) var handledInput: AnyObject? 43 | func handleInput(_ input: AnyObject) { 44 | self.handledInput = input 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Input/ChatInputItemViewTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import XCTest 26 | @testable import ChattoAdditions 27 | 28 | class ChatInputItemViewTests: XCTestCase { 29 | private var item: ChatInputItemProtocol! 30 | private var itemView: ChatInputItemView! 31 | override func setUp() { 32 | super.setUp() 33 | self.item = MockInputItem() 34 | self.itemView = ChatInputItemView() 35 | self.itemView.inputItem = self.item 36 | } 37 | 38 | func testThat_WhenViewReceivesTap_ItNotifiesDelegate() { 39 | let delegate = MockInputItemViewDelegate() 40 | self.itemView.delegate = delegate 41 | self.itemView.handleTap() 42 | XCTAssertTrue(delegate.itemViewTapped) 43 | } 44 | } 45 | 46 | class MockInputItemViewDelegate: ChatInputItemViewDelegate { 47 | var itemViewTapped = false 48 | func inputItemViewTapped(_ view: ChatInputItemView) { 49 | self.itemViewTapped = true 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Input/PhotosInputPlaceholderDataProviderTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import XCTest 26 | @testable import ChattoAdditions 27 | 28 | class PhotosInputPlaceholderDataProviderTests: XCTestCase { 29 | 30 | func testThat_ProviderWithNumberOfPlaceholder_ThenCountReturnsThisNumber() { 31 | let numberOfPlaceholders = 10 32 | let dataProvider = PhotosInputPlaceholderDataProvider(numberOfPlaceholders: numberOfPlaceholders) 33 | XCTAssertEqual(numberOfPlaceholders, dataProvider.count) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ChattoAdditions/Tests/Input/TextChatInputItemTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import XCTest 26 | @testable import ChattoAdditions 27 | 28 | class TextChatInputItemTests: XCTestCase { 29 | private var inputItem: TextChatInputItem! 30 | override func setUp() { 31 | super.setUp() 32 | self.inputItem = TextChatInputItem() 33 | } 34 | 35 | func testThat_SendButtonEnabledForTextInputItem() { 36 | XCTAssertTrue(self.inputItem.showsSendButton) 37 | } 38 | 39 | func testThat_InputViewIsEmpty() { 40 | XCTAssertNil(self.inputItem.inputView) 41 | } 42 | 43 | func testThat_GivenItemHasTextInputHandler_WhenInputIsString_ItemHandlesInput() { 44 | var handled = false 45 | self.inputItem.textInputHandler = { text in 46 | handled = true 47 | } 48 | self.inputItem.handleInput("text" as AnyObject) 49 | XCTAssertTrue(handled) 50 | } 51 | 52 | func testThat_GivenItemHasTextInputHandler_WhenInputIsNotString_ItemDoesntHandleInput() { 53 | var handled = false 54 | self.inputItem.textInputHandler = { text in 55 | handled = true 56 | } 57 | self.inputItem.handleInput(5 as AnyObject) 58 | XCTAssertFalse(handled) 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/BaseMessage/Views/ViewDefinitions.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | public enum ViewContext { 28 | case normal 29 | case sizing // You may skip some cell updates for faster sizing 30 | } 31 | 32 | public protocol MaximumLayoutWidthSpecificable { 33 | var preferredMaxLayoutWidth: CGFloat { get set } 34 | } 35 | 36 | public protocol BackgroundSizingQueryable { 37 | var canCalculateSizeInBackground: Bool { get } 38 | } 39 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/BaseViewComposition.swift: -------------------------------------------------------------------------------- 1 | 2 | public protocol BaseViewComposition { 3 | associatedtype View 4 | } 5 | 6 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/BindingKey.swift: -------------------------------------------------------------------------------- 1 | 2 | import Foundation 3 | 4 | // MARK: - Protocol 5 | 6 | public protocol BindingKeyProtocol: Hashable, CustomStringConvertible { 7 | associatedtype View 8 | associatedtype ViewModel 9 | associatedtype LayoutProvider: LayoutProviderProtocol 10 | var uuid: UUID { get } 11 | } 12 | 13 | // MARK: - Implementation 14 | 15 | public struct BindingKey: BindingKeyProtocol { 16 | public let uuid = UUID() 17 | public var description: String { "BindingKey<\(View.self),\(ViewModel.self),\(LayoutProvider.self)>" } 18 | } 19 | 20 | // MARK: - Type erasure 21 | 22 | public struct AnyBindingKey: Hashable, CustomStringConvertible { 23 | 24 | let uuid: UUID 25 | 26 | // MARK: - Private properties 27 | 28 | private let viewType: Any.Type 29 | private let viewModelType: Any.Type 30 | private let layoutProviderType: Any.Type 31 | private let _description: () -> String 32 | 33 | // MARK: - Instantiation 34 | 35 | public init(_ base: Base) { 36 | self.viewType = Base.View.self 37 | self.viewModelType = Base.ViewModel.self 38 | self.layoutProviderType = Base.LayoutProvider.self 39 | self.uuid = base.uuid 40 | self._description = { base.description } 41 | } 42 | 43 | // MARK: - Hashable 44 | 45 | public func hash(into hasher: inout Hasher) { 46 | hasher.combine(self.uuid) 47 | hasher.combine(ObjectIdentifier(self.viewType)) 48 | hasher.combine(ObjectIdentifier(self.viewModelType)) 49 | hasher.combine(ObjectIdentifier(self.layoutProviderType)) 50 | } 51 | 52 | // MARK: - Equatable 53 | 54 | public static func == (lhs: AnyBindingKey, rhs: AnyBindingKey) -> Bool { 55 | return lhs.viewType == rhs.viewType 56 | && lhs.viewModelType == rhs.viewModelType 57 | && lhs.layoutProviderType == rhs.layoutProviderType 58 | && lhs.uuid == rhs.uuid 59 | } 60 | 61 | // MARK: - CustomStringConvertible 62 | 63 | public var description: String { self._description() } 64 | } 65 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/ChatItemCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import UIKit 25 | 26 | public final class ChatItemCell: UICollectionViewCell { 27 | 28 | public var indexed: AnyIndexedSubviews? { 29 | didSet { 30 | guard oldValue == nil else { return } 31 | guard let subviews = self.indexed else { fatalError() } 32 | self.setup(subviews: subviews) 33 | } 34 | } 35 | 36 | private func setup(subviews: AnyIndexedSubviews) { 37 | let subview = subviews.root 38 | subview.translatesAutoresizingMaskIntoConstraints = false 39 | self.contentView.addSubview(subview) 40 | NSLayoutConstraint.activate([ 41 | subview.leadingAnchor.constraint(equalTo: self.contentView.leadingAnchor), 42 | subview.trailingAnchor.constraint(equalTo: self.contentView.trailingAnchor), 43 | subview.topAnchor.constraint(equalTo: self.contentView.topAnchor), 44 | subview.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor) 45 | ]) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/ChatItemContentView.swift: -------------------------------------------------------------------------------- 1 | 2 | public protocol ChatItemContentView: AnyObject { 3 | associatedtype ViewModel 4 | func subscribe(for viewModel: ViewModel) 5 | } 6 | 7 | // MARK: - Automatic binding 8 | 9 | private struct ChatItemContentViewModelBinding: ViewModelBinding { 10 | func bind(view: View, to viewModel: View.ViewModel) { 11 | view.subscribe(for: viewModel) 12 | } 13 | } 14 | 15 | public extension Binder { 16 | mutating func registerBinding(for key: Key) where Key.View: ChatItemContentView, Key.ViewModel == Key.View.ViewModel { 17 | self.register(binding: ChatItemContentViewModelBinding(), for: key) 18 | } 19 | } 20 | 21 | 22 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/ChatItemLifecycleViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | public protocol ChatItemLifecycleViewModel { 25 | func willShow() 26 | } 27 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/ContainerViewProtocols.swift: -------------------------------------------------------------------------------- 1 | 2 | import UIKit 3 | 4 | public protocol SingleContainerViewProtocol { 5 | func add(child view: UIView) 6 | } 7 | 8 | public protocol MultipleContainerViewProtocol { 9 | func add(children: [UIView]) 10 | } 11 | 12 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/IndexedSubviews.swift: -------------------------------------------------------------------------------- 1 | 2 | import UIKit 3 | 4 | public struct IndexedSubviews { 5 | let rootKey: Key 6 | let subviews: [Key: UIView] 7 | 8 | var root: UIView { self.subviews[self.rootKey]! } 9 | } 10 | 11 | public typealias AnyIndexedSubviews = IndexedSubviews 12 | 13 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/Layout/LayoutContext.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import UIKit 25 | 26 | public struct LayoutContext { 27 | public var maxWidth: CGFloat 28 | public init(maxWidth: CGFloat) { 29 | self.maxWidth = maxWidth 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/Layout/LayoutModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | public protocol LayoutModel: SizeContainer {} 25 | 26 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/Layout/LayoutProviderContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | public enum LayoutProviderDependencyError: Error { 25 | case noChild 26 | case noChildren 27 | } 28 | 29 | public protocol SingleContainerLayoutProviderProtocol { 30 | typealias Child = AnySizeProvider 31 | var childLayoutProvider: Child? { get set } 32 | } 33 | 34 | public protocol MultipleContainerLayoutProviderProtocol { 35 | typealias Child = AnySizeProvider 36 | var childrenLayoutProviders: [Child]? { get set } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/Layout/LayoutProviderFactoryProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | public protocol LayoutProviderFactoryProtocol { 25 | associatedtype ViewModel 26 | associatedtype LayoutProvider: LayoutProviderProtocol 27 | func makeLayoutProvider(for viewModel: ViewModel) -> LayoutProvider 28 | } 29 | 30 | public struct AnyLayoutProviderFactory { 31 | 32 | private let _makeLayoutProvider: (Any) -> Any 33 | 34 | public init(_ base: Base) { 35 | self._makeLayoutProvider = { anyViewModel in 36 | guard let viewModel = anyViewModel as? Base.ViewModel else { 37 | fatalError() 38 | } 39 | return base.makeLayoutProvider(for: viewModel) 40 | } 41 | } 42 | 43 | public func makeLayoutProvider(for viewModel: Any) -> Any { 44 | self._makeLayoutProvider(viewModel) 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/Layout/ManualLayoutViewProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | public protocol ManualLayoutViewProtocol { 25 | associatedtype Layout 26 | // TODO: Make throwing #744 27 | func apply(layout: Layout) 28 | } 29 | 30 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/Layout/SizeContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import UIKit 25 | 26 | public protocol SizeContainer { 27 | var size: CGSize { get } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/MultipleViewComposition.swift: -------------------------------------------------------------------------------- 1 | 2 | import UIKit 3 | 4 | public protocol MultipleViewComposition: BaseViewComposition { 5 | func add(children: [UIView], to: View) 6 | } 7 | 8 | public struct AnyMultipleViewComposition: MultipleViewComposition { 9 | 10 | private let _add: ([UIView], Any) -> Void 11 | 12 | public init(_ base: Base) { 13 | self._add = { views, any in 14 | guard let to = any as? Base.View else { fatalError() } 15 | base.add(children: views, to: to) 16 | } 17 | } 18 | 19 | // MARK: - MultipleViewComposition 20 | 21 | public typealias View = Any 22 | 23 | public func add(children: [UIView], to: View) { 24 | self._add(children, to) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/ReuseIdentifierProvider.swift: -------------------------------------------------------------------------------- 1 | 2 | protocol ReuseIdentifierProvider { 3 | var reuseIdentifier: String { get } 4 | } 5 | 6 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/SingleViewComposition.swift: -------------------------------------------------------------------------------- 1 | 2 | import UIKit 3 | 4 | public protocol SingleViewComposition: BaseViewComposition { 5 | func add(child: UIView, to: View) 6 | } 7 | 8 | public struct AnySingleViewComposition: SingleViewComposition { 9 | 10 | private let _add: (UIView, Any) -> Void 11 | 12 | public init(_ base: Base) { 13 | self._add = { view, any in 14 | guard let to = any as? Base.View else { fatalError() } 15 | base.add(child: view, to: to) 16 | } 17 | } 18 | 19 | // MARK: - SingleViewComposition 20 | 21 | public typealias View = Any 22 | 23 | public func add(child: UIView, to: View) { 24 | self._add(child, to) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/ViewFactoryProtocol.swift: -------------------------------------------------------------------------------- 1 | 2 | import UIKit 3 | 4 | public protocol ViewFactoryProtocol { 5 | associatedtype View: UIView 6 | func makeView() -> View 7 | } 8 | 9 | public struct AnyViewFactory: ViewFactoryProtocol { 10 | 11 | private let _makeView: () -> UIView 12 | 13 | public init(_ base: Base) { 14 | self._makeView = { base.makeView() } 15 | } 16 | 17 | public func makeView() -> UIView { 18 | self._makeView() 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/ViewModelBinding.swift: -------------------------------------------------------------------------------- 1 | 2 | // MARK: - Protocol 3 | 4 | public protocol ViewModelBinding { 5 | associatedtype View 6 | associatedtype ViewModel 7 | func bind(view: View, to viewModel: ViewModel) 8 | } 9 | 10 | // MARK: - Type Erased 11 | 12 | public final class AnyViewModelBinding { 13 | 14 | public enum Error: Swift.Error { 15 | case typeMismatch(Any.Type, Any.Type) 16 | } 17 | 18 | private let _bind: (Any, Any) throws -> Void 19 | 20 | public init(_ base: Base) { 21 | self._bind = { anyView, anyViewModel in 22 | guard let view = anyView as? Base.View else { 23 | throw Error.typeMismatch(type(of: anyView), Base.View.self) 24 | } 25 | guard let viewModel = anyViewModel as? Base.ViewModel else { 26 | throw Error.typeMismatch(type(of: anyViewModel), Base.ViewModel.self) 27 | } 28 | base.bind(view: view, to: viewModel) 29 | } 30 | } 31 | 32 | public func bind(view: Any, to viewModel: Any) throws { 33 | try self._bind(view, viewModel) 34 | } 35 | } 36 | 37 | // MARK: - Block based 38 | 39 | public struct BlockBinding: ViewModelBinding { 40 | 41 | public typealias Block = (View, ViewModel) -> Void 42 | private let block: Block 43 | 44 | public init(block: @escaping Block) { 45 | self.block = block 46 | } 47 | 48 | public func bind(view: View, to viewModel: ViewModel) { 49 | self.block(view, viewModel) 50 | } 51 | } 52 | 53 | extension Binder { 54 | public mutating func registerBlockBinding(for key: Key, block: @escaping (Key.View, Key.ViewModel) -> Void) { 55 | self.register(binding: BlockBinding(block: block), for: key) 56 | } 57 | } 58 | 59 | // MARK: - Noop 60 | 61 | public struct NoopBinding: ViewModelBinding { 62 | public func bind(view: View, to viewModel: ViewModel) {} 63 | } 64 | 65 | extension Binder { 66 | public mutating func registerNoopBinding(for key: Key) { 67 | self.register(binding: NoopBinding(), for: key) 68 | } 69 | } 70 | 71 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/Composable/ViewModelFactoryProtocol.swift: -------------------------------------------------------------------------------- 1 | 2 | public protocol ViewModelFactoryProtocol { 3 | associatedtype ChatItem 4 | associatedtype ViewModel 5 | func makeViewModel(for item: ChatItem) -> ViewModel 6 | } 7 | 8 | public struct AnyViewModelFactory: ViewModelFactoryProtocol { 9 | 10 | private let _makeViewModel: (ChatItem) -> Any 11 | 12 | public init(_ base: Base) where Base.ChatItem == ChatItem { 13 | self._makeViewModel = { item in 14 | base.makeViewModel(for: item) 15 | } 16 | } 17 | 18 | public func makeViewModel(for item: ChatItem) -> Any { 19 | self._makeViewModel(item) 20 | } 21 | } 22 | 23 | public struct VoidViewModelFactory: ViewModelFactoryProtocol { 24 | public init() {} 25 | public func makeViewModel(for item: ChatItem) {} 26 | } 27 | 28 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/CompoundMessage/Decoration/MessageDecorationViewLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import UIKit 25 | 26 | public struct MessageDecorationViewLayout { 27 | let frame: CGRect 28 | public init(frame: CGRect) { 29 | self.frame = frame 30 | } 31 | } 32 | 33 | public protocol MessageDecorationViewLayoutProviderProtocol: HashableRepresentible { 34 | func makeLayout(from bubbleBounds: CGRect) -> MessageDecorationViewLayout 35 | var safeAreaInsets: UIEdgeInsets { get } 36 | } 37 | 38 | extension MessageDecorationViewLayoutProviderProtocol { 39 | public var safeAreaInsets: UIEdgeInsets { .zero } 40 | } 41 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Chat Items/TextMessages/TextMessageModel.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import Foundation 26 | import Chatto 27 | 28 | public protocol TextMessageModelProtocol: DecoratedMessageModelProtocol, ContentEquatableChatItemProtocol { 29 | var text: String { get } 30 | } 31 | 32 | open class TextMessageModel: TextMessageModelProtocol { 33 | public var messageModel: MessageModelProtocol { 34 | return self._messageModel 35 | } 36 | public let _messageModel: MessageModelT // Can't make messasgeModel: MessageModelT: https://gist.github.com/diegosanchezr/5a66c7af862e1117b556 37 | public var canReply: Bool { self.messageModel.canReply } 38 | public let text: String 39 | public init(messageModel: MessageModelT, text: String) { 40 | self._messageModel = messageModel 41 | self.text = text 42 | } 43 | public func hasSameContent(as anotherItem: ChatItemProtocol) -> Bool { 44 | guard let anotherMessageModel = anotherItem as? TextMessageModel else { return false } 45 | return self.text == anotherMessageModel.text 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/Alignment.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | @frozen 26 | public enum HorizontalAlignment { 27 | case left 28 | case center 29 | case right 30 | } 31 | 32 | @frozen 33 | public enum VerticalAlignment { 34 | case top 35 | case center 36 | case bottom 37 | } 38 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/AnimationUtils.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | public extension CABasicAnimation { 28 | class func bma_fadeInAnimationWithDuration(_ duration: CFTimeInterval) -> CABasicAnimation { 29 | let animation = CABasicAnimation(keyPath: "opacity") 30 | animation.duration = duration 31 | animation.fromValue = 0 32 | animation.toValue = 1 33 | animation.fillMode = .forwards 34 | animation.isAdditive = false 35 | return animation 36 | } 37 | } 38 | 39 | public extension CATransaction { 40 | static func performWithDisabledActions(block: () -> Void) { 41 | self.begin() 42 | self.setDisableActions(true) 43 | block() 44 | self.commit() 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/Bundle+ChattoAdditionsResources.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Foundation 25 | 26 | extension Bundle { 27 | static let resources: Bundle = { 28 | let bundle = Bundle(for: BundleToken.self) 29 | #if SWIFT_PACKAGE 30 | return Bundle.module 31 | #else 32 | let path = bundle.path(forResource: "ChattoAdditionsResources", ofType: "bundle") 33 | return Bundle(path: path!)! 34 | #endif 35 | }() 36 | } 37 | 38 | private class BundleToken {} 39 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/CGFloat+Additions.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import CoreGraphics 26 | 27 | public extension CGFloat { 28 | func bma_round(scale: CGFloat = UIMainScreenScale) -> CGFloat { 29 | return ceil(self * scale) * (1.0 / scale) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/CGPoint+Additions.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import CoreGraphics 26 | 27 | public extension CGPoint { 28 | func bma_offsetBy(dx: CGFloat, dy: CGFloat) -> CGPoint { 29 | return CGPoint(x: self.x + dx, y: self.y + dy) 30 | } 31 | } 32 | 33 | extension CGPoint { 34 | func clamped(to rect: CGRect) -> CGPoint { 35 | return CGPoint( 36 | x: self.x.clamped(to: rect.minX...rect.maxX), 37 | y: self.y.clamped(to: rect.minY...rect.maxY) 38 | ) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/CGRect+Additions.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import CoreGraphics 26 | 27 | public extension CGRect { 28 | var bma_bounds: CGRect { 29 | return CGRect(origin: CGPoint.zero, size: self.size) 30 | } 31 | 32 | var bma_center: CGPoint { 33 | return CGPoint(x: self.midX, y: self.midY) 34 | } 35 | 36 | var bma_maxY: CGFloat { 37 | get { 38 | return self.maxY 39 | } set { 40 | let delta = newValue - self.maxY 41 | self.origin = self.origin.bma_offsetBy(dx: 0, dy: delta) 42 | } 43 | } 44 | 45 | func bma_round(scale: CGFloat = UIMainScreenScale) -> CGRect { 46 | let origin = CGPoint(x: self.origin.x.bma_round(scale: scale), y: self.origin.y.bma_round(scale: scale)) 47 | return CGRect(origin: origin, size: self.size.bma_round(scale: scale)) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/Cache.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Foundation 25 | 26 | public struct Cache { 27 | 28 | private let cache = NSCache() 29 | 30 | public init() {} 31 | 32 | public subscript(key: Key) -> Value? { 33 | get { 34 | return self.cache.object(forKey: key as AnyObject) as! Value? 35 | } 36 | nonmutating set { 37 | if let value = newValue { 38 | self.cache.setObject(value as AnyObject, forKey: key as AnyObject) 39 | } else { 40 | self.cache.removeObject(forKey: key as AnyObject) 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/Comparable+Clamp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Foundation 25 | 26 | extension Comparable { 27 | func clamped(to range: ClosedRange) -> Self { 28 | return max(range.lowerBound, min(range.upperBound, self)) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/HashableRepresentible.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | public protocol HashableRepresentible { 25 | var asHashable: AnyHashable { get } 26 | } 27 | 28 | public extension HashableRepresentible where Self: Hashable { 29 | var asHashable: AnyHashable { 30 | return AnyHashable(self) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/UIColor+Additions.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | public extension UIColor { 28 | static func bma_color(rgb: Int) -> UIColor { 29 | return UIColor(red: CGFloat((rgb & 0xFF0000) >> 16) / 255.0, green: CGFloat((rgb & 0xFF00) >> 8) / 255.0, blue: CGFloat((rgb & 0xFF)) / 255.0, alpha: 1.0) 30 | } 31 | 32 | func bma_blendWithColor(_ color: UIColor) -> UIColor { 33 | var r1: CGFloat = 0, r2: CGFloat = 0 34 | var g1: CGFloat = 0, g2: CGFloat = 0 35 | var b1: CGFloat = 0, b2: CGFloat = 0 36 | var a1: CGFloat = 0, a2: CGFloat = 0 37 | self.getRed(&r1, green: &g1, blue: &b1, alpha: &a1) 38 | color.getRed(&r2, green: &g2, blue: &b2, alpha: &a2) 39 | let alpha = a2, beta = 1 - alpha 40 | let r = r1 * beta + r2 * alpha 41 | let g = g1 * beta + g2 * alpha 42 | let b = b1 * beta + b2 * alpha 43 | return UIColor(red: r, green: g, blue: b, alpha: 1) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/UIEdgeInsets+Additions.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | import CoreGraphics 27 | 28 | public extension UIEdgeInsets { 29 | var bma_horziontalInset: CGFloat { 30 | return self.left + self.right 31 | } 32 | 33 | var bma_verticalInset: CGFloat { 34 | return self.top + self.bottom 35 | } 36 | } 37 | 38 | extension UIEdgeInsets: Hashable { 39 | public func hash(into hasher: inout Hasher) { 40 | hasher.combine(self.top) 41 | hasher.combine(self.left) 42 | hasher.combine(self.bottom) 43 | hasher.combine(self.right) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/UIScreen+Scale.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | public let UIMainScreenScale = UIScreen.main.scale 28 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Common/UIView+Additions.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | public extension UIView { 28 | var bma_rect: CGRect { 29 | get { 30 | return CGRect(origin: CGPoint(x: self.center.x - self.bounds.width / 2, y: self.center.y - self.bounds.height), size: self.bounds.size) 31 | } 32 | set { 33 | let roundedRect = newValue.bma_round() 34 | self.bounds = roundedRect.bma_bounds 35 | self.center = roundedRect.bma_center 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/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 | 4.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/ChatInputItem.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | public enum ChatInputItemPresentationMode: UInt { 28 | case keyboard 29 | case customView 30 | case none 31 | } 32 | 33 | public protocol ChatInputItemProtocol: AnyObject { 34 | var tabView: UIView { get } 35 | var inputView: UIView? { get } 36 | var presentationMode: ChatInputItemPresentationMode { get } 37 | var showsSendButton: Bool { get } 38 | var selected: Bool { get set } 39 | 40 | var supportsExpandableState: Bool { get } 41 | var expandedStateTopMargin: CGFloat { get } 42 | var shouldSaveDraftMessage: Bool { get } 43 | 44 | func handleInput(_ input: AnyObject) 45 | } 46 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/InputContainerView.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | open class InputContainerView: UIInputView { 28 | 29 | public var contentHeight: CGFloat = 0 { 30 | didSet { 31 | self.invalidateIntrinsicContentSize() 32 | } 33 | } 34 | 35 | public var contentView: UIView? { 36 | willSet { 37 | self.contentView?.removeFromSuperview() 38 | } 39 | didSet { 40 | if let contentView = self.contentView { 41 | contentView.frame = self.bounds 42 | self.addSubview(contentView) 43 | self.setNeedsLayout() 44 | } 45 | } 46 | } 47 | 48 | override open func layoutSubviews() { 49 | super.layoutSubviews() 50 | self.contentView?.frame = self.bounds 51 | } 52 | 53 | override open var intrinsicContentSize: CGSize { 54 | return CGSize(width: UIView.noIntrinsicMetric, height: self.contentHeight) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/InterfaceOrientation.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | extension UIScreen { 28 | var portraitOrientation: Bool { 29 | let point = coordinateSpace.convert(CGPoint.zero, to: fixedCoordinateSpace) 30 | return (point.x == 0 && point.y == 0) || (point.x != 0 && point.y != 0) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/PasteActionInterceptor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Foundation 25 | 26 | public protocol PasteActionInterceptor { 27 | func canPerformPaste(withSender sender: Any?) -> Bool 28 | /// If action wasn't handeled by interceptor, original implementation will be used instead 29 | func performPaste() -> Bool 30 | } 31 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Camera/ImagePicker.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | public protocol ImagePickerDelegate: AnyObject { 28 | func imagePickerDidFinish(_ picker: ImagePicker, mediaInfo: [UIImagePickerController.InfoKey: Any]) 29 | func imagePickerDidCancel(_ picker: ImagePicker) 30 | } 31 | 32 | public protocol ImagePicker: AnyObject { 33 | var controller: UIViewController { get } 34 | var cameraType: CameraType { get } 35 | } 36 | 37 | public protocol ImagePickerFactory: AnyObject { 38 | func makeImagePicker(delegate: ImagePickerDelegate) -> ImagePicker? 39 | } 40 | 41 | public struct ImagePickerStore { 42 | public static var factory: ImagePickerFactory = DeviceImagePickerFactory() 43 | } 44 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Camera/PhotosInputCameraPickerFactory.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | public protocol PhotosInputCameraPickerFactoryProtocol { 28 | func makePhotosInputCameraPicker() -> PhotosInputCameraPickerProtocol 29 | } 30 | 31 | public struct PhotosInputCameraPickerFactory: PhotosInputCameraPickerFactoryProtocol { 32 | 33 | public typealias ViewControllerProvider = () -> UIViewController? 34 | 35 | private var presentingViewControllerProvider: ViewControllerProvider 36 | 37 | public init(presentingViewControllerProvider: @escaping ViewControllerProvider) { 38 | self.presentingViewControllerProvider = presentingViewControllerProvider 39 | } 40 | 41 | public func makePhotosInputCameraPicker() -> PhotosInputCameraPickerProtocol { 42 | return PhotosInputCameraPicker( 43 | presentingController: self.presentingViewControllerProvider() 44 | ) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera-icon-selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "photo-selected.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera-icon-selected.imageset/photo-selected.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera-icon-selected.imageset/photo-selected.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera-icon-unselected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "photo-normal.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera-icon-unselected.imageset/photo-normal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera-icon-unselected.imageset/photo-normal.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "camera.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera.imageset/camera.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera.imageset/camera.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera_lock.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "camera_lock.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera_lock.imageset/camera_lock.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Input/Photos/Photos.xcassets/camera_lock.imageset/camera_lock.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/lock.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "lock.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/lock.imageset/lock.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Input/Photos/Photos.xcassets/lock.imageset/lock.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/photo-normal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "photo-normal.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Photos.xcassets/photo-normal.imageset/photo-normal.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Input/Photos/Photos.xcassets/photo-normal.imageset/photo-normal.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/PhotosInputViewItemSizeCalculator.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | struct PhotosInputViewItemSizeCalculator { 28 | var itemsPerRow: Int = 0 29 | var interitemSpace: CGFloat = 0 30 | 31 | func itemSizeForWidth(_ width: CGFloat, atIndex index: Int) -> CGSize { 32 | let availableWidth = width - self.interitemSpace * CGFloat((self.itemsPerRow - 1)) 33 | if availableWidth <= 0 { 34 | return CGSize.zero 35 | } 36 | 37 | var itemWidth = Int(floor(availableWidth / CGFloat(self.itemsPerRow))) 38 | let itemHeigth = itemWidth 39 | let extraPixels = Int(availableWidth) % self.itemsPerRow 40 | let isItemWithExtraPixel = index % self.itemsPerRow < extraPixels 41 | if isItemWithExtraPixel { 42 | itemWidth += 1 43 | } 44 | return CGSize(width: itemWidth, height: itemHeigth) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Input/Photos/Placeholder/PhotosInputPlaceholderCellProvider.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | final class PhotosInputPlaceholderCellProvider: PhotosInputCellProviderProtocol { 28 | private let reuseIdentifier = "PhotosPlaceholderCellProvider" 29 | private let collectionView: UICollectionView 30 | init(collectionView: UICollectionView) { 31 | self.collectionView = collectionView 32 | self.collectionView.register(PhotosInputPlaceholderCell.self, forCellWithReuseIdentifier: self.reuseIdentifier) 33 | } 34 | 35 | func cellForItem(at indexPath: IndexPath) -> UICollectionViewCell { 36 | return self.collectionView.dequeueReusableCell(withReuseIdentifier: self.reuseIdentifier, for: indexPath) 37 | } 38 | 39 | func configureFullImageLoadingIndicator(at indexPath: IndexPath, 40 | request: PhotosInputDataProviderImageRequestProtocol) { 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/base-message-checked-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "base-message-checked-icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/base-message-checked-icon.imageset/base-message-checked-icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/base-message-checked-icon.imageset/base-message-checked-icon.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/base-message-failed-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "base-message-failed-icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/base-message-failed-icon.imageset/base-message-failed-icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/base-message-failed-icon.imageset/base-message-failed-icon.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/base-message-unchecked-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "base-message-unchecked-icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/base-message-unchecked-icon.imageset/base-message-unchecked-icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/base-message-unchecked-icon.imageset/base-message-unchecked-icon.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border-tail.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "resizing" : { 5 | "mode" : "9-part", 6 | "center" : { 7 | "mode" : "stretch", 8 | "width" : 1, 9 | "height" : 1 10 | }, 11 | "cap-insets" : { 12 | "bottom" : 16, 13 | "top" : 16, 14 | "right" : 16, 15 | "left" : 20 16 | } 17 | }, 18 | "idiom" : "universal", 19 | "filename" : "bubble-incoming-border-tail@1x.png", 20 | "scale" : "1x" 21 | }, 22 | { 23 | "resizing" : { 24 | "mode" : "9-part", 25 | "center" : { 26 | "mode" : "stretch", 27 | "width" : 1, 28 | "height" : 1 29 | }, 30 | "cap-insets" : { 31 | "bottom" : 33, 32 | "top" : 32, 33 | "right" : 33, 34 | "left" : 40 35 | } 36 | }, 37 | "idiom" : "universal", 38 | "filename" : "bubble-incoming-border-tail@2x.png", 39 | "scale" : "2x" 40 | }, 41 | { 42 | "resizing" : { 43 | "mode" : "9-part", 44 | "center" : { 45 | "mode" : "stretch", 46 | "width" : 1, 47 | "height" : 1 48 | }, 49 | "cap-insets" : { 50 | "bottom" : 49, 51 | "top" : 49, 52 | "right" : 50, 53 | "left" : 60 54 | } 55 | }, 56 | "idiom" : "universal", 57 | "filename" : "bubble-incoming-border-tail@3x.png", 58 | "scale" : "3x" 59 | } 60 | ], 61 | "info" : { 62 | "version" : 1, 63 | "author" : "xcode" 64 | } 65 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border-tail.imageset/bubble-incoming-border-tail@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border-tail.imageset/bubble-incoming-border-tail@1x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border-tail.imageset/bubble-incoming-border-tail@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border-tail.imageset/bubble-incoming-border-tail@2x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border-tail.imageset/bubble-incoming-border-tail@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border-tail.imageset/bubble-incoming-border-tail@3x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "resizing" : { 5 | "mode" : "9-part", 6 | "center" : { 7 | "mode" : "stretch", 8 | "width" : 1, 9 | "height" : 1 10 | }, 11 | "cap-insets" : { 12 | "bottom" : 16, 13 | "top" : 16, 14 | "right" : 16, 15 | "left" : 20 16 | } 17 | }, 18 | "idiom" : "universal", 19 | "filename" : "bubble-incoming-border@1x.png", 20 | "scale" : "1x" 21 | }, 22 | { 23 | "resizing" : { 24 | "mode" : "9-part", 25 | "center" : { 26 | "mode" : "tile", 27 | "width" : 1, 28 | "height" : 1 29 | }, 30 | "cap-insets" : { 31 | "bottom" : 33, 32 | "top" : 32, 33 | "right" : 33, 34 | "left" : 40 35 | } 36 | }, 37 | "idiom" : "universal", 38 | "filename" : "bubble-incoming-border@2x.png", 39 | "scale" : "2x" 40 | }, 41 | { 42 | "resizing" : { 43 | "mode" : "9-part", 44 | "center" : { 45 | "mode" : "stretch", 46 | "width" : 1, 47 | "height" : 1 48 | }, 49 | "cap-insets" : { 50 | "bottom" : 49, 51 | "top" : 49, 52 | "right" : 50, 53 | "left" : 60 54 | } 55 | }, 56 | "idiom" : "universal", 57 | "filename" : "bubble-incoming-border@3x.png", 58 | "scale" : "3x" 59 | } 60 | ], 61 | "info" : { 62 | "version" : 1, 63 | "author" : "xcode" 64 | } 65 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border.imageset/bubble-incoming-border@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border.imageset/bubble-incoming-border@1x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border.imageset/bubble-incoming-border@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border.imageset/bubble-incoming-border@2x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border.imageset/bubble-incoming-border@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-border.imageset/bubble-incoming-border@3x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-tail.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bubble-incoming-tail.pdf", 6 | "resizing" : { 7 | "mode" : "9-part", 8 | "center" : { 9 | "mode" : "stretch", 10 | "width" : 1, 11 | "height" : 1 12 | }, 13 | "cap-insets" : { 14 | "bottom" : 16, 15 | "top" : 16, 16 | "right" : 16, 17 | "left" : 20 18 | } 19 | } 20 | } 21 | ], 22 | "info" : { 23 | "version" : 1, 24 | "author" : "xcode" 25 | } 26 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-tail.imageset/bubble-incoming-tail.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming-tail.imageset/bubble-incoming-tail.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bubble-incoming.pdf", 6 | "resizing" : { 7 | "mode" : "9-part", 8 | "center" : { 9 | "mode" : "stretch", 10 | "width" : 1, 11 | "height" : 1 12 | }, 13 | "cap-insets" : { 14 | "bottom" : 16, 15 | "top" : 16, 16 | "right" : 16, 17 | "left" : 20 18 | } 19 | } 20 | } 21 | ], 22 | "info" : { 23 | "version" : 1, 24 | "author" : "xcode" 25 | } 26 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming.imageset/bubble-incoming.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-incoming.imageset/bubble-incoming.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border-tail.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "resizing" : { 5 | "mode" : "9-part", 6 | "center" : { 7 | "mode" : "stretch", 8 | "width" : 1, 9 | "height" : 1 10 | }, 11 | "cap-insets" : { 12 | "bottom" : 16, 13 | "top" : 16, 14 | "right" : 20, 15 | "left" : 16 16 | } 17 | }, 18 | "idiom" : "universal", 19 | "filename" : "bubble-outgoing-border-tail@1x.png", 20 | "scale" : "1x" 21 | }, 22 | { 23 | "resizing" : { 24 | "mode" : "9-part", 25 | "center" : { 26 | "mode" : "stretch", 27 | "width" : 1, 28 | "height" : 1 29 | }, 30 | "cap-insets" : { 31 | "bottom" : 33, 32 | "top" : 32, 33 | "right" : 40, 34 | "left" : 33 35 | } 36 | }, 37 | "idiom" : "universal", 38 | "filename" : "bubble-outgoing-border-tail@2x.png", 39 | "scale" : "2x" 40 | }, 41 | { 42 | "resizing" : { 43 | "mode" : "9-part", 44 | "center" : { 45 | "mode" : "stretch", 46 | "width" : 1, 47 | "height" : 1 48 | }, 49 | "cap-insets" : { 50 | "bottom" : 49, 51 | "top" : 49, 52 | "right" : 60, 53 | "left" : 50 54 | } 55 | }, 56 | "idiom" : "universal", 57 | "filename" : "bubble-outgoing-border-tail@3x.png", 58 | "scale" : "3x" 59 | } 60 | ], 61 | "info" : { 62 | "version" : 1, 63 | "author" : "xcode" 64 | } 65 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border-tail.imageset/bubble-outgoing-border-tail@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border-tail.imageset/bubble-outgoing-border-tail@1x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border-tail.imageset/bubble-outgoing-border-tail@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border-tail.imageset/bubble-outgoing-border-tail@2x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border-tail.imageset/bubble-outgoing-border-tail@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border-tail.imageset/bubble-outgoing-border-tail@3x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "resizing" : { 5 | "mode" : "9-part", 6 | "center" : { 7 | "mode" : "stretch", 8 | "width" : 1, 9 | "height" : 1 10 | }, 11 | "cap-insets" : { 12 | "bottom" : 16, 13 | "top" : 16, 14 | "right" : 20, 15 | "left" : 16 16 | } 17 | }, 18 | "idiom" : "universal", 19 | "filename" : "bubble-outgoing-border@1x.png", 20 | "scale" : "1x" 21 | }, 22 | { 23 | "resizing" : { 24 | "mode" : "9-part", 25 | "center" : { 26 | "mode" : "stretch", 27 | "width" : 1, 28 | "height" : 1 29 | }, 30 | "cap-insets" : { 31 | "bottom" : 33, 32 | "top" : 32, 33 | "right" : 40, 34 | "left" : 33 35 | } 36 | }, 37 | "idiom" : "universal", 38 | "filename" : "bubble-outgoing-border@2x.png", 39 | "scale" : "2x" 40 | }, 41 | { 42 | "resizing" : { 43 | "mode" : "9-part", 44 | "center" : { 45 | "mode" : "stretch", 46 | "width" : 1, 47 | "height" : 1 48 | }, 49 | "cap-insets" : { 50 | "bottom" : 49, 51 | "top" : 49, 52 | "right" : 60, 53 | "left" : 50 54 | } 55 | }, 56 | "idiom" : "universal", 57 | "filename" : "bubble-outgoing-border@3x.png", 58 | "scale" : "3x" 59 | } 60 | ], 61 | "info" : { 62 | "version" : 1, 63 | "author" : "xcode" 64 | } 65 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border.imageset/bubble-outgoing-border@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border.imageset/bubble-outgoing-border@1x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border.imageset/bubble-outgoing-border@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border.imageset/bubble-outgoing-border@2x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border.imageset/bubble-outgoing-border@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-border.imageset/bubble-outgoing-border@3x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-tail.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bubble-outgoing-tail.pdf", 6 | "resizing" : { 7 | "mode" : "9-part", 8 | "center" : { 9 | "mode" : "stretch", 10 | "width" : 1, 11 | "height" : 1 12 | }, 13 | "cap-insets" : { 14 | "bottom" : 16, 15 | "top" : 16, 16 | "right" : 20, 17 | "left" : 16 18 | } 19 | } 20 | } 21 | ], 22 | "info" : { 23 | "version" : 1, 24 | "author" : "xcode" 25 | } 26 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-tail.imageset/bubble-outgoing-tail.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing-tail.imageset/bubble-outgoing-tail.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bubble-outgoing.pdf", 6 | "resizing" : { 7 | "mode" : "9-part", 8 | "center" : { 9 | "mode" : "stretch", 10 | "width" : 1, 11 | "height" : 1 12 | }, 13 | "cap-insets" : { 14 | "bottom" : 16, 15 | "top" : 16, 16 | "right" : 20, 17 | "left" : 16 18 | } 19 | } 20 | } 21 | ], 22 | "info" : { 23 | "version" : 1, 24 | "author" : "xcode" 25 | } 26 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing.imageset/bubble-outgoing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/BaseMessage/Views/BaseMessageAssets.xcassets/bubble-outgoing.imageset/bubble-outgoing.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/PhotoMessages/Views/PhotoMessageAssets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/PhotoMessages/Views/PhotoMessageAssets.xcassets/photo-bubble-placeholder-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "photo-bubble-placeholder-icon.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | }, 12 | "properties" : { 13 | "template-rendering-intent" : "template" 14 | } 15 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Chat Items/PhotoMessages/Views/PhotoMessageAssets.xcassets/photo-bubble-placeholder-icon.imageset/photo-bubble-placeholder-icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Chat Items/PhotoMessages/Views/PhotoMessageAssets.xcassets/photo-bubble-placeholder-icon.imageset/photo-bubble-placeholder-icon.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Input/Text/Text.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Input/Text/Text.xcassets/text-icon-selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "text-selected.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Input/Text/Text.xcassets/text-icon-selected.imageset/text-selected.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Input/Text/Text.xcassets/text-icon-selected.imageset/text-selected.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Input/Text/Text.xcassets/text-icon-unselected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "text-unselected.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/Input/Text/Text.xcassets/text-icon-unselected.imageset/text-unselected.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/Input/Text/Text.xcassets/text-icon-unselected.imageset/text-unselected.pdf -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/UI Components/CircleProgressIndicatorView/CircleProgressIndicator.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/UI Components/CircleProgressIndicatorView/CircleProgressIndicator.xcassets/infinity_icon_norm.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "infinity_icon_norm@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/UI Components/CircleProgressIndicatorView/CircleProgressIndicator.xcassets/infinity_icon_norm.imageset/infinity_icon_norm@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/UI Components/CircleProgressIndicatorView/CircleProgressIndicator.xcassets/infinity_icon_norm.imageset/infinity_icon_norm@2x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/UI Components/CircleProgressIndicatorView/CircleProgressIndicator.xcassets/tick_viewed_icon_norm.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tick_viewed_icon_norm@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/UI Components/CircleProgressIndicatorView/CircleProgressIndicator.xcassets/tick_viewed_icon_norm.imageset/tick_viewed_icon_norm@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/UI Components/CircleProgressIndicatorView/CircleProgressIndicator.xcassets/tick_viewed_icon_norm.imageset/tick_viewed_icon_norm@2x.png -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/UI Components/CircleProgressIndicatorView/CircleProgressIndicator.xcassets/warning_icon_norm.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "warning_icon_norm@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ChattoAdditions/sources/Resources/UI Components/CircleProgressIndicatorView/CircleProgressIndicator.xcassets/warning_icon_norm.imageset/warning_icon_norm@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoAdditions/sources/Resources/UI Components/CircleProgressIndicatorView/CircleProgressIndicator.xcassets/warning_icon_norm.imageset/warning_icon_norm@2x.png -------------------------------------------------------------------------------- /ChattoApp/.swift-version: -------------------------------------------------------------------------------- 1 | 4.0.0 -------------------------------------------------------------------------------- /ChattoApp/.swiftlint.yml: -------------------------------------------------------------------------------- 1 | ../.swiftlint.yml -------------------------------------------------------------------------------- /ChattoApp/ChattoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp.xcworkspace/xcshareddata/IDETemplateMacros.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FILEHEADER 6 | 7 | // The MIT License (MIT) 8 | // 9 | // Copyright (c) 2015-present Badoo Trading Limited. 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to deal 13 | // in the Software without restriction, including without limitation the rights 14 | // 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 16 | // furnished to do so, subject to the 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 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-40@2x-1.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-Small.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/bubble-incoming-tail-border.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bubble-incoming-tail-border.pdf", 6 | "resizing" : { 7 | "mode" : "9-part", 8 | "center" : { 9 | "mode" : "stretch", 10 | "width" : 1, 11 | "height" : 1 12 | }, 13 | "cap-insets" : { 14 | "bottom" : 16, 15 | "top" : 16, 16 | "right" : 16, 17 | "left" : 20 18 | } 19 | } 20 | } 21 | ], 22 | "info" : { 23 | "version" : 1, 24 | "author" : "xcode" 25 | } 26 | } -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/bubble-incoming-tail-border.imageset/bubble-incoming-tail-border.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/bubble-incoming-tail-border.imageset/bubble-incoming-tail-border.pdf -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/pic-test-1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "pic-test-1.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/pic-test-1.imageset/pic-test-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/pic-test-1.imageset/pic-test-1.jpg -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/pic-test-2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "pic-test-2.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/pic-test-2.imageset/pic-test-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/pic-test-2.imageset/pic-test-2.jpg -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/pic-test-3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "pic-test-3.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/pic-test-3.imageset/pic-test-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/pic-test-3.imageset/pic-test-3.jpg -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/reply-indicator.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "reply-indicator.pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/reply-indicator.imageset/reply-indicator.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/reply-indicator.imageset/reply-indicator.pdf -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/userAvatar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "userAvatar.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Assets.xcassets/userAvatar.imageset/userAvatar.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Assets.xcassets/userAvatar.imageset/userAvatar.pdf -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/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 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/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 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSCameraUsageDescription 26 | NSCameraUsageDescription 27 | NSPhotoLibraryUsageDescription 28 | NSPhotoLibraryUsageDescription 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | UIInterfaceOrientationPortraitUpsideDown 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | @UIApplicationMain 28 | class AppDelegate: UIResponder, UIApplicationDelegate { 29 | 30 | var window: UIWindow? 31 | 32 | func application(_ application: UIApplication, 33 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 34 | let rootViewController = ChatExamplesViewController() 35 | let window = UIWindow() 36 | window.rootViewController = UINavigationController(rootViewController: rootViewController) 37 | self.window = window 38 | self.window?.makeKeyAndVisible() 39 | return true 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat Items/Base Message/BaseMessageCollectionViewCellAvatarStyle.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import Foundation 26 | import ChattoAdditions 27 | 28 | class BaseMessageCollectionViewCellAvatarStyle: BaseMessageCollectionViewCellDefaultStyle { 29 | 30 | init() { 31 | super.init( 32 | replyIndicatorStyle: .init( 33 | image: UIImage(named: "reply-indicator")!, 34 | size: .init(width: 38, height: 38), 35 | maxOffsetToReplyIndicator: 48 36 | ) 37 | ) 38 | } 39 | 40 | override func avatarSize(viewModel: MessageViewModelProtocol) -> CGSize { 41 | // Display avatar for both incoming and outgoing messages for demo purpose 42 | return CGSize(width: 35, height: 35) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat Items/Content Aware Input /CustomInput.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat Items/Content Aware Input /CustomInput.xcassets/custom-icon-selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icons8-input-50-2.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat Items/Content Aware Input /CustomInput.xcassets/custom-icon-selected.imageset/icons8-input-50-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Source/Chat Items/Content Aware Input /CustomInput.xcassets/custom-icon-selected.imageset/icons8-input-50-2.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat Items/Content Aware Input /CustomInput.xcassets/custom-icon-unselected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icons8-input-50-3.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat Items/Content Aware Input /CustomInput.xcassets/custom-icon-unselected.imageset/icons8-input-50-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/ChattoApp/ChattoApp/Source/Chat Items/Content Aware Input /CustomInput.xcassets/custom-icon-unselected.imageset/icons8-input-50-3.png -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat Items/Photo Messages/DemoPhotoMessageModel.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import Foundation 26 | import ChattoAdditions 27 | 28 | public class DemoPhotoMessageModel: PhotoMessageModel, DemoMessageModelProtocol { 29 | public override init(messageModel: MessageModel, imageSize: CGSize, image: UIImage) { 30 | super.init(messageModel: messageModel, imageSize: imageSize, image: image) 31 | } 32 | 33 | public var status: MessageStatus { 34 | get { 35 | return self._messageModel.status 36 | } 37 | set { 38 | self._messageModel.status = newValue 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat Items/Sending status/SendingStatusCollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | class SendingStatusCollectionViewCell: UICollectionViewCell { 28 | 29 | @IBOutlet private weak var label: UILabel! 30 | 31 | var text: NSAttributedString? { 32 | didSet { 33 | self.label.attributedText = self.text 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat Items/Text Messages/DemoTextMessageModel.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import Foundation 26 | import ChattoAdditions 27 | 28 | public class DemoTextMessageModel: TextMessageModel, DemoMessageModelProtocol { 29 | public override init(messageModel: MessageModel, text: String) { 30 | super.init(messageModel: messageModel, text: text) 31 | } 32 | 33 | public var status: MessageStatus { 34 | get { 35 | return self._messageModel.status 36 | } 37 | set { 38 | self._messageModel.status = newValue 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat View Controllers/AddRandomMessageChatViewController.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | class AddRandomMessagesChatViewController: DemoChatViewController { 28 | 29 | override func viewDidLoad() { 30 | super.viewDidLoad() 31 | 32 | let addButton = UIBarButtonItem( 33 | title: "Add", 34 | style: .plain, 35 | target: self, 36 | action: #selector(addRandomMessage) 37 | ) 38 | 39 | let removeButton = UIBarButtonItem( 40 | title: "Remove", 41 | style: .plain, 42 | target: self, 43 | action: #selector(removeRandomMessage) 44 | ) 45 | 46 | self.navigationItem.rightBarButtonItems = [addButton, removeButton] 47 | } 48 | 49 | @objc 50 | private func addRandomMessage() { 51 | self.dataSource.addRandomIncomingMessage() 52 | } 53 | 54 | @objc 55 | private func removeRandomMessage() { 56 | self.dataSource.removeRandomMessage() 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat View Controllers/DemoReplyActionHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015-present Badoo Trading Limited. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // 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 11 | // furnished to do so, subject to the 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 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | import Chatto 25 | 26 | final class DemoReplyActionHandler: ReplyActionHandler { 27 | 28 | private weak var presentingViewController: UIViewController? 29 | 30 | init(presentingViewController: UIViewController) { 31 | self.presentingViewController = presentingViewController 32 | } 33 | 34 | func handleReply(for: ChatItemProtocol) { 35 | let alert = UIAlertController( 36 | title: "Reply message with swipe", 37 | message: nil, 38 | preferredStyle: .alert 39 | ) 40 | alert.addAction(.init(title: "OK", style: .cancel, handler: nil)) 41 | presentingViewController?.present(alert, animated: true, completion: nil) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Chat View Controllers/ScrollToBottomButtonChatViewController.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import UIKit 26 | 27 | final class ScrollToBottomButtonChatViewController: DemoChatViewController { 28 | override func viewDidLoad() { 29 | super.viewDidLoad() 30 | 31 | let button = UIBarButtonItem( 32 | title: "Scroll To Bottom", 33 | style: .plain, 34 | target: self, 35 | action: #selector(handleTapOnScrollToBottomButton) 36 | ) 37 | self.navigationItem.rightBarButtonItem = button 38 | } 39 | 40 | @objc 41 | private func handleTapOnScrollToBottomButton() { 42 | let chatItemCompanionCollection = self.baseChatViewController.chatItemCompanionCollection 43 | guard chatItemCompanionCollection.count > 0 else { return } 44 | 45 | let endIndex = chatItemCompanionCollection.endIndex 46 | let lastItemIndex = chatItemCompanionCollection.index(endIndex, offsetBy: -1) 47 | self.scrollToItem(withId: chatItemCompanionCollection[lastItemIndex].uid, position: .bottom, animated: true) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/MessagesSelectorProtocol.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import ChattoAdditions 26 | import Foundation 27 | 28 | public protocol MessagesSelectorDelegate: AnyObject { 29 | func messagesSelector(_ messagesSelector: MessagesSelectorProtocol, didSelectMessage: MessageModelProtocol) 30 | func messagesSelector(_ messagesSelector: MessagesSelectorProtocol, didDeselectMessage: MessageModelProtocol) 31 | } 32 | 33 | public protocol MessagesSelectorProtocol: AnyObject { 34 | var delegate: MessagesSelectorDelegate? { get set } 35 | var isActive: Bool { get set } 36 | func canSelectMessage(_ message: MessageModelProtocol) -> Bool 37 | func isMessageSelected(_ message: MessageModelProtocol) -> Bool 38 | func selectMessage(_ message: MessageModelProtocol) 39 | func deselectMessage(_ message: MessageModelProtocol) 40 | func selectedMessages() -> [MessageModelProtocol] 41 | } 42 | -------------------------------------------------------------------------------- /ChattoApp/ChattoApp/Source/Time Separator/TimeSeparatorModel.swift: -------------------------------------------------------------------------------- 1 | /* 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2015-present Badoo Trading Limited. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | 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 11 | furnished to do so, subject to the 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 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | */ 24 | 25 | import Foundation 26 | import UIKit 27 | import Chatto 28 | 29 | class TimeSeparatorModel: ChatItemProtocol { 30 | let uid: String 31 | let type: String = TimeSeparatorModel.chatItemType 32 | let date: String 33 | 34 | static var chatItemType: ChatItemType { 35 | return "TimeSeparatorModel" 36 | } 37 | 38 | init(uid: String, date: String) { 39 | self.date = date 40 | self.uid = uid 41 | } 42 | } 43 | 44 | extension Date { 45 | // Have a time stamp formatter to avoid keep creating new ones. This improves performance 46 | private static let weekdayAndDateStampDateFormatter: DateFormatter = { 47 | let dateFormatter = DateFormatter() 48 | dateFormatter.timeZone = TimeZone.autoupdatingCurrent 49 | dateFormatter.dateFormat = "EEEE, MMM dd yyyy" // "Monday, Mar 7 2016" 50 | return dateFormatter 51 | }() 52 | 53 | func toWeekDayAndDateString() -> String { 54 | return Date.weekdayAndDateStampDateFormatter.string(from: self) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ChattoApp/ChattoAppTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ChattoApp/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.1' 2 | use_frameworks! 3 | 4 | target 'ChattoApp' do 5 | pod 'Chatto', :path => ".." 6 | pod 'ChattoAdditions', :path => ".." 7 | end 8 | -------------------------------------------------------------------------------- /ChattoApp/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Chatto (4.1.0) 3 | - ChattoAdditions (4.1.0): 4 | - Chatto (= 4.1.0) 5 | 6 | DEPENDENCIES: 7 | - Chatto (from `..`) 8 | - ChattoAdditions (from `..`) 9 | 10 | EXTERNAL SOURCES: 11 | Chatto: 12 | :path: ".." 13 | ChattoAdditions: 14 | :path: ".." 15 | 16 | SPEC CHECKSUMS: 17 | Chatto: 0e91144da12c88ae37b0563693adf919a8ea392b 18 | ChattoAdditions: b58ce4a4536c9ac6937d46fe931beb0bc46649a7 19 | 20 | PODFILE CHECKSUM: 0197b3f4248c1be6476cabec03208c780b1f521b 21 | 22 | COCOAPODS: 1.11.3 23 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Local Podspecs/Chatto.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Chatto", 3 | "version": "4.1.0", 4 | "summary": "Chat framework in Swift", 5 | "description": "Lightweight chat framework to build Chat apps", 6 | "homepage": "https://github.com/badoo/Chatto", 7 | "license": { 8 | "type": "MIT" 9 | }, 10 | "platforms": { 11 | "ios": "11.1" 12 | }, 13 | "authors": { 14 | "Diego Sanchez": "diego.sanchezr@gmail.com", 15 | "Anton Schukin": "a.p.schukin@gmail.com" 16 | }, 17 | "source": { 18 | "git": "https://github.com/badoo/Chatto.git", 19 | "tag": "4.1.0" 20 | }, 21 | "source_files": "Chatto/sources/**/*.{h,m,swift}", 22 | "public_header_files": "Chatto/sources/**/*.h", 23 | "requires_arc": true, 24 | "swift_versions": "5.3", 25 | "swift_version": "5.3" 26 | } 27 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Local Podspecs/ChattoAdditions.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ChattoAdditions", 3 | "version": "4.1.0", 4 | "summary": "UI componentes for Chatto", 5 | "description": "Text and photo bubbles\nInput bar for text and photo messages", 6 | "homepage": "https://github.com/badoo/Chatto", 7 | "license": { 8 | "type": "MIT" 9 | }, 10 | "platforms": { 11 | "ios": "11.1" 12 | }, 13 | "authors": { 14 | "Diego Sanchez": "diego.sanchezr@gmail.com", 15 | "Anton Schukin": "a.p.schukin@gmail.com" 16 | }, 17 | "source": { 18 | "git": "https://github.com/badoo/Chatto.git", 19 | "tag": "4.1.0" 20 | }, 21 | "source_files": "ChattoAdditions/sources/**/*.{h,m,swift}", 22 | "public_header_files": "ChattoAdditions/sources/**/*.h", 23 | "requires_arc": true, 24 | "swift_versions": "5.3", 25 | "resource_bundles": { 26 | "ChattoAdditionsResources": [ 27 | "ChattoAdditions/sources/**/*.xib", 28 | "ChattoAdditions/sources/**/*.storyboard", 29 | "ChattoAdditions/sources/**/*.xcassets" 30 | ] 31 | }, 32 | "dependencies": { 33 | "Chatto": [ 34 | "4.1.0" 35 | ] 36 | }, 37 | "swift_version": "5.3" 38 | } 39 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Chatto (4.1.0) 3 | - ChattoAdditions (4.1.0): 4 | - Chatto (= 4.1.0) 5 | 6 | DEPENDENCIES: 7 | - Chatto (from `..`) 8 | - ChattoAdditions (from `..`) 9 | 10 | EXTERNAL SOURCES: 11 | Chatto: 12 | :path: ".." 13 | ChattoAdditions: 14 | :path: ".." 15 | 16 | SPEC CHECKSUMS: 17 | Chatto: 0e91144da12c88ae37b0563693adf919a8ea392b 18 | ChattoAdditions: b58ce4a4536c9ac6937d46fe931beb0bc46649a7 19 | 20 | PODFILE CHECKSUM: 0197b3f4248c1be6476cabec03208c780b1f521b 21 | 22 | COCOAPODS: 1.11.3 23 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Chatto/Chatto-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 | 4.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Chatto/Chatto-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Chatto : NSObject 3 | @end 4 | @implementation PodsDummy_Chatto 5 | @end 6 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Chatto/Chatto-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 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Chatto/Chatto-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 ChattoVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char ChattoVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Chatto/Chatto.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Chatto 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 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}/../.. 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 14 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Chatto/Chatto.modulemap: -------------------------------------------------------------------------------- 1 | framework module Chatto { 2 | umbrella header "Chatto-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Chatto/Chatto.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Chatto 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 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}/../.. 10 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 14 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Chatto/Chatto.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Chatto 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Chatto/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 | 3.3.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/ChattoAdditions/ChattoAdditions-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 | 4.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/ChattoAdditions/ChattoAdditions-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_ChattoAdditions : NSObject 3 | @end 4 | @implementation PodsDummy_ChattoAdditions 5 | @end 6 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/ChattoAdditions/ChattoAdditions-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 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/ChattoAdditions/ChattoAdditions-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 ChattoAdditionsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char ChattoAdditionsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/ChattoAdditions/ChattoAdditions.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ChattoAdditions 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Chatto" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 6 | OTHER_LDFLAGS = $(inherited) -framework "Chatto" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/ChattoAdditions/ChattoAdditions.modulemap: -------------------------------------------------------------------------------- 1 | framework module ChattoAdditions { 2 | umbrella header "ChattoAdditions-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/ChattoAdditions/ChattoAdditions.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ChattoAdditions 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Chatto" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 6 | OTHER_LDFLAGS = $(inherited) -framework "Chatto" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/ChattoAdditions/ChattoAdditions.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ChattoAdditions 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Chatto" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 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}/../.. 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 12 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/ChattoAdditions/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 | 3.3.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/ChattoAdditions/ResourceBundle-ChattoAdditionsResources-ChattoAdditions-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleIdentifier 8 | ${PRODUCT_BUNDLE_IDENTIFIER} 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | ${PRODUCT_NAME} 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 4.1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Pods-ChattoApp/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 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Pods-ChattoApp/Pods-ChattoApp-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 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Pods-ChattoApp/Pods-ChattoApp-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ChattoApp : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ChattoApp 5 | @end 6 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Pods-ChattoApp/Pods-ChattoApp-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_ChattoAppVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ChattoAppVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Pods-ChattoApp/Pods-ChattoApp.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Chatto" "${PODS_CONFIGURATION_BUILD_DIR}/ChattoAdditions" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Chatto/Chatto.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/ChattoAdditions/ChattoAdditions.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_LDFLAGS = $(inherited) -framework "Chatto" -framework "ChattoAdditions" 9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 10 | PODS_BUILD_DIR = ${BUILD_DIR} 11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Pods-ChattoApp/Pods-ChattoApp.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ChattoApp { 2 | umbrella header "Pods-ChattoApp-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ChattoApp/Pods/Target Support Files/Pods-ChattoApp/Pods-ChattoApp.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Chatto" "${PODS_CONFIGURATION_BUILD_DIR}/ChattoAdditions" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Chatto/Chatto.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/ChattoAdditions/ChattoAdditions.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_LDFLAGS = $(inherited) -framework "Chatto" -framework "ChattoAdditions" 9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 10 | PODS_BUILD_DIR = ${BUILD_DIR} 11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Badoo Development 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.3 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "Chatto", 7 | platforms: [.iOS("11.1")], 8 | products: [ 9 | .library(name: "Chatto", targets: ["Chatto"]), 10 | .library(name: "ChattoAdditions", targets: ["ChattoAdditions"]), 11 | ], 12 | targets: [ 13 | .target( 14 | name: "Chatto", 15 | dependencies: [], 16 | path: "Chatto/sources"), 17 | .target( 18 | name: "ChattoAdditions", 19 | dependencies: ["Chatto"], 20 | path: "ChattoAdditions/sources"), 21 | ]) 22 | -------------------------------------------------------------------------------- /readme-images/readme-pic-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/readme-images/readme-pic-1.png -------------------------------------------------------------------------------- /readme-images/readme-pic-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/readme-images/readme-pic-2.png -------------------------------------------------------------------------------- /readme-images/readme-pic-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/readme-images/readme-pic-3.png -------------------------------------------------------------------------------- /readme-images/readme-pic-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/badoo/Chatto/fcbcbad7e8bf9691c291ac0be93f98aeccda05ca/readme-images/readme-pic-4.png -------------------------------------------------------------------------------- /scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o pipefail 4 | 5 | WORKSPACE='Chatto.xcworkspace' 6 | SCHEME='Chatto' 7 | 8 | case "$1" in 9 | chatto) ;; 10 | additions) 11 | SCHEME='ChattoAdditions' 12 | ;; 13 | app) 14 | WORKSPACE='ChattoApp/ChattoApp.xcworkspace' 15 | SCHEME='ChattoApp' 16 | ;; 17 | *) echo "Invalid operation" 18 | exit 1 19 | ;; 20 | esac 21 | 22 | xcodebuild clean build test \ 23 | -workspace $WORKSPACE \ 24 | -scheme $SCHEME \ 25 | -sdk iphonesimulator \ 26 | -destination 'platform=iOS Simulator,name=iPhone 15' \ 27 | -configuration Debug | xcpretty 28 | --------------------------------------------------------------------------------