Skip to content

Instantly share code, notes, and snippets.

View ulhas's full-sized avatar
🚀
Done is better than perfect.

Ulhas ulhas

🚀
Done is better than perfect.
View GitHub Profile

Daniel Sternberg - Ready for the future

  • Objective-C is not dead, it’s awesome, it’s a lovely language but you just won’t find a job if stick to it.
  • Daniel misses the Objective-C’s * in Swift. Because that way he knows that something is (or isn’t) a reference type. He also misses header files because those are nice overviews of what he can call in a certain class. Otherwise, he loves Swift.
  • Context is important in code. If you would want to get timeIntervalUntilNow you need the inverse of timeIntervalSinceNow because the latter would return a negative number. Just putting a - in front of it somewhere is bad, because there’s no context. Wrapping it in a method, - is okay to put there. That provides context. So timeIntervalUntilNow would just return -timeIntervalSinceNow.
  • Translating things from Objective-C to Swift is not thinking in Swift. Thinking in Swift doesn’t mean monads, map, flatmap, reduce and all the haskell stuff.
  • If you use protocols, like SequenceType you get a lot

Marin Todorov - Power up your animations

  • Is on the raywenderlich.com team. Monthly newsletter, iOS animation by email.
  • Animation calls on iOS are really easy. Lots of people feel like they will pick up animation along they. But then they don’t and they go to stack overflow and they pick up a bloated framework and everything is bloated and ugly and not how it has to be at all. These 3rd party libraries are slow, underperforming and way to heavy.
  • The best way to learn about animation is by experimenting. There’s not many APIs so it isn’t super complicated to do that. Three steps:
  1. Get to know your APIs
  2. Try different properties
  3. Try new layers Many people don’t really discover all this which is partially Apple’s fault because they don’t supply the best docs on this.
  • UIView.animateWithDuration(…something…), in this method there’s spring APIs. Damping and initialSpringVelocity. Velocity is hard to explain. It represents the speed that the object init
@rbobbins
rbobbins / protocols.md
Last active May 15, 2022 21:08
Notes from "Protocol-Oriented Programming in Swift"

PS: If you liked this talk or like this concept, let's chat about iOS development at Stitch Fix! #shamelessplug

Protocol-Oriented Programming in Swift

Speaker: David Abrahams. (Tech lead for Swift standard library)

  • "Crusty" is an old-school programmer who doesn't trust IDE's, debuggers, programming fads. He's cynical, grumpy.

  • OOP has been around since the 1970's. It's not actually new.

  • Classes are Awesome

    • Encapsulation
    • Access control
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@andrewgleave
andrewgleave / iOSMapKitFitAnnotations.m
Last active November 4, 2022 15:21
Zooms out a MKMapView to enclose all its annotations (inc. current location)
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations) {
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}