I am trying to show josn data and this happens
How can i prevent the ... from appering and show the full text?
Here is code
Here is Pic to show what is the problem Pic
As you can see there is the "..." and does not show full text
Any fix for this?
Thanks
[{"url":"","description":"rferferferferferferferferferferferferferferferferfreferferferferferferferferfeerfeferferferf"},
{"url":"","description":"Image Description"},
{"url":"","description":"Image Description"},
{"url":"","description":"Image Descriprffttion"},
{"url":"","description":"Image Descriptijijion"},
{"url":"","description":"Image Description"},
{"url":"","description":"techavindu"},
{"url":"","description":"Image Description"},
{"url":"","description":"Imagesdaasdsd Description"},
{"url":"","description":"Image Descriprffttion"},
{"url":"","description":"Image Descriptijijion"},
{"url":"","description":"Image Dyubuyuubububububububuescription"},
{"url":"","description":"techavindu"},
{"url":"","description":"Image Description"},
{"url":"","description":"Imagesdaasdsd Description"},
{"url":"","description":"Image Descriprffttion"},
{"url":"","description":"Image Descriptijijion"},
]
var json_data_url = "http://aliectronics.com.au/json_table_view_images%20(1).json"
var isProgressShowing = true;
var TableData:Array< datastruct > = Array < datastruct >()
enum ErrorHandler:ErrorType
{
case ErrorFetchingResults
}
struct datastruct
{
var description:String?
init(add: NSDictionary)
{
description = add["description"] as? String
}
}
@IBOutlet var tableview: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = color125
tableview.dataSource = self
tableview.delegate = self
get_data_from_url(json_data_url)
}
override func viewWillAppear(animated: Bool) {
let barButtonItem = UIBarButtonItem(title: "Refresh", style: .Plain, target: self, action: "refreshTapped");
self.navigationItem.rightBarButtonItem = barButtonItem;
}
func refreshTapped() {
addProgressIndicator(isProgressShowing);
get_data_from_url(json_data_url)
}
func addProgressIndicator(show : Bool) {
isProgressShowing = !show;
if(show) {
let myActivityIndicator = UIActivityIndicatorView(activityIndicatorStyle:UIActivityIndicatorViewStyle.Gray)
myActivityIndicator.startAnimating()
let barButtonItem = UIBarButtonItem(customView: myActivityIndicator)
self.navigationItem.rightBarButtonItem = barButtonItem
} else {
self.navigationItem.rightBarButtonItem = nil;
}
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
let data = TableData[indexPath.row]
cell.textLabel?.text = data.description
return cell
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return TableData.count
}
func get_data_from_url(url:String)
{
let url:NSURL = NSURL(string: url)!
let session = NSURLSession.sharedSession()
let request = NSMutableURLRequest(URL: url)
request.HTTPMethod = "GET"
request.cachePolicy = NSURLRequestCachePolicy.ReloadIgnoringCacheData
let task = session.dataTaskWithRequest(request) {
(
let data, let response, let error) in
guard let _:NSData = data, let _:NSURLResponse = response where error == nil else {
print("error")
return
}
dispatch_async(dispatch_get_main_queue(), {
self.extract_json(data!)
return
})
}
addProgressIndicator(!isProgressShowing);
task.resume()
}
func extract_json(jsonData:NSData)
{
let json: AnyObject?
do {
json = try NSJSONSerialization.JSONObjectWithData(jsonData, options: [])
} catch {
json = nil
return
}
if let list = json as? NSArray
{
for (var i = 0; i < list.count ; i++ )
{
if let data_block = list[i] as? NSDictionary
{
TableData.append(datastruct(add: data_block))
}
}
do_table_refresh()
}
}
func do_table_refresh()
{
dispatch_async(dispatch_get_main_queue(), {
self.tableview.reloadData()
return
})
}
}