Skip to content

Commit

Permalink
Update optional cell textLabel's text.
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTangPL committed Dec 24, 2014
1 parent f757b60 commit f5d0873
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -361,7 +361,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
6 changes: 3 additions & 3 deletions Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ class ViewController: UITableViewController {

switch self.json.type {
case .Array:
cell.textLabel.text = "\(row)"
cell.textLabel?.text = "\(row)"
cell.detailTextLabel?.text = self.json.arrayValue.description
case .Dictionary:
let key: AnyObject = (self.json.object as NSDictionary).allKeys[row]
let value = self.json[key as String]
cell.textLabel.text = "\(key)"
cell.textLabel?.text = "\(key)"
cell.detailTextLabel?.text = value.description
default:
cell.textLabel.text = ""
cell.textLabel?.text = ""
cell.detailTextLabel?.text = self.json.description
}

Expand Down

0 comments on commit f5d0873

Please sign in to comment.