Skip to content

Instantly share code, notes, and snippets.

View igroomgrim's full-sized avatar
🥶
Focusing

Anak Mirasing igroomgrim

🥶
Focusing
View GitHub Profile
@skymobilebuilds
skymobilebuilds / carthage-xc12.sh
Last active May 17, 2022 12:36
Xcode 13 and 12 Carthage Build Workaround
#!/bin/bash -e
echo "🤡 Applying carthage 12 and 13 workaround 🤡"
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
# the build will fail on lipo due to duplicate architectures.
CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = arm64 arm64e armv7 armv7s armv6 armv8' > $xcconfig
echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig
@SintraWorks
SintraWorks / ScrollingStackView.swift
Last active May 2, 2022 13:46
A scrolling capable drop-in replacement for UIStackView.
//
// ScrollingStackView.swift
//
// Created by Antonio Nunes on 05/08/2018.
// Copyright © 2018 SintraWorks. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@DagAgren
DagAgren / DataObjects.swift
Last active March 11, 2020 15:05
Receiving web push notifications on iOS, using the toot-relay forwarder
import Foundation
struct PushNotification: Codable {
let accessToken: String
let preferredLocale: String
let notificationId: Int64
let notificationType: Type
let icon: URL
let title: String
let body: String
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 3, 2024 08:18
Swift Concurrency Manifesto
import RxSwift
// MARK: - pausable
extension ObservableType {
/**
Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
- parameter pauser: The observable sequence used to pause the underlying sequence.
@nicklockwood
nicklockwood / gist:21495c2015fd2dda56cf
Last active August 13, 2020 13:57
Thoughts on Swift 2 Errors

Thoughts on Swift 2 Errors

When Swift was first announced, I was gratified to see that one of the (few) philosophies that it shared with Objective-C was that exceptions should not be used for control flow, only for highlighting fatal programming errors at development time.

So it came as a surprise to me when Swift 2 brought (What appeared to be) traditional exception handling to the language.

Similarly surprised were the functional Swift programmers, who had put their faith in the Haskell-style approach to error handling, where every function returns an enum (or monad, if you like) containing either a valid result or an error. This seemed like a natural fit for Swift, so why did Apple instead opt for a solution originally designed for clumsy imperative languages?

I'm going to cover three things in this post:

@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

@mattt
mattt / NSDecimalNumber.swift
Last active April 1, 2023 00:06
NSDecimalNumber Additions for Swift
import Foundation
// MARK: - Comparable
extension NSDecimalNumber: Comparable {}
public func ==(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> Bool {
return lhs.compare(rhs) == .OrderedSame
}
@syshen
syshen / gist:c24d127e1adc2783e0e7
Last active June 28, 2020 19:31
Universal framework
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"