Skip to content

Instantly share code, notes, and snippets.

@skarol
skarol / xcode-duplicate-line-up-down.md
Created November 22, 2021 12:50
Xcode duplicate current line up/down

Xcode duplicate line up/down

Bind keys to duplicate lines in Xcode

  1. Open with text editor
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist
@CodeSlicing
CodeSlicing / AppleTVRemoteNative.swift
Created July 28, 2021 22:49
Native AppleTvRemote source code for episode on multiple cursors in Xcode
//
// AppleTVRemoteNative.swift
//
// 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 copies
// of the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
@dabodamjan
dabodamjan / MailComposeViewController.swift
Last active April 24, 2024 07:31
Sending a contact us email on iOS 14 (can be also used with SwiftUI)
//
// Feel free to use this code in your project.
// Inspired by SO answer https://stackoverflow.com/a/65743126
// Uses DeviceKit as a dependency https://github.com/devicekit/DeviceKit
//
import Foundation
import MessageUI
import DeviceKit
#!/bin/sh
# make sure you have imagemagick installed: brew install imagemagick
# your app_icons.sh file should have the correct permissions: run `chmod 775 app_icons.sh` in your terminal from where you put this file
# put your `my_icon.png` next to this file and run ./app_icons.sh to export your app icons
x=my_icon.png
y=${x%.*}
# delete the export directory so we start clean
@bradhowes
bradhowes / bump-version.sh
Last active December 6, 2023 07:51
Bash script to increase build number and optionally marketing version of Xcode targets using Apple's `agvtool`
#!/bin/bash
#
# Script to bump the build number and optionally the marketing version found
# in *.info files.
#
# Usage: bump-version.sh [ARG]
#
# Without ARG, just increment the build number. When ARG is present, it indicates
# which part of the marketing version to increment:
#
@kunikullaya
kunikullaya / Date+Extension.swift
Created January 18, 2017 05:21
Date Extension for Swift
import Foundation
extension Date {
func toString(format: String = "yyyy-MM-dd") -> String {
let formatter = DateFormatter()
formatter.dateStyle = .short
formatter.dateFormat = format
return formatter.string(from: self)
}