Skip to content

Instantly share code, notes, and snippets.

List of iOS Card Sheet Controllers

@atomicbird
atomicbird / logMilestone.swift
Last active August 22, 2023 03:41
Sometimes you just want to print a message that tells you a line of code was executed. Inspired by a tweet from Paige Sun: https://twitter.com/_PaigeSun/status/1161132108875796480
/// Log the current filename and function, with an optional extra message. Call this with no arguments to simply print the current file and function. Log messages will include an Emoji selected from a list in the function, based on the hash of the filename, to make it easier to see which file a message comes from.
/// - Parameter message: Optional message to include
/// - file: Don't use; Swift will fill in the file name
/// - function: Don't use, Swift will fill in the function name
/// - line: Don't use, Swift will fill in the line number
func logMilestone(_ message: String? = nil, file: String = #file, function: String = #function, line: Int = #line) -> Void {
#if DEBUG
// Feel free to change the list of Emojis, but don't make it shorter, because a longer list is better.
let logEmojis = ["πŸ˜€","😎","😱","😈","πŸ‘Ί","πŸ‘½","πŸ‘Ύ","πŸ€–","πŸŽƒ","πŸ‘","πŸ‘","🧠","πŸŽ’","🧀","🐢","🐱","🐭","🐹","🦊","🐻","🐨","🐡","πŸ¦„","πŸ¦‹","🌈","πŸ”₯","πŸ’₯","⭐️","πŸ‰","πŸ₯","🌽","πŸ”","🍿","🎹","🎁","❀️","🧑","πŸ’›","πŸ’š","πŸ’™","πŸ’œ","πŸ””"]
let logEmoji = logEmojis[abs(
@npu3pak
npu3pak / fix_twitter_warnings.sh
Last active August 20, 2023 16:39
This script fixes all TwitterKit related warnings in XCode 10.1. Add new run script build phase with this code:
readonly MODULEMAP="${PODS_ROOT}/TwitterCore/iOS/TwitterCore.framework/Modules/module.private.modulemap"
readonly HEADER="${PODS_ROOT}/TwitterCore/iOS/TwitterCore.framework/Headers/TwitterCore.h"
if ! grep -q "TwitterCore_Private" "${MODULEMAP}"; then
cat >"${MODULEMAP}" <<EOL
module TwitterCore_Private {
}
EOL
fi