Swiftpack.co - Package - sam38124/JzOsAdapter

Platform characteristic

JzOsAdapter

Based on the android RecyclerView, let tableview highly encapsulated and use like android recyclerView~

List

Import to project

Support Swift Package。

1.Open xcode and paste link for Swift Package

  • https://github.com/sam38124/TestLibrary/JzOsAdapter

Vertical LinearLayout

lazy var adapter=LinearAdapter(tb: tb, count: {
        //return your item count
        return 5
    }, nib: ["Place your xib1","Place your xib2"], getcell: {
        tableview,indexpath,position in
if(position==0){
let cell=a.dequeueReusableCell(withIdentifier: "Place your xib what is define in nib  array") as! Cell_Program_Detail
 return cell
}else{
let cell=a.dequeueReusableCell(withIdentifier: "Place your xib what is define in nib  array") as! Cell_Program_info
 return cell
}    
}, {
        clickPosition in
        //If click item will reback to this callback
    })

Horizontal LinearLayout

    lazy var adapter=HorizontalAdapter(tb: tb, width:UIScreen.main.bounds.width/3, height: UIScreen.main.bounds.width/3
    , count: {return self.item.make.count}, nib: "Cell_Make", getcell: {
        a,b,c in
        let cell=a.dequeueReusableCell(withReuseIdentifier: "Cell_Make", for: b) as! Cell_Make
        return cell
    },scrollback: {
        //If stop scrolling with call this function
    })

GridLayout

//Replace count to your itemcount
//Replace spilt to  how many item you want to display in per line
    lazy var adapter=GridAdapter(tb: tb, width:UIScreen.main.bounds.width/3, height: UIScreen.main.bounds.width/3
    , count: {return self.item.make.count}, spilt: 3, nib: "Cell_Make", getcell: {
        a,b,c in
        let cell=a.dequeueReusableCell(withReuseIdentifier: "Cell_Make", for: b) as! Cell_Make
        return cell
    })

2.Refresh layout

adapter.notifyDataSetChange()

About me

Work for:

  • 【Orange Electronic】

Position:

  • Full stack engineer

Main defense range:

  • Android and IOS(4 years)
  • Jsp(2 years)
  • Javascript and Jquery and Ktor(1 years)

Contact information:

  • line:sam38124
  • gmail:sam38124@gmail.com

Github

link
Stars: 1

Dependencies

Used By

Total: 0

Releases

- 2020-09-10 04:25:30

- 2020-09-10 02:54:57