Question: i am trying to do select with border inside and also custom icon.Here what i already did:

```
<label class="custom-select">
  <select class="form-control black">
    <option>1to9</option>
  </select>
</label>

```

<https://jsfiddle.net/o1r97q4o/>  

And here is what i want to do

[![enter image description here](https://i.stack.imgur.com/FTzLSm.png)](https://i.stack.imgur.com/FTzLSm.png)

Answer: 
`insertUserData` method method opens transactions so many times in the loop. To commit transaction is a little bit expensive operation.

Can you try to put out to open/commit a transaction outside of the loop?
In other words, open the transaction before entering the loop, and commits the transaction once after the end of the loop. Like the following:

```
if results.count > 0 {
    if let users = results.array {
        let realm = try! Realm()
        try realm.write {
            for user in users{
                let userList=UserList()
                userList.start=user["Start”].stringValue
                userList.end=user[“End”].stringValue
                userList.name=user[“Name”].stringValue
                userList.address =user[“Address”].stringValue
                realm.add(userList,update: true)
            }
        }
    }
}

```
I have fixed slow insertion issue by using this code.

```
func addAsBatch<T: Object>(_ data: [T]) {
    if !isRealmAccessible() { return }

    let realm = try! Realm()
    realm.refresh()

    realm.beginWrite()
    for object in data {
        realm.add(object)
    }
    try? realm.commitWrite()
}

```

Showing function use with your example - 

```
let userList = UserList()
userList.start = user["Start”].stringValue
userList.end = user[“End”].stringValue
userList.name = user[“Name”].stringValue
userList.address  = user[“Address”].stringValue

addAsBatch(userList)

```