Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions Sources/IndicatorInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@

import Foundation

public struct IndicatorInfo {
@objcMembers public class IndicatorInfo: NSObject {

public var title: String?
public var image: UIImage?
public var highlightedImage: UIImage?
public var accessibilityLabel: String?
public var userInfo: Any?

public init(title: String?) {
self.title = title
self.accessibilityLabel = title
}

public init(image: UIImage?, highlightedImage: UIImage? = nil, userInfo: Any? = nil) {
Expand All @@ -45,36 +43,35 @@ public struct IndicatorInfo {

public init(title: String?, image: UIImage?, highlightedImage: UIImage? = nil, userInfo: Any? = nil) {
self.title = title
self.accessibilityLabel = title
self.image = image
self.highlightedImage = highlightedImage
self.userInfo = userInfo
}

public init(title: String?, accessibilityLabel:String?, image: UIImage?, highlightedImage: UIImage? = nil, userInfo: Any? = nil) {
self.title = title
self.accessibilityLabel = accessibilityLabel
self.image = image
self.highlightedImage = highlightedImage
self.userInfo = userInfo
}

}

extension IndicatorInfo : ExpressibleByStringLiteral {

public init(stringLiteral value: String) {
title = value
accessibilityLabel = value
}

public init(extendedGraphemeClusterLiteral value: String) {
title = value
accessibilityLabel = value
}
//extension IndicatorInfo : ExpressibleByStringLiteral {
//
// public init(stringLiteral value: String) {
// title = value
// accessibilityLabel = value
// }
//
// public init(extendedGraphemeClusterLiteral value: String) {
// title = value
// accessibilityLabel = value
// }
//
// public init(unicodeScalarLiteral value: String) {
// title = value
// accessibilityLabel = value
// }
//}

public init(unicodeScalarLiteral value: String) {
title = value
accessibilityLabel = value
}
}
2 changes: 1 addition & 1 deletion Sources/PagerTabStripViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import Foundation

// MARK: Protocols

public protocol IndicatorInfoProvider {
@objc public protocol IndicatorInfoProvider {

func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo

Expand Down