We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am unable to set values to SOMessage Object (comment for my project) from my View Controller file. It gets set to nil. Here is the source code -->
// // Message.swift //
import UIKit
class Message: SOMessage {
// @synthesize attributes,text,date,fromMe,media,thumbnail,type;
override init() { super.init() self.date = NSDate() }
}
// // CommentsVC.swift //
class CommentsVC: SOMessagingViewController {
var dataSource: NSMutableArray! override func viewDidLoad() { super.viewDidLoad() self.loadMessages() } func loadMessages(){ var comment: Message = Message() comment.text = "HI ! This is Sparta !!!" comment.fromMe = false comment.type = SOMessageTypeText comment.date = NSDate() dataSource.addObject(comment) } override func intervalForMessagesGrouping() -> NSTimeInterval { return NSTimeInterval(0) } override func messages() -> NSMutableArray { return dataSource } override func configureMessageCell(cell: SOMessageCell!, forMessageAtIndex index: Int) { var message: Message = self.dataSource[index] as! Message; println(message.fromMe) if (message.fromMe != false) { cell.contentInsets = UIEdgeInsetsMake(0, 3.0, 0, 0) //Move content for 3 pt. to right cell.textView.textColor = UIColor.blackColor() } else { cell.contentInsets = UIEdgeInsetsMake(0, 0, 0, 3.0); //Move content for 3 pt. to left cell.textView.textColor = UIColor.whiteColor(); } } override func messageInputView(inputView: SOMessageInputView!, didSendMessage message: String!) { var msg: Message = Message() msg.text = message msg.fromMe = true self.sendMessage(msg) }
override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am unable to set values to SOMessage Object (comment for my project) from my View Controller file. It gets set to nil. Here is the source code -->
//
// Message.swift
//
import UIKit
class Message: SOMessage {
// @synthesize attributes,text,date,fromMe,media,thumbnail,type;
}
//
// CommentsVC.swift
//
import UIKit
class CommentsVC: SOMessagingViewController {
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
The text was updated successfully, but these errors were encountered: