Skip to content

Commit

Permalink
Merge pull request #38 from Leanplum/set-dob
Browse files Browse the repository at this point in the history
Set DOB
  • Loading branch information
nzagorchev authored Oct 25, 2022
2 parents 4aa9bf0 + 3c1103a commit d8f1e90
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Rondo/UI/Migration/MigrationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ class MigrationViewController: FormViewController {
"arr": ["c", 3, "d", 4, nil], // optionals
"empty": nil])
})

section <<< ButtonRow(){
$0.title = "Set DOB"
}.onCellSelection({ cell, row in
let dateFormatter = DateFormatter()
dateFormatter.timeZone = TimeZone.init(abbreviation: "UTC")
dateFormatter.dateFormat = "dd-MM-yyyy"
if let date = dateFormatter.date(from: "10-01-1999") {
Leanplum.setUserAttributes(["DOB": date])
}
})

form +++ section
}
Expand Down

0 comments on commit d8f1e90

Please sign in to comment.