diff --git a/.gitignore b/.gitignore index 330d167..bb460e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,90 +1,7 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## User settings +.DS_Store +/.build +/Packages +/*.xcodeproj xcuserdata/ - -## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) -*.xcscmblueprint -*.xccheckout - -## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) -build/ DerivedData/ -*.moved-aside -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 - -## Obj-C/Swift specific -*.hmap - -## App packaging -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -# *.xcodeproj -# -# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata -# hence it is not needed unless you have added a package configuration file to your project -# .swiftpm - -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ -# -# Add this line if you want to avoid checking in source code from the Xcode workspace -# *.xcworkspace - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build/ - -# Accio dependency management -Dependencies/ -.accio/ - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. -# Instead, use fastlane to re-generate the screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots/**/*.png -fastlane/test_output - -# Code Injection -# -# After new code Injection tools there's a generated folder /iOSInjectionProject -# https://github.com/johnno1962/injectionforxcode - -iOSInjectionProject/ +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/MessageInputBar/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from MessageInputBar/.swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to .swiftpm/xcode/package.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/MessageInputBar/.gitignore b/MessageInputBar/.gitignore deleted file mode 100644 index bb460e7..0000000 --- a/MessageInputBar/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.DS_Store -/.build -/Packages -/*.xcodeproj -xcuserdata/ -DerivedData/ -.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/MessageInputBar/README.md b/MessageInputBar/README.md deleted file mode 100644 index 273de0f..0000000 --- a/MessageInputBar/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# MessageInputBar - -## What is it? - -`MessageInputBar` is a simple text input bar implemented in modularized way, you can add any element you want to the bar at two types of location. - -It provides some basic features like following: - -* Decouple action logic from input bar to element. -* Handle with the height of input bar automatically. -* Enhance capability of input bar by adding any element you want. - -## How to use? - -Create some elements then add them to input bar. - -```swift - -let inputBar = MessageInputBar() - -// setup elements of input bar -do { - let element = MessageInputElement(icon: .sfIconName("arrow.up.circle.fill")) - element.enable = { $1.text.count > 0} - element.action = { [weak self] element, inputBar in - guard let `self` = self else { - return - } - - self.viewModel.sendMessage(text: inputBar.text) - inputBar.resetText() - } - - inputBar.add(element: element, at: .controlLocation) -} - -do { - let element = MessageInputElement(icon: .sfIconName("photo.fill")) - element.action = { [weak self] element, inputBar in - guard let `self` = self else { - return - } - - self.viewModel.selectPhoto() - } - inputBar.add(element: element, at: .functionLocation) -} - -``` - - diff --git a/MessageInputBar/Package.swift b/Package.swift similarity index 100% rename from MessageInputBar/Package.swift rename to Package.swift diff --git a/README.md b/README.md index 33a32b3..273de0f 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,6 @@ It provides some basic features like following: * Handle with the height of input bar automatically. * Enhance capability of input bar by adding any element you want. -## Example - - - ## How to use? Create some elements then add them to input bar. @@ -47,8 +43,9 @@ do { self.viewModel.selectPhoto() } - inputBar.add(element: element, at: .functionLocation) } ``` + + diff --git a/MessageInputBar/Sources/MessageInputBar/MessageInputBar.swift b/Sources/MessageInputBar/MessageInputBar.swift similarity index 100% rename from MessageInputBar/Sources/MessageInputBar/MessageInputBar.swift rename to Sources/MessageInputBar/MessageInputBar.swift diff --git a/MessageInputBar/Sources/MessageInputBar/MessageInputElement.swift b/Sources/MessageInputBar/MessageInputElement.swift similarity index 100% rename from MessageInputBar/Sources/MessageInputBar/MessageInputElement.swift rename to Sources/MessageInputBar/MessageInputElement.swift diff --git a/MessageInputBar/Tests/MessageInputBarTests/MessageInputBarTests.swift b/Tests/MessageInputBarTests/MessageInputBarTests.swift similarity index 100% rename from MessageInputBar/Tests/MessageInputBarTests/MessageInputBarTests.swift rename to Tests/MessageInputBarTests/MessageInputBarTests.swift