instant-solutions / ISTimeline

Simple timeline view written in Swift 3
Apache License 2.0
1.01k stars 79 forks source link

get strange wrong when using oc invoke timeline.points #13

Open mmmrt opened 6 years ago

mmmrt commented 6 years ago

halo master forgive my poor english i get wrong when using oc invoke timeline

h file

@interface UserDetailViewController : UIViewController
@property (strong, nonatomic) IBOutlet ISTimeline *timeline;
@end

m file

- (void)viewDidLoad {
    [super viewDidLoad];
    self.timeline //Property 'points' not found on object of type 'ISTimeline *'
}

But other property of timeline is found except 'points' could u tell me whats problem with that?

i notice something u might want to know as follow ISTimeline.h

import UIKit

public class ISTimeline : UIScrollView {
    open var pointDiameter: CGFloat { get set }
    open var lineWidth: CGFloat { get set }
    open var bubbleRadius: CGFloat { get set }
    open var bubbleColor: UIColor
    open var titleColor: UIColor
    open var descriptionColor: UIColor
    open var points: [ITUserSample.ISPoint] { get set }
    open var bubbleArrows: Bool
    override public init(frame: CGRect)
    required public init?(coder aDecoder: NSCoder)
    override open func draw(_ rect: CGRect)
    override open func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?)
}

ISPoint.h

import UIKit

public class ISPoint {
    open var title: String
    open var description: String?
    open var pointColor: UIColor
    open var lineColor: UIColor
    open var touchUpInside: Optional<(_ point: ISPoint) -> Void>
    open var fill: Bool
    public init(title: String, description: String, pointColor: UIColor, lineColor: UIColor, touchUpInside: Optional<(_ point: ISPoint) -> Void>, fill: Bool)
    public convenience init(title: String, description: String, touchUpInside: Optional<(_ point: ISPoint) -> Void>)
    public convenience init(title: String, touchUpInside: Optional<(_ point: ISPoint) -> Void>)
    public convenience init(title: String)
}
mmmrt commented 6 years ago

i found the reason that ISPoint does not inherit from nsobject. which makes the property ‘points’ not define in ‘project-Swift.h’ file.

thx all