Skip to content
This repository was archived by the owner on Aug 14, 2019. It is now read-only.

Commit 810a52b

Browse files
committed
merged from original
2 parents 074f2fe + e4927be commit 810a52b

15 files changed

+334
-50
lines changed

.github/CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
58+
reported by contacting the project team at **jesse.squires.developer [at] gmail [dot] com**. All
5959
complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.

CHANGELOG.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,117 @@
33
The changelog for `JSQMessagesViewController`. Also see the [releases](https://github.com/jessesquires/JSQMessagesViewController/releases) on GitHub.
44

55
--------------------------------------
6+
7+
7.3.3
8+
-----
9+
10+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A7.3.3+is%3Aclosed)
11+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/7.3.3)
12+
13+
7.3.2
14+
-----
15+
16+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A7.3.2+is%3Aclosed)
17+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/7.3.2)
18+
19+
7.3.1
20+
-----
21+
22+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A7.3.1+is%3Aclosed)
23+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/7.3.1)
24+
25+
7.3.0
26+
-----
27+
28+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A7.3.0+is%3Aclosed)
29+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/7.3.0)
30+
31+
32+
7.2.0
33+
-----
34+
35+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A7.2.0+is%3Aclosed)
36+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/7.2.0)
37+
38+
7.1.0
39+
-----
40+
41+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A7.1.0+is%3Aclosed)
42+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/7.1.0)
43+
44+
7.0.2
45+
-----
46+
47+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A7.0.2+is%3Aclosed)
48+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/7.0.2)
49+
50+
7.0.1
51+
-----
52+
53+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A7.0.1+is%3Aclosed)
54+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/7.0.1)
55+
56+
7.0.0
57+
-----
58+
59+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A7.0.0+is%3Aclosed)
60+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/7.0.0)
61+
62+
6.1.3
63+
-----
64+
65+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/6.1.3)
66+
67+
6.1.2
68+
-----
69+
70+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A6.1.2+is%3Aclosed)
71+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/6.1.2)
72+
73+
6.1.1
74+
-----
75+
76+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A6.1.1+is%3Aclosed)
77+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/6.1.1)
78+
79+
6.0.0
80+
-----
81+
82+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A6.0.0+is%3Aclosed)
83+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/6.0.0)
84+
85+
5.3.0
86+
-----
87+
88+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/5.3.0)
89+
90+
5.2.0
91+
-----
92+
93+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/5.2.0)
94+
95+
5.1.0
96+
-----
97+
98+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/5.1.0)
99+
100+
5.0.3
101+
-----
102+
103+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/5.0.3)
104+
105+
5.0.0
106+
-----
107+
108+
- [Milestone](https://github.com/jessesquires/JSQMessagesViewController/issues?q=milestone%3A5.0.0+is%3Aclosed)
109+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/5.0.0)
110+
111+
4.0.0
112+
-----
113+
114+
- [GitHub release notes](https://github.com/jessesquires/JSQMessagesViewController/releases/tag/4.0.0)
115+
116+
All previous versions
117+
---------------------
118+
119+
Unfortunately, release notes are not available for earlier versions of the library.

JSQMessagesDemo/DemoMessagesViewController.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ - (void)viewDidLoad
7373
* Register custom menu actions for cells.
7474
*/
7575
[JSQMessagesCollectionViewCell registerMenuAction:@selector(customAction:)];
76-
[UIMenuController sharedMenuController].menuItems = @[ [[UIMenuItem alloc] initWithTitle:@"Custom Action"
77-
action:@selector(customAction:)] ];
7876

77+
7978
/**
8079
* OPT-IN: allow cells to be deleted
8180
*/
@@ -120,6 +119,19 @@ - (void)viewDidAppear:(BOOL)animated
120119

121120

122121

122+
#pragma mark - Custom menu actions for cells
123+
124+
- (void)didReceiveMenuWillShowNotification:(NSNotification *)notification
125+
{
126+
/**
127+
* Display custom menu actions for cells.
128+
*/
129+
UIMenuController *menu = [notification object];
130+
menu.menuItems = @[ [[UIMenuItem alloc] initWithTitle:@"Custom Action" action:@selector(customAction:)] ];
131+
}
132+
133+
134+
123135
#pragma mark - Testing
124136

125137
- (void)pushMainViewController

JSQMessagesDemo/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>7.2.0</string>
18+
<string>7.3.3</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>7.2.0</string>
22+
<string>7.3.3</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UILaunchStoryboardName</key>

JSQMessagesViewController.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'FRMJSQMessagesViewController'
3-
s.version = '7.2.2'
3+
s.version = '7.3.3.1'
44
s.summary = 'An elegant messages UI library for iOS.'
55
s.homepage = 'https://github.com/cheskapac/JSQMessagesViewController.git'
66
s.license = 'MIT'

JSQMessagesViewController/Categories/UIDevice+JSQMessages.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@
2525
*/
2626
+ (BOOL)jsq_isCurrentDeviceBeforeiOS8;
2727

28+
/**
29+
* @return Whether or not the current device is running a version of iOS after 9.0.
30+
*/
31+
+ (BOOL)jsq_isCurrentDeviceAfteriOS9;
32+
2833
@end

JSQMessagesViewController/Categories/UIDevice+JSQMessages.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,10 @@ + (BOOL)jsq_isCurrentDeviceBeforeiOS8
2626
return [[UIDevice currentDevice].systemVersion compare:@"8.0" options:NSNumericSearch] == NSOrderedAscending;
2727
}
2828

29+
+ (BOOL)jsq_isCurrentDeviceAfteriOS9
30+
{
31+
// iOS > 9.0
32+
return [[UIDevice currentDevice].systemVersion compare:@"9.0" options:NSNumericSearch] == NSOrderedDescending;
33+
}
34+
2935
@end

JSQMessagesViewController/Controllers/JSQMessagesKeyboardController.m

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ @interface JSQMessagesKeyboardController () <UIGestureRecognizerDelegate>
3939

4040
@property (assign, nonatomic) BOOL jsq_isObserving;
4141

42-
@property (weak, nonatomic) UIView *keyboardView;
42+
@property (strong, nonatomic) UIView *keyboardView;
4343

4444
@end
4545

@@ -167,7 +167,22 @@ - (void)jsq_unregisterForNotifications
167167

168168
- (void)jsq_didReceiveKeyboardDidShowNotification:(NSNotification *)notification
169169
{
170-
self.keyboardView = self.textView.inputAccessoryView.superview;
170+
UIView *keyboardViewProxy = self.textView.inputAccessoryView.superview;
171+
if ([UIDevice jsq_isCurrentDeviceAfteriOS9]) {
172+
NSPredicate *windowPredicate = [NSPredicate predicateWithFormat:@"self isMemberOfClass: %@", NSClassFromString(@"UIRemoteKeyboardWindow")];
173+
UIWindow *keyboardWindow = [[UIApplication sharedApplication].windows filteredArrayUsingPredicate:windowPredicate].firstObject;
174+
175+
for (UIView *subview in keyboardWindow.subviews) {
176+
for (UIView *hostview in subview.subviews) {
177+
if ([hostview isMemberOfClass:NSClassFromString(@"UIInputSetHostView")]) {
178+
keyboardViewProxy = hostview;
179+
break;
180+
}
181+
}
182+
}
183+
self.keyboardView = keyboardViewProxy;
184+
}
185+
171186
[self jsq_setKeyboardViewHidden:NO];
172187

173188
[self jsq_handleKeyboardNotification:notification completion:^(BOOL finished) {
@@ -264,7 +279,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
264279
if (CGRectEqualToRect(newKeyboardFrame, oldKeyboardFrame) || CGRectIsNull(newKeyboardFrame)) {
265280
return;
266281
}
267-
282+
268283
CGRect keyboardEndFrameConverted = [self.contextView convertRect:newKeyboardFrame
269284
fromView:self.keyboardView.superview];
270285
[self jsq_notifyKeyboardFrameNotificationForFrame:keyboardEndFrameConverted];
@@ -369,7 +384,7 @@ - (void)jsq_handlePanGestureRecognizer:(UIPanGestureRecognizer *)pan
369384
}];
370385
}
371386
break;
372-
387+
373388
default:
374389
break;
375390
}

JSQMessagesViewController/Controllers/JSQMessagesViewController.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,18 @@
310310
*/
311311
- (void)viewDidDisappear:(BOOL)animated NS_REQUIRES_SUPER;
312312

313+
/**
314+
Called when `UIMenuControllerWillShowMenuNotification` is posted.
315+
316+
@param notification The posted notification.
317+
*/
318+
- (void)didReceiveMenuWillShowNotification:(NSNotification *)notification;
319+
320+
/**
321+
Called when `UIMenuControllerWillHideMenuNotification` is posted.
322+
323+
@param notification The posted notification.
324+
*/
325+
- (void)didReceiveMenuWillHideNotification:(NSNotification *)notification;
326+
313327
@end

0 commit comments

Comments
 (0)