Skip to content

Commit 9c8ff9a

Browse files
committed
Fix more warnings
1 parent 55e0cd4 commit 9c8ff9a

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

WordPress/Classes/ViewRelated/Post/PostCompactCell.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ class PostCompactCell: UITableViewCell {
142142
guard let viewModel = viewModel else {
143143
return
144144
}
145-
146145
badgesLabel.textColor = viewModel.statusColor
147146
badgesLabel.text = viewModel.statusAndBadges(separatedBy: Constants.separator)
148147
if badgesLabel.text?.isEmpty ?? true {
@@ -153,9 +152,6 @@ class PostCompactCell: UITableViewCell {
153152
}
154153

155154
private func configureMenuInteraction() {
156-
guard let viewModel = viewModel else {
157-
return
158-
}
159155
menuButton.isEnabled = true
160156
menuButton.alpha = 1.0
161157
}

WordPress/Classes/ViewRelated/Reader/Theme/ReaderDisplaySetting.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ private extension UIColor {
442442
- parameter brightnessValue: A number that represents the brightness of a color. It ranges from 0.0 (black) to 1.0 (white).
443443
- return: YES if brightness is higher than the brightness value provided.
444444
*/
445-
public func brighterThan(_ brightnessValue: Double) -> Bool {
445+
func brighterThan(_ brightnessValue: Double) -> Bool {
446446
return Double(YIQBrightness()) / 255 > brightnessValue
447447
}
448448

WordPress/Classes/ViewRelated/Stats/SiteStatsDashboardViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ private extension SiteStatsDashboardViewController {
230230

231231
func updatePeriodView(oldSelectedTab: StatsTabType) {
232232
let selectedPeriodChanged = currentSelectedTab != oldSelectedTab
233-
let previousSelectedPeriodWasInsights = oldSelectedTab == .insights
234233
let pageViewControllerIsEmpty = pageViewController?.viewControllers?.isEmpty ?? true
235234
let isGrowAudienceShowingOnInsights = insightsTableViewController.isGrowAudienceShowing
236235

WordPress/Classes/ViewRelated/System/NetworkAware.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ extension NetworkStatusDelegate where Self: UIViewController {
6161

6262
fileprivate var receiver: ReachabilityNotificationObserver? {
6363
get {
64-
return objc_getAssociatedObject(self, &NetworkStatusAssociatedKeys.associatedObjectKey) as? ReachabilityNotificationObserver
64+
return objc_getAssociatedObject(self, NetworkStatusAssociatedKeys.associatedObjectKey) as? ReachabilityNotificationObserver
6565
}
6666

6767
set {
68-
objc_setAssociatedObject(self, &NetworkStatusAssociatedKeys.associatedObjectKey, newValue, .OBJC_ASSOCIATION_RETAIN)
68+
objc_setAssociatedObject(self, NetworkStatusAssociatedKeys.associatedObjectKey, newValue, .OBJC_ASSOCIATION_RETAIN)
6969
}
7070
}
7171
}
@@ -80,17 +80,17 @@ extension NetworkStatusDelegate where Self: NetworkStatusReceiver {
8080

8181
fileprivate var receiver: ReachabilityNotificationObserver? {
8282
get {
83-
return objc_getAssociatedObject(self, &NetworkStatusAssociatedKeys.associatedObjectKey) as? ReachabilityNotificationObserver
83+
return objc_getAssociatedObject(self, NetworkStatusAssociatedKeys.associatedObjectKey) as? ReachabilityNotificationObserver
8484
}
8585

8686
set {
87-
objc_setAssociatedObject(self, &NetworkStatusAssociatedKeys.associatedObjectKey, newValue, .OBJC_ASSOCIATION_RETAIN)
87+
objc_setAssociatedObject(self, NetworkStatusAssociatedKeys.associatedObjectKey, newValue, .OBJC_ASSOCIATION_RETAIN)
8888
}
8989
}
9090
}
9191

9292
fileprivate struct NetworkStatusAssociatedKeys {
93-
static var associatedObjectKey = "org.wordpress.networkstatus.notificationreceiver"
93+
static let associatedObjectKey = malloc(1)!
9494
}
9595

9696
fileprivate final class ReachabilityNotificationObserver: NSObject {

0 commit comments

Comments
 (0)