Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TapTalk.io Public
TapTalk.io SDK for iOS
Commits
636f2e01
Commit
636f2e01
authored
6 years ago
by
Dominic Vedericho
Browse files
Options
Download
Plain Diff
Merge branch 'release/0.2.4'
parents
41be5f10
b969f859
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
121 additions
and
108 deletions
+121
-108
TapTalk.podspec
TapTalk.podspec
+2
-2
TapTalk.xcworkspace/xcuserdata/dominicvedericho.xcuserdatad/UserInterfaceState.xcuserstate
...minicvedericho.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
TapTalk/Managers/TAPNotificationManager.m
TapTalk/Managers/TAPNotificationManager.m
+79
-79
TapTalk/View Controllers/TAPChatViewController.m
TapTalk/View Controllers/TAPChatViewController.m
+31
-16
TapTalk/View Controllers/TAPSearchViewController.m
TapTalk/View Controllers/TAPSearchViewController.m
+1
-3
TapTalk/Views/TAPCustomNotificationAlertView.m
TapTalk/Views/TAPCustomNotificationAlertView.m
+4
-4
TapTalk/Views/TAPScanQRCodePopupView.m
TapTalk/Views/TAPScanQRCodePopupView.m
+2
-2
TapTalk/Views/UICollectionViewCells/TAPImageCollectionViewCell.m
.../Views/UICollectionViewCells/TAPImageCollectionViewCell.m
+1
-1
TapTalk/Views/UICollectionViewCells/TAPImagePreviewCollectionViewCell.m
...UICollectionViewCells/TAPImagePreviewCollectionViewCell.m
+1
-1
No files found.
TapTalk.podspec
View file @
636f2e01
...
...
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#
s
.
name
=
"TapTalk"
s
.
version
=
"0.2.
3
"
s
.
version
=
"0.2.
4
"
s
.
summary
=
"Powerful Chat Engine"
# This description is used to generate tags and improve search results.
...
...
@@ -78,7 +78,7 @@ Pod::Spec.new do |s|
#
# s.source = { :path => '.' }
s
.
source
=
{
:git
=>
'git@git.moselo.com:taptalk/taptalk-ios.git'
,
:tag
=>
'0.2.
3
'
}
s
.
source
=
{
:git
=>
'git@git.moselo.com:taptalk/taptalk-ios.git'
,
:tag
=>
'0.2.
4
'
}
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
...
...
This diff is collapsed.
Click to expand it.
TapTalk.xcworkspace/xcuserdata/dominicvedericho.xcuserdatad/UserInterfaceState.xcuserstate
View file @
636f2e01
No preview for this file type
This diff is collapsed.
Click to expand it.
TapTalk/Managers/TAPNotificationManager.m
View file @
636f2e01
...
...
@@ -155,45 +155,45 @@
if
([
UIApplication
sharedApplication
].
applicationState
!=
UIApplicationStateActive
)
{
//Handling local push notification
if
([
UNUserNotificationCenter
class
])
{
//Check if UNUserNotifcation is supported
UNMutableNotificationContent
*
content
=
[[
UNMutableNotificationContent
alloc
]
init
];
content
.
title
=
message
.
user
.
fullname
;
NSString
*
messageText
=
message
.
body
;
content
.
body
=
messageText
;
content
.
sound
=
[
UNNotificationSound
soundNamed
:
NOTIFICATION_SOUND_NAME
];
content
.
userInfo
=
message
.
toDictionary
;
content
.
threadIdentifier
=
message
.
room
.
roomID
;
content
.
summaryArgument
=
message
.
user
.
fullname
;
// Deliver the notification after x second
UNTimeIntervalNotificationTrigger
*
trigger
=
[
UNTimeIntervalNotificationTrigger
triggerWithTimeInterval:
1
.
0
f
repeats
:
NO
];
UNNotificationRequest
*
request
=
[
UNNotificationRequest
requestWithIdentifier
:
message
.
localID
content:
content
trigger:
trigger
];
// Schedule the notification.
UNUserNotificationCenter
*
center
=
[
UNUserNotificationCenter
currentNotificationCenter
];
[
center
addNotificationRequest
:
request
withCompletionHandler
:
^
(
NSError
*
_Nullable
error
)
{
}];
}
else
{
//UserNotifcation.framework is not available below iOS 10
UILocalNotification
*
localNotification
=
[[
UILocalNotification
alloc
]
init
];
NSDate
*
currentDate
=
[
NSDate
date
];
NSTimeInterval
currentTimeInterval
=
[
currentDate
timeIntervalSince1970
];
currentTimeInterval
+=
1
.
0
f
;
//Fire message with delay to avoid miss date
NSDate
*
updatedDate
=
[
NSDate
dateWithTimeIntervalSince1970
:
currentTimeInterval
];
localNotification
.
fireDate
=
updatedDate
;
localNotification
.
alertTitle
=
message
.
user
.
fullname
;
NSString
*
messageText
=
message
.
body
;
localNotification
.
alertBody
=
messageText
;
localNotification
.
soundName
=
NOTIFICATION_SOUND_NAME
;
localNotification
.
userInfo
=
[
message
toDictionary
];
[[
UIApplication
sharedApplication
]
scheduleLocalNotification
:
localNotification
];
}
//
if ([UNUserNotificationCenter class]) { //Check if UNUserNotifcation is supported
//
UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init];
//
content.title = message.user.fullname;
//
NSString *messageText = message.body;
//
content.body = messageText;
//
content.sound = [UNNotificationSound soundNamed:NOTIFICATION_SOUND_NAME];
//
content.userInfo = message.toDictionary;
//
content.threadIdentifier = message.room.roomID;
//
content.summaryArgument = message.user.fullname;
//
//
// Deliver the notification after x second
//
UNTimeIntervalNotificationTrigger *trigger = [UNTimeIntervalNotificationTrigger
//
triggerWithTimeInterval:1.0f repeats:NO];
//
UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:message.localID
//
content:content
//
trigger:trigger];
//
//
// Schedule the notification.
//
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
//
[center addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
//
//
}];
//
}
//
else {
//
//UserNotifcation.framework is not available below iOS 10
//
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
//
NSDate *currentDate = [NSDate date];
//
NSTimeInterval currentTimeInterval = [currentDate timeIntervalSince1970];
//
currentTimeInterval += 1.0f; //Fire message with delay to avoid miss date
//
NSDate *updatedDate = [NSDate dateWithTimeIntervalSince1970:currentTimeInterval];
//
localNotification.fireDate = updatedDate;
//
localNotification.alertTitle = message.user.fullname;
//
NSString *messageText = message.body;
//
localNotification.alertBody = messageText;
//
localNotification.soundName = NOTIFICATION_SOUND_NAME;
//
localNotification.userInfo = [message toDictionary];
//
//
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
//
}
//Update message delivery status to API
[[
TAPMessageStatusManager
sharedManager
]
markMessageAsDeliveredFromPushNotificationWithMessage
:
message
];
...
...
@@ -248,46 +248,46 @@
-
(
void
)
removeReadLocalNotificationWithMessage
:(
TAPMessageModel
*
)
message
{
//Handling local push notification
if
([
UNUserNotificationCenter
class
])
{
//Check if UNUserNotifcation is supported
[[
UNUserNotificationCenter
currentNotificationCenter
]
getDeliveredNotificationsWithCompletionHandler
:
^
(
NSArray
<
UNNotification
*>
*
_Nonnull
notifications
)
{
for
(
NSInteger
counter
=
0
;
counter
<
[
notifications
count
];
counter
++
)
{
UNNotification
*
notification
=
[
notifications
objectAtIndex
:
counter
];
NSString
*
identifier
=
notification
.
request
.
identifier
;
NSDictionary
*
userInfoDictionary
=
notification
.
request
.
content
.
userInfo
;
NSString
*
notificationRoomID
=
[
userInfoDictionary
valueForKeyPath
:
@"room.roomID"
];
NSString
*
obtainedLocalID
=
message
.
localID
;
NSString
*
obtainedRoomID
=
message
.
room
.
roomID
;
if
([
identifier
isEqualToString
:
obtainedLocalID
]
&&
[
notificationRoomID
isEqualToString
:
obtainedRoomID
])
{
//Cancelling local notification
[[
UNUserNotificationCenter
currentNotificationCenter
]
removeDeliveredNotificationsWithIdentifiers:
@[
identifier
]];
break
;
}
}
}];
}
else
{
//UserNotifcation.framework is not available below iOS 10
NSArray
*
localNotificationArray
=
[[
UIApplication
sharedApplication
]
scheduledLocalNotifications
];
for
(
NSInteger
counter
=
0
;
counter
<
[
localNotificationArray
count
];
counter
++
)
{
UILocalNotification
*
selectedLocalNotification
=
[
localNotificationArray
objectAtIndex
:
counter
];
NSDictionary
*
currentUserInfo
=
selectedLocalNotification
.
userInfo
;
NSString
*
notificationLocalID
=
[
currentUserInfo
objectForKey
:
@"localID"
];
NSString
*
notificationRoomID
=
[
currentUserInfo
valueForKeyPath
:
@"room.roomID"
];
NSString
*
obtainedLocalID
=
message
.
localID
;
NSString
*
obtainedRoomID
=
message
.
room
.
roomID
;
if
([
notificationLocalID
isEqualToString
:
obtainedLocalID
]
&&
[
notificationRoomID
isEqualToString
:
obtainedRoomID
])
{
//Cancelling local notification
[[
UIApplication
sharedApplication
]
cancelLocalNotification
:
selectedLocalNotification
];
break
;
}
}
}
//
if ([UNUserNotificationCenter class]) { //Check if UNUserNotifcation is supported
//
[[UNUserNotificationCenter currentNotificationCenter] getDeliveredNotificationsWithCompletionHandler:^(NSArray<UNNotification *> * _Nonnull notifications) {
//
//
for (NSInteger counter = 0; counter < [notifications count]; counter++) {
//
UNNotification *notification = [notifications objectAtIndex:counter];
//
NSString *identifier = notification.request.identifier;
//
NSDictionary *userInfoDictionary = notification.request.content.userInfo;
//
NSString *notificationRoomID = [userInfoDictionary valueForKeyPath:@"room.roomID"];
//
//
NSString *obtainedLocalID = message.localID;
//
NSString *obtainedRoomID = message.room.roomID;
//
//
if ([identifier isEqualToString:obtainedLocalID] && [notificationRoomID isEqualToString:obtainedRoomID]) {
//
//Cancelling local notification
//
[[UNUserNotificationCenter currentNotificationCenter]
//
removeDeliveredNotificationsWithIdentifiers:@[identifier]];
//
break;
//
}
//
}
//
}];
//
}
//
else {
//
//UserNotifcation.framework is not available below iOS 10
//
NSArray *localNotificationArray = [[UIApplication sharedApplication] scheduledLocalNotifications];
//
for (NSInteger counter = 0; counter < [localNotificationArray count]; counter++) {
//
UILocalNotification *selectedLocalNotification = [localNotificationArray objectAtIndex:counter];
//
NSDictionary *currentUserInfo = selectedLocalNotification.userInfo;
//
NSString *notificationLocalID = [currentUserInfo objectForKey:@"localID"];
//
NSString *notificationRoomID = [currentUserInfo valueForKeyPath:@"room.roomID"];
//
//
NSString *obtainedLocalID = message.localID;
//
NSString *obtainedRoomID = message.room.roomID;
//
//
if ([notificationLocalID isEqualToString:obtainedLocalID] && [notificationRoomID isEqualToString:obtainedRoomID]) {
//
//Cancelling local notification
//
[[UIApplication sharedApplication] cancelLocalNotification:selectedLocalNotification];
//
break;
//
}
//
}
//
}
}
-
(
void
)
updateApplicationBadgeCount
{
...
...
This diff is collapsed.
Click to expand it.
TapTalk/View Controllers/TAPChatViewController.m
View file @
636f2e01
...
...
@@ -1705,6 +1705,11 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
if
(
self
.
currentInputAccessoryExtensionHeight
>
0
.
0
f
)
{
[
self
showInputAccessoryExtensionView
:
NO
];
self
.
chatAnchorButtonBottomConstrait
.
constant
=
kChatAnchorDefaultBottomConstraint
+
self
.
keyboardHeight
-
kInputMessageAccessoryViewHeight
;
CGFloat
tableViewYContentInset
=
self
.
keyboardHeight
-
[
TAPUtil
safeAreaBottomPadding
]
-
kInputMessageAccessoryViewHeight
;
self
.
tableView
.
contentInset
=
UIEdgeInsetsMake
(
tableViewYContentInset
,
self
.
tableView
.
contentInset
.
left
,
self
.
tableView
.
contentInset
.
bottom
,
self
.
tableView
.
contentInset
.
right
);
self
.
tableView
.
scrollIndicatorInsets
=
UIEdgeInsetsMake
(
tableViewYContentInset
,
self
.
tableView
.
scrollIndicatorInsets
.
left
,
self
.
tableView
.
scrollIndicatorInsets
.
bottom
,
self
.
tableView
.
scrollIndicatorInsets
.
right
);
}
//hide empty chat
...
...
@@ -2666,7 +2671,9 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
}
-
(
void
)
applicationWillEnterForegroundNotification
:(
NSNotification
*
)
notification
{
[
self
callAPIAfterAndUpdateUIAndScrollToTop
:
YES
];
if
([
self
.
messageArray
count
]
>
0
)
{
[
self
callAPIAfterAndUpdateUIAndScrollToTop
:
YES
];
}
}
-
(
IBAction
)
chatAnchorButtonDidTapped
:(
id
)
sender
{
...
...
@@ -3068,7 +3075,6 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
self
.
inputAccessoryExtensionHeightConstraint
.
constant
=
0
.
0
f
;
}
[[
TAPChatManager
sharedManager
]
removeQuotedMessageObjectWithRoomID
:
self
.
currentRoom
.
roomID
];
}
}
...
...
@@ -3102,6 +3108,7 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
-
(
IBAction
)
inputAccessoryExtensionCloseButtonDidTapped
:(
id
)
sender
{
[
self
showInputAccessoryExtensionView
:
NO
];
[[
TAPChatManager
sharedManager
]
removeQuotedMessageObjectWithRoomID
:
self
.
currentRoom
.
roomID
];
}
-
(
void
)
showImagePreviewControllerWithSelectedImage
:(
UIImage
*
)
image
{
...
...
@@ -3142,7 +3149,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
CGFloat
total
=
[
totalString
floatValue
];
TAPMessageModel
*
currentMessage
=
[
self
.
messageDictionary
objectForKey
:
localID
];
NSInteger
currentRowIndex
=
[
self
.
messageArray
indexOfObject
:
currentMessage
];
NSArray
*
messageArray
=
[
self
.
messageArray
copy
];
NSInteger
currentRowIndex
=
[
messageArray
indexOfObject
:
currentMessage
];
TAPChatMessageType
type
=
currentMessage
.
type
;
if
(
type
==
TAPChatMessageTypeImage
)
{
...
...
@@ -3171,7 +3179,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
localID
=
[
TAPUtil
nullToEmptyString
:
localID
];
TAPMessageModel
*
currentMessage
=
[
self
.
messageDictionary
objectForKey
:
localID
];
NSInteger
currentRowIndex
=
[
self
.
messageArray
indexOfObject
:
currentMessage
];
NSArray
*
messageArray
=
[
self
.
messageArray
copy
];
NSInteger
currentRowIndex
=
[
messageArray
indexOfObject
:
currentMessage
];
TAPChatMessageType
type
=
currentMessage
.
type
;
if
(
type
==
TAPChatMessageTypeImage
)
{
...
...
@@ -3202,7 +3211,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
localID
=
[
TAPUtil
nullToEmptyString
:
localID
];
TAPMessageModel
*
currentMessage
=
[
self
.
messageDictionary
objectForKey
:
localID
];
NSInteger
currentRowIndex
=
[
self
.
messageArray
indexOfObject
:
currentMessage
];
NSArray
*
messageArray
=
[
self
.
messageArray
copy
];
NSInteger
currentRowIndex
=
[
messageArray
indexOfObject
:
currentMessage
];
TAPChatMessageType
type
=
currentMessage
.
type
;
if
(
type
==
TAPChatMessageTypeImage
)
{
...
...
@@ -3232,7 +3242,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
localID
=
[
TAPUtil
nullToEmptyString
:
localID
];
TAPMessageModel
*
currentMessage
=
[
self
.
messageDictionary
objectForKey
:
localID
];
NSInteger
currentRowIndex
=
[
self
.
messageArray
indexOfObject
:
currentMessage
];
NSArray
*
messageArray
=
[
self
.
messageArray
copy
];
NSInteger
currentRowIndex
=
[
messageArray
indexOfObject
:
currentMessage
];
//Update message status to array and dictionary
currentMessage
.
isFailedSend
=
YES
;
...
...
@@ -3265,7 +3276,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
}
TAPMessageModel
*
currentMessage
=
[
self
.
messageDictionary
objectForKey
:
localID
];
NSInteger
currentRowIndex
=
[
self
.
messageArray
indexOfObject
:
currentMessage
];
NSArray
*
messageArray
=
[
self
.
messageArray
copy
];
NSInteger
currentRowIndex
=
[
messageArray
indexOfObject
:
currentMessage
];
TAPChatMessageType
type
=
currentMessage
.
type
;
if
(
type
==
TAPChatMessageTypeImage
)
{
...
...
@@ -3305,7 +3317,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
}
TAPMessageModel
*
currentMessage
=
[
self
.
messageDictionary
objectForKey
:
localID
];
NSInteger
currentRowIndex
=
[
self
.
messageArray
indexOfObject
:
currentMessage
];
NSArray
*
messageArray
=
[
self
.
messageArray
copy
];
NSInteger
currentRowIndex
=
[
messageArray
indexOfObject
:
currentMessage
];
TAPChatMessageType
type
=
currentMessage
.
type
;
if
(
type
==
TAPChatMessageTypeImage
)
{
...
...
@@ -3339,7 +3352,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
}
TAPMessageModel
*
currentMessage
=
[
self
.
messageDictionary
objectForKey
:
localID
];
NSInteger
currentRowIndex
=
[
self
.
messageArray
indexOfObject
:
currentMessage
];
NSArray
*
messageArray
=
[
self
.
messageArray
copy
];
NSInteger
currentRowIndex
=
[
messageArray
indexOfObject
:
currentMessage
];
TAPChatMessageType
type
=
currentMessage
.
type
;
if
(
type
==
TAPChatMessageTypeImage
)
{
...
...
@@ -3378,7 +3392,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
}
TAPMessageModel
*
currentMessage
=
[
self
.
messageDictionary
objectForKey
:
localID
];
NSInteger
currentRowIndex
=
[
self
.
messageArray
indexOfObject
:
currentMessage
];
NSArray
*
messageArray
=
[
self
.
messageArray
copy
];
NSInteger
currentRowIndex
=
[
messageArray
indexOfObject
:
currentMessage
];
TAPChatMessageType
type
=
currentMessage
.
type
;
if
(
type
==
TAPChatMessageTypeImage
)
{
...
...
@@ -3430,8 +3445,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
// }
//
// TAPMessageModel *currentMessage = [self.messageDictionary objectForKey:localID];
//
NSInteger currentRowIndex = [self.messageArray indexOfObject:currentMessage
];
//
//
NSArray *messageArray = [self.messageArray copy
];
//
NSInteger currentRowIndex = [messageArray indexOfObject:currentMessage];//
// TAPChatMessageType type = currentMessage.type;
// if (type == TAPChatMessageTypeImage) {
//
...
...
@@ -3464,8 +3479,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
// }
//
// TAPMessageModel *currentMessage = [self.messageDictionary objectForKey:localID];
//
NSInteger currentRowIndex = [self.messageArray indexOfObject:currentMessage
];
//
//
NSArray *messageArray = [self.messageArray copy
];
//
NSInteger currentRowIndex = [messageArray indexOfObject:currentMessage];//
// TAPChatMessageType type = currentMessage.type;
// if (type == TAPChatMessageTypeImage) {
// if ([message.user.userID isEqualToString:[TAPChatManager sharedManager].activeUser.userID]) {
...
...
@@ -3503,8 +3518,8 @@ typedef NS_ENUM(NSInteger, InputAccessoryExtensionType) {
// }
//
// TAPMessageModel *currentMessage = [self.messageDictionary objectForKey:localID];
//
NSInteger currentRowIndex = [self.messageArray indexOfObject:currentMessage
];
//
//
NSArray *messageArray = [self.messageArray copy
];
//
NSInteger currentRowIndex = [messageArray indexOfObject:currentMessage];//
// TAPChatMessageType type = currentMessage.type;
// if (type == TAPChatMessageTypeImage) {
// if ([message.user.userID isEqualToString:[TAPChatManager sharedManager].activeUser.userID]) {
...
...
This diff is collapsed.
Click to expand it.
TapTalk/View Controllers/TAPSearchViewController.m
View file @
636f2e01
...
...
@@ -359,12 +359,10 @@
if
(
!
[
trimmedNewString
isEqualToString
:
@""
])
{
self
.
updatedString
=
newString
;
self
.
updatedString
=
newString
;
NSString
*
trimmedString
=
[
self
.
updatedString
stringByTrimmingCharactersInSet
:[
NSCharacterSet
whitespaceAndNewlineCharacterSet
]];
[
TAPDataManager
searchMessageWithString
:
trimmedString
sortBy
:
@"created"
success
:^
(
NSArray
*
resultArray
)
{
self
.
searchResultMessageArray
=
[
resultArray
mutableCopy
];
[
TAPDataManager
searchChatAndContactWithString
:
trimmedString
SortBy
:
@"roomName"
success
:^
(
NSArray
*
roomArray
,
NSArray
*
unreadCountArray
)
{
self
.
searchResultMessageArray
=
[
resultArray
mutableCopy
];
self
.
searchResultChatAndContactArray
=
[
roomArray
mutableCopy
];
self
.
searchResultUnreadCountArray
=
[
unreadCountArray
mutableCopy
];
...
...
This diff is collapsed.
Click to expand it.
TapTalk/Views/TAPCustomNotificationAlertView.m
View file @
636f2e01
...
...
@@ -46,13 +46,13 @@
_profilePictureImage
=
[[
TAPImageView
alloc
]
initWithFrame
:
CGRectMake
(
8
.
0
f
,
(
CGRectGetHeight
(
self
.
contentView
.
frame
)
-
52
.
0
f
)
/
2
.
0
f
,
52
.
0
f
,
52
.
0
f
)];
self
.
profilePictureImage
.
layer
.
cornerRadius
=
CGRectGetHeight
(
self
.
profilePictureImage
.
frame
)
/
2
.
0
f
;
self
.
profilePictureImage
.
clipsToBounds
=
YES
;
self
.
profilePictureImage
.
contentMode
=
UIViewContentModeScaleAspectFi
t
;
self
.
profilePictureImage
.
contentMode
=
UIViewContentModeScaleAspectFi
ll
;
[
self
.
contentView
addSubview
:
self
.
profilePictureImage
];
_contentImageView
=
[[
TAPImageView
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetWidth
(
self
.
contentView
.
frame
)
-
52
.
0
f
-
8
.
0
f
,
(
CGRectGetHeight
(
self
.
contentView
.
frame
)
-
52
.
0
f
)
/
2
.
0
f
,
52
.
0
f
,
52
.
0
f
)];
self
.
contentImageView
.
layer
.
cornerRadius
=
6
.
0
f
;
self
.
contentImageView
.
clipsToBounds
=
YES
;
self
.
contentImageView
.
contentMode
=
UIViewContentModeScaleAspectFi
t
;
self
.
contentImageView
.
contentMode
=
UIViewContentModeScaleAspectFi
ll
;
[
self
.
contentView
addSubview
:
self
.
contentImageView
];
CGFloat
profilePictureImageRightGap
=
8
.
0
f
;
...
...
@@ -98,13 +98,13 @@
_secondaryProfilePictureImage
=
[[
TAPImageView
alloc
]
initWithFrame
:
CGRectMake
(
8
.
0
f
,
(
CGRectGetHeight
(
self
.
contentView
.
frame
)
-
52
.
0
f
)
/
2
.
0
f
,
52
.
0
f
,
52
.
0
f
)];
self
.
secondaryProfilePictureImage
.
layer
.
cornerRadius
=
CGRectGetHeight
(
self
.
profilePictureImage
.
frame
)
/
2
.
0
f
;
self
.
secondaryProfilePictureImage
.
clipsToBounds
=
YES
;
self
.
secondaryProfilePictureImage
.
contentMode
=
UIViewContentModeScaleAspectFi
t
;
self
.
secondaryProfilePictureImage
.
contentMode
=
UIViewContentModeScaleAspectFi
ll
;
[
self
.
secondaryContentView
addSubview
:
self
.
secondaryProfilePictureImage
];
_secondaryContentImageView
=
[[
TAPImageView
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetWidth
(
self
.
secondaryContentView
.
frame
)
-
52
.
0
f
-
8
.
0
f
,
(
CGRectGetHeight
(
self
.
contentView
.
frame
)
-
52
.
0
f
)
/
2
.
0
f
,
52
.
0
f
,
52
.
0
f
)];
self
.
secondaryContentImageView
.
layer
.
cornerRadius
=
6
.
0
f
;
self
.
secondaryContentImageView
.
clipsToBounds
=
YES
;
self
.
secondaryContentImageView
.
contentMode
=
UIViewContentModeScaleAspectFi
t
;
self
.
secondaryContentImageView
.
contentMode
=
UIViewContentModeScaleAspectFi
ll
;
[
self
.
secondaryContentView
addSubview
:
self
.
secondaryContentImageView
];
_secondaryNameLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
CGRectGetMaxX
(
self
.
secondaryProfilePictureImage
.
frame
)
+
profilePictureImageRightGap
,
15
.
0
f
,
nameLabelWidth
,
18
.
0
f
)];
...
...
This diff is collapsed.
Click to expand it.
TapTalk/Views/TAPScanQRCodePopupView.m
View file @
636f2e01
...
...
@@ -118,7 +118,7 @@
self
.
currentUserImageView
.
layer
.
borderColor
=
[
UIColor
whiteColor
].
CGColor
;
self
.
currentUserImageView
.
layer
.
borderWidth
=
4
.
0
f
;
self
.
currentUserImageView
.
clipsToBounds
=
YES
;
self
.
currentUserImageView
.
contentMode
=
UIViewContentModeScaleAspectFi
t
;
self
.
currentUserImageView
.
contentMode
=
UIViewContentModeScaleAspectFi
ll
;
self
.
currentUserImageView
.
alpha
=
0
.
0
f
;
[
self
.
whiteBaseView
addSubview
:
self
.
currentUserImageView
];
...
...
@@ -127,7 +127,7 @@
self
.
addedUserImageView
.
layer
.
borderColor
=
[
UIColor
whiteColor
].
CGColor
;
self
.
addedUserImageView
.
layer
.
borderWidth
=
4
.
0
f
;
self
.
addedUserImageView
.
clipsToBounds
=
YES
;
self
.
addedUserImageView
.
contentMode
=
UIViewContentModeScaleAspectFi
t
;
self
.
addedUserImageView
.
contentMode
=
UIViewContentModeScaleAspectFi
ll
;
[
self
.
whiteBaseView
addSubview
:
self
.
addedUserImageView
];
_addedUserUsernameLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
24
.
0
f
,
CGRectGetMaxY
(
self
.
addedUserImageView
.
frame
)
+
self
.
profilePictureBottomGap
,
CGRectGetWidth
(
self
.
whiteBaseView
.
frame
)
-
24
.
0
f
-
24
.
0
f
,
22
.
0
f
)];
...
...
This diff is collapsed.
Click to expand it.
TapTalk/Views/UICollectionViewCells/TAPImageCollectionViewCell.m
View file @
636f2e01
...
...
@@ -23,7 +23,7 @@
if
(
self
)
{
_imageView
=
[[
TAPImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
.
0
f
,
0
.
0
f
,
CGRectGetWidth
(
frame
),
CGRectGetHeight
(
frame
))];
self
.
imageView
.
clipsToBounds
=
YES
;
self
.
imageView
.
contentMode
=
UIViewContentModeScaleAspectFi
t
;
self
.
imageView
.
contentMode
=
UIViewContentModeScaleAspectFi
ll
;
[
self
.
contentView
addSubview
:
self
.
imageView
];
}
...
...
This diff is collapsed.
Click to expand it.
TapTalk/Views/UICollectionViewCells/TAPImagePreviewCollectionViewCell.m
View file @
636f2e01
...
...
@@ -22,7 +22,7 @@
if
(
self
)
{
_selectedPictureImageView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
.
0
f
,
0
.
0
f
,
CGRectGetWidth
(
self
.
contentView
.
frame
),
CGRectGetHeight
(
self
.
contentView
.
frame
))];
self
.
selectedPictureImageView
.
contentMode
=
UIViewContentModeScaleAspectFi
t
;
self
.
selectedPictureImageView
.
contentMode
=
UIViewContentModeScaleAspectFi
ll
;
self
.
selectedPictureImageView
.
clipsToBounds
=
YES
;
[
self
.
contentView
addSubview
:
self
.
selectedPictureImageView
];
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment