Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty chat input fix #82

Merged
merged 5 commits into from
Apr 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# Change Log

Changelog for Critical Maps iOS

## [UNRELEASED]

### Added
- Message Notification Bubble

### Fixed
- Users can not send empty chat messages anymore.

## [3.0.0] - 2019-04-18


### Changed

- Complete Redesign
- Migrate map page to Swift
- Migrate rules page to Swift
Expand All @@ -18,69 +24,94 @@ Changelog for Critical Maps iOS
- New navigation

### Added

- Swift bridge
- Tests

## [2.5.1]

### Fixed

- Modern devices support

## [2.5.0]

### Added

- italian translations

### Changed

- allow observing if GPS is disabled
- english translations

### Updated

- XCode project to recommend settings
- AFNetworking
- Appirater
- SDWebImage

## [2.4.0] - 2017-08-01

### Changed
- less bike symbol opacity

- less bike symbol opacity

## [2.3.0] - 2017-07-02

### Changed

- switch back to api.criticalmaps.net

### Removed

- Travis

## [2.2.1] - 2017-06-07

### Fixed

- intended purpose of using the user's location while the app is in the background (NSLocationAlwaysUsageDescription)

## [2.2.0] - 2017-06-06

### Changed

- temporary API url

### Updated
- SDWebImage

- SDWebImage
- Appirater 2.1.2 (was 2.0.5)
- STTwitter 0.2.6 (was 0.2.5)

## [2.1.0] - 2016-09-24

### Added

- Changelog

### Changed

- Update pods
- Remove parse
- Change title on map screen to "Critical Maps"

### Fixed

- Podfile

## [2.0.1] - 2016-04-10

### Updated

- pods

## [2.0.0] - 2016-01-15

### Changed

- redesign by zutrinken

previous versions are not tracked
14 changes: 12 additions & 2 deletions CriticalMass/ChatInputView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ChatInputView: UIView, UITextFieldDelegate {
textField.insets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
textField.enablesReturnKeyAutomatically = true
textField.returnKeyType = .send
textField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
return textField
}()

Expand All @@ -31,7 +32,10 @@ class ChatInputView: UIView, UITextFieldDelegate {
button.setTitle(NSLocalizedString("chat.send", comment: ""), for: .normal)
button.setTitleColor(.chatInputSendButton, for: .normal)
button.setTitleColor(UIColor.chatInputSendButton.withAlphaComponent(0.4), for: .highlighted)
button.setTitleColor(UIColor.chatInputSendButton.withAlphaComponent(0.4), for: .disabled)
button.translatesAutoresizingMaskIntoConstraints = false
button.addTarget(self, action: #selector(didTapSendButton), for: .touchUpInside)
button.isEnabled = false
return button
}()

Expand Down Expand Up @@ -59,7 +63,7 @@ class ChatInputView: UIView, UITextFieldDelegate {
addSubview(separator)

textField.delegate = self
button.addTarget(self, action: #selector(didTapSendButton), for: .touchUpInside)

configureConstraints()
}

Expand Down Expand Up @@ -99,7 +103,13 @@ class ChatInputView: UIView, UITextFieldDelegate {
override func resignFirstResponder() -> Bool {
return textField.resignFirstResponder()
}


@objc
func textFieldDidChange(_ textField : UITextField){
if let text = textField.text {
button.isEnabled = !text.isEmpty
}
}
// MARK: UITextFieldDelegate

func textFieldShouldReturn(_ textField: UITextField) -> Bool {
Expand Down