How do you write property on Swift?



  • @interface ViewController ()
    @property (strong, nonatomic) LGFilterView  *filterView1;
    @end
    @implementation ViewController
    - (void)viewDidLoad {
        [super viewDidLoad];
        [_filterView1 initWithTitles:<#(NSArray *)#>];}
    

    That's what I did on Obj-C to do initWithTitles from LGFilterView.

    class MainViewController: UIViewController, UITableViewDelegate,UITableViewDataSource {    
    

    var filterView1:LGFilterView!

    That's what I did on Swift, but he doesn't see how to call.

    This is the library itself:
    https://github.com/Friend-LGA/LGFilterView



  • When you in your project create the first swift class, hecode will ask you if you want to create a bridging header.

    //
    //  Use this file to import your target's public headers that you would like to expose to Swift.
    //
    

    #import "LGFilterView.h"




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2