Ilker Furkan Kahyalar

Ilker Furkan Kahyalar

Software Engineer


Home

Podcast

Projects

References

Contact


Subscribe


TIL - 21 January 2021

Hello everyone! Let’s take a look what I learned in 21 January 2021, shall we?

#1 - CodingKeys

Let’s assume you have DTO with some fields. But in your POST request, you are not going to send all the data that DTO has. We can use CodingKeys to say which fields are included in the request.

struct Document: Encodable {
  let fileName: String
  let fileSize: String
  
	private enum CodingKeys: String, CodingKey {
    case fileName
  }
}

#2 - CornerRadius

Source: https://www.swiftbysundell.com/articles/rounded-corners-uikit-swiftui/

We can define specific corners to have a corner radius, not the whole view. (Works like coordinate system.)

layer.maskedCorners = [.layerMinXMinYCorner] 

Also, with property of cornerCurve, we can make corners more smoother.

layer.cornerCurve = .continuous

Other Findings

  1. Operator Overloading

Closing Notes

I hope you liked what you heard and I am really looking forward to seeing you in the next one!

  • Keep up to date and follow @kahyalar.xyz on Instagram. DMs are always welcome! 🔥

  • You can reach out to me via Contact Form, Email and social media icons in the left. 💌

Buy Me A Coffee

Until next one,
Furkan