Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's not just restricted to CSS either.

I made an app that lets you highlight quotes on Apple devices and it was such a pain building it in Swift. Just highlighting so it would look absolutely beautiful took about a month (it was also my first time learning the language). I had to dig deep down into the way fonts worked. CGRect became my best friend.

Fun project, but there's a reason why you don't see a lot of apps replicating Medium.com's highlighting feature. I also believe it's why highlighting text on iOS devices breaks every couple of months.

It's literally built a top a mountain of chewing gum and sticks holding it together. It's a mess.



Not necessarily for a Swift project, but your experience makes me wonder about the current web API for highlighting spans of text.

https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/...

Complicated...


Man that gave me flashbacks…

Ludicrously difficult. I thought there would be a library for it or something.

I should make it open-source. I spent so much time on it and it doesn’t see much use. And I’m sure a lot of programmers could use it in a project somewhere.


Seems kinda straightforward to me, especially compared to the complexity of other web APIs? It's just a couple classes and functions. What am I missing?

It's not easy to read, but web specs are always written in over complicated and overly detailed prose that might as well have been written by a lawyer.


I'm sure it's relatively easy for someone experienced with programming. I wrote the program back when I was learning Swift for the first time. There's a lot of counterintuitive shapes and graphics and knowledge you need. It's not linear algebra "difficult", but it does accumulate, until you're wondering why you're spending so much time drawing rectangles over text.

I enjoyed the project, but it was definitely rife with a lot of strange behavior layered on top of each other.

And Apple Documentation is a bit of a nightmare and basically useless in most cases.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: