« first day (1951 days earlier)      last day (2032 days later) » 

04:51
Good Morning All
05:44
Can you help me to get answer for my post stackoverflow.com/questions/51458807/…
good morning
Good morning
06:27
@Shubhank hii
bro how to show copy and delete option when i long press particular cell
that will present over a particular cell
make a custom cell
attach long press gesture recognizer
i m using UILongPressGestureRecognizer
show your custom view inside cell when detected
06:28
which working
and when i long press cell i m showing alert but i want to show just above cell
in the gesture recognizer
you recieve the cell view itself
gesture.view
@Shubhank that i m receiving particular cell on long press
func handleLongPress(_ gestureRecognizer: UILongPressGestureRecognizer) {
let p: CGPoint = gestureRecognizer.location(in: sendMessageTable)
let indexPath: IndexPath? = sendMessageTable.indexPathForRow(at: p)
if indexPath == nil {
print("long press on table view but not on a row")
}
else if gestureRecognizer.state == .began {
print("long press on table view at row \(indexPath?.row)")

let cellSend = sendMessageTable.cellForRow(at: indexPath!) as! SendMessageCell!
cellSend?.selectionStyle = .default
how have you added the gesture recognizer ?
in viewdidload
let longPress = UILongPressGestureRecognizer(target: self, action: #selector(self.handleLongPress))
longPress.minimumPressDuration = 0.5
longPress.delegate = self
sendMessageTable.addGestureRecognizer(longPress)
this i have added on tableview with name "sendMessageTable"
@Shubhank
add it on cell
06:38
means
@Shubhank this is my current UI
add it to cell.addGestureRecognizer
where i m wrong in above code
and what i need to edit
i have told you
why don't you read
2 mins ago, by Shubhank
add it to cell.addGestureRecognizer
16 mins ago, by Shubhank
you recieve the cell view itself
06:48
when i do cell.addGestureRecognizer it will show alert just above particular tableview cell
first add it to recognizer
then see what view you get in the gesture method
ok
let me check now
are you getting the lcoation of cell clicked
currently ?
when i click its hightlight the cell and show a pop up
and index of cell
07:23
okay great
then now just call the custom method to show copy and delete method inside the cell
you can design them in storyboard prototype cell or xib and just toggle visibility based on gesture
ok bro i will try
and let u know
as u can see above UI of messages i want date to be called once and then messages @Shubhank
but now it is coming in every cell when i send message
because i have added "date" label inside cell
yes, you need to loop over and hide date label
show only at first index of a same day cells
bro can u tell me how to do
may i show u the cellforRow
its logic base
say you have a model of
[
[ day: "20 july"
message: "Good morning"],
[ day :"20 july"
message:"Good night"]
]
so in this case loop over your array, find all objects with same date
07:38
and set the first object to ["show Header" : true]
use that key to show header inside cell
can u check once
can u pls help me what should i write
 
1 hour later…
08:48
@DilipTiwari solved ?
09:06
no bro
@Shubhank
09:30
okay
have you done any changes
@Shubhank for showing date ?
this is my json
@Shubhank
bro
convert added time to date
bro i m using this which is already converting to date
yes
you are using it inside cell for row
you should also add a date column inside your model
yes i m using it is in cellforrwo
09:44
instead of cell for row
what you should do is Get Data from server -> Reformat data to data model with date and header section -> Show in cell
if you do reformatting in cell for row - it will become hard to debug and very hard to optimize
ok so first i create struct model of array right?
@Shubhank
can u tell me which values should i take in it according to user interface
:P
@DilipTiwari whatever you know already plus showHeader and the date field
"showHeader" what value it is @Shubhank
Bool
09:50
ok
because currently i m not using data model in that viewcontroller so i have to first create data model with above two values right@Shubhank
and all other data fields which you need to display in cell
ok i will tell u till doing all these
10:18
@Shubhank bro how to upload image or text or image text together in chat like application for particular viewcontroller
didn't understand
@Amira book recommendations please
this is my ui for now
@Shubhank
okay
how will i send image or text or image with text and show to tableview
i know how to upload images to server using alamofire
during upload
you have multipart option
add keys for text too
10:26
that i know bro
but how will i show to tableview or send to tableview
because it is like chat application
their will be sender or receiver
i have to work like chat on particular viewcontroller
search MQMessage
ok let me check
how to use this lib bro have u ever used that
see this and learn how they show diff cell
yes, i have used long time back
10:31
will it work in swift 3
xcode 8.2
should
check its tags or branches
ok
ok bro i will try to implement same thing in my app
@Shubhank i think it will also help to get date right ? on every section
which i was asking u in the morning
10:43
i have one api for showing messages on chat ui and one api when i send text or image from send button so will it work in both case
ok bro can i ask u one thing more
@DilipTiwari it is just UI library
you need to fill data and send text or image yourself
that's what i m asking
means suppose i m not sending anything right now and only showing data from api on chat page it will work right ?
ok bro
thanks
i will try that lib and if any issues i will ask
 
3 hours later…
13:30
:P

« first day (1951 days earlier)      last day (2032 days later) »