Skip to content

Commit

Permalink
Merge pull request #29 from MonoHelixLabs/crash-fix
Browse files Browse the repository at this point in the history
v 1.1.1
  • Loading branch information
petcupaula committed Jul 21, 2017
2 parents 0110ac6 + 52a0c0d commit d9bbbf1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions DataFeeds-iOS/FeedDetailsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ class FeedDetailsViewController: UIViewController, UITableViewDataSource, UITabl
if self.histItems.count > 0 && indexPath.row < self.histItems.count {
let histItem:JSON = JSON(self.histItems[indexPath.row])

if let timestamp: AnyObject = histItem["created_at"].string! as String as AnyObject {
cell!.textLabel?.text = dayTimePeriodFormatterOut.string(from: dayTimePeriodFormatterIn.date(from: timestamp as! String)!)
if let timestamp = histItem["created_at"].string {
cell!.textLabel?.text = dayTimePeriodFormatterOut.string(from: dayTimePeriodFormatterIn.date(from: timestamp)!)

if let val: AnyObject = histItem["value"].string! as String as AnyObject {
cell!.textLabel?.text = (cell!.textLabel?.text)! + "\t\t" + (val as! String)
if let val = histItem["value"].string {
cell!.textLabel?.text = (cell!.textLabel?.text)! + "\t\t" + val
cell!.textLabel!.isEnabled = true
}

Expand Down
2 changes: 1 addition & 1 deletion DataFeeds-iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1</string>
<string>1.1.1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
4 changes: 2 additions & 2 deletions DataFeeds-iOS/RefreshRateViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ class RefreshRateViewController: UIViewController {
UserDefaultsManager.sharedInstance.setRefreshRateDetailsFeed(sender.selectedSegmentIndex)
}
#else
@IBAction func onMainFeedRefreshRateChanged(sender: UISegmentedControl) {
@IBAction func onMainFeedRefreshRateChanged(_ sender: UISegmentedControl) {

UserDefaultsManager.sharedInstance.setRefreshRateMainFeed(sender.selectedSegmentIndex)
}
@IBAction func onFeedDetailsRefreshRateChanged(sender: UISegmentedControl) {
@IBAction func onFeedDetailsRefreshRateChanged(_ sender: UISegmentedControl) {

UserDefaultsManager.sharedInstance.setRefreshRateDetailsFeed(sender.selectedSegmentIndex)
}
Expand Down
22 changes: 11 additions & 11 deletions DataFeeds-iOS/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class ViewController: UIViewController, UITableViewDataSource, UITableViewDelega
let feeds: JSON = json
if feeds.count > 0 {
for (_, subJson) in feeds {
if let feed: AnyObject = subJson.object as AnyObject {
if let feed: AnyObject = subJson.object as AnyObject{
self.items.add(feed)
self.items.sort(using: [NSSortDescriptor(key: "name", ascending: true)])
if (self.items.count != 0) {
Expand Down Expand Up @@ -169,20 +169,20 @@ class ViewController: UIViewController, UITableViewDataSource, UITableViewDelega

let imgPrefs = UserDefaultsManager.sharedInstance.getImagesPreferences()

if let feedname: AnyObject = feed["name"].string as AnyObject {
if let feedname = feed["name"].string {

cell!.accessoryType = .disclosureIndicator

if let feedkey: AnyObject = feed["key"].string as AnyObject {
if let val = imgPrefs[feedkey as! String] {
if let feedkey = feed["key"].string {
if let val = imgPrefs[feedkey] {
cell!.imageView!.image = getImageFromText(val)
}
else {
cell!.imageView!.image = getImageFromText(defaultEmoji)
}
}

cell!.textLabel?.text = (feedname as! String)
cell!.textLabel?.text = (feedname)

if let feedvalue = feed["last_value"].string {
cell!.textLabel?.text = (cell!.textLabel?.text)! + ": " + feedvalue
Expand All @@ -191,8 +191,8 @@ class ViewController: UIViewController, UITableViewDataSource, UITableViewDelega
}
else {
cell!.imageView!.image = getImageFromText(warningEmoji)
if let error: AnyObject = feed.string as AnyObject {
cell!.textLabel?.text = "Connection problem: " + (error as! String)
if let error = feed.string {
cell!.textLabel?.text = "Connection problem: " + error
}
else {
cell!.textLabel?.text = "Connection problem."
Expand Down Expand Up @@ -225,11 +225,11 @@ class ViewController: UIViewController, UITableViewDataSource, UITableViewDelega

let feed:JSON = JSON(self.items[indexPath.row])

if let feedname: AnyObject = feed["name"].string as AnyObject {
selectedFeedName = feedname as! String
if let feedname = feed["name"].string {
selectedFeedName = feedname

if let feedkey: AnyObject = feed["key"].string as AnyObject {
selectedFeedKey = feedkey as! String
if let feedkey = feed["key"].string {
selectedFeedKey = feedkey
}

performSegue(withIdentifier: "tableCellDetails", sender: self)
Expand Down
2 changes: 1 addition & 1 deletion DataFeeds-tvOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1</string>
<string>1.1.1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
Expand Down
Binary file not shown.

0 comments on commit d9bbbf1

Please sign in to comment.