What do you want to save?
Add Code snippet
New code examples in category Swift
-
Krish 2022-03-12 09:15:04
swift add horizontal line uiview programmatically
// create path let path = UIBezierPath() path.move(to: CGPoint(x: 10, y: 10)) path.addLine(to: CGPoint(x: 100, y: 100)) // Create a `CAShapeLayer` that uses that `UIBezierPath`: let shapeLayer = CAShapeLayer() shapeLayer.path = path.cgPath shapeLayer.s... Add solution -
-
Awgiedawgie 2022-03-04 02:35:05
swift get current hour
let date = Date() // save date, so all components use the same date let calendar = Calendar.current // or e.g. Calendar(identifier: .persian) let hour = calendar.component(.hour, from: date) let minute = calendar.component(.minute, from: date) let second... Add solution