- July 26, 2025
- Mins Read
A simple and elegant UIKit(Chart) for iOS, written in Swift.
📊 Curve and bar Charts.
💡 Protocols are designed based on UIKit(UITableView).
🔟 Draw a complex but elegant graph in 10 minutes.
UITableView | HamsCurveChart | HamsBarChart |
---|---|---|
init(frame: CGRect) | same | same |
init?(coder aDecoder: NSCoder) | same | same |
reloadData | same | same |
UITableView | HamsCurveChart | HamsBarChart |
---|---|---|
numberOfSections(in tableView: UITableView) -> Int | numberOfCharts(in curveChart: HamsCurveChart) -> Int | numberOfCharts(in barChart: HamsBarChart) -> Int |
tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell | curveChart(_ curveChart: HamsCurveChart, pointForChart indexPath: HamsIndexPath) -> HamsCurveChartPoint | barChart(_ barChart: HamsBarChart, barForChart indexPath: HamsIndexPath) -> HamsBarChartRect |
tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int | curveChart(_ curveChart: HamsCurveChart, numberOfValuesInChart chart: Int) -> Int | barChart(_ barChart: HamsBarChart, numberOfValuesInChart chart: Int) -> Int |
HamsCurveChart | HamsBarChart |
---|---|
curveChart(_ curveChart: HamsCurveChart, configureForCharts chart: Int) | barChart(_ barChart: HamsBarChart, configureForCharts chart: Int) |
github “Howardw3/HamsterUIKit”
use_frameworks!
pod ‘HamsterUIKit’
pod install
import HamsterUIKit
git clone https://github.com/Haneke/HanekeSwift.git
HamsterUIKit.xcodeproj
 to your project in the Project Navigator.HamsterUIKit.framework
.+
 button at the top left of the panel and select New Copy Files Phase. Set Destination to Frameworks, and add HamsterUIKit.framework
.import HamsterUIKit
 whenever you want to use Haneke.
import UIKit
import HamsterUIKit
class HelloBarChartViewController: UIViewController, HamsBarChartDelegate, HamsBarChartDataSource {
var barChart:HamsBarChart = HamsBarChart()
var dataSets = [CGFloat]()
  override func viewDidLoad() {
    super.viewDidLoad()
barChart = HamsBarChart(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: 300))
barChart.delegate = self
barChart.dataSource = self
view.addSubview(barChart)
  }
func barChart(_ barChart: HamsBarChart, numberOfValuesInChart chart: Int) -> Int {
return dataSets.count
}
func numberOfCharts(in barChart: HamsBarChart) -> Int {
return 1
}
func barChart(_ barChart: HamsBarChart, barForChart indexPath: HamsIndexPath) -> HamsBarChartRect {
let rect = HamsBarChartRect()
rect.value = .plain(dataSets[indexPath.column])
rect.color = .plain(.white)
return rect
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
dataSets = [1,4,6,1]
barChart.reloadData()
}
func barChart(_ barChart: HamsBarChart, configureForCharts view: Int) {
barChart.title = “BarChart(plain)”
}
  override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
  }
}
NavigationKit is a lightweight library which makes SwiftUI navigation super easy to use. 💻 Installation 📦 Swift Package Manager Using Swift Package Manager, add ...
An alternative SwiftUI NavigationView implementing classic stack-based navigation giving also some more control on animations and programmatic navigation. NavigationStack Installation ...
With SwiftUI Router you can power your SwiftUI app with path-based routing. By utilizing a path-based system, navigation in your app becomes ...
This package takes SwiftUI's familiar and powerful NavigationStack API and gives it superpowers, allowing you to use the same API not just ...