Skip to content

Instantly share code, notes, and snippets.

@d-ronnqvist
d-ronnqvist / re-enable delete action.markdown
Last active January 6, 2024 07:23
How to break (and re-enable) the native accessibility "delete" action for table views

If you've haven't seen it before, there is a cool accessibility feature in UITableView that allows the user to toggle between different actions. It's really very elegant and it's a powerful and convenient implementation for VoiceOver users on iOS. One could say that it's the VoiceOver version of the swipe-to-delete feature.

To try it out yourselves, open one of the built in apps like Mail or Notes and turn on VoiceOver. If you are afraid to accidentally delete some of your important notes or email, you can also create a new Master-Detail Application in Xcode and run it on your device. Navigate to one of the cells and use the "Rotor" (rotate with two fingers on the screen) to find the "Actions" item. Now you can swipe up and down do toggle between "Activate Item (default action)" and "Delete". If you now double tap, the cell gets deleted instead of selected.

image with actions

This is the default behavior and you get this accessibility out of the box with UITableView.

@cybertk
cybertk / resign-ipa.py
Created April 8, 2014 17:37
Resign ipa
#!/usr/bin/env python
# Copyright (c) 2013 Quanlong He. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
resign-ipa.py -- Resign the ipa with new certificate and mobileprovision.
"""
"""
@truppelito
truppelito / Webclip Creator.py
Created March 14, 2014 20:42
Webclip Creator
import uuid, BaseHTTPServer, select, types, clipboard, console, photos, PIL, base64, urllib, webbrowser
from SimpleHTTPServer import SimpleHTTPRequestHandler
try: from cStringIO import StringIO
except ImportError: from StringIO import StringIO
keep_running = True
base_mobileconfig = """
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>PayloadContent</key><array><dict>
@steipete
steipete / Macros.h
Last active January 6, 2024 07:24
Declare on your main init that all other init methods should call. It's a nice additional semantic warning. Works with Xcode 5.1 and above. Not tested with earlier variants, but should just be ignored. A reference to this macro shortly appeared in https://developer.apple.com/library/ios/releasenotes/ObjectiveC/ModernizationObjC/AdoptingModernObj…
#ifndef NS_DESIGNATED_INITIALIZER
#if __has_attribute(objc_designated_initializer)
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer))
#else
#define NS_DESIGNATED_INITIALIZER
#endif
#endif
@lldong
lldong / ruby-gems-for-xcoder.md
Last active March 8, 2020 10:20
Ruby Gems for Cocoa Developer
  • liftoff Xcode 工程配置工具
  • crafter Xcode 工程配置工具,使用 Ruby 进行配置,比 liftoff 灵活
  • xcpretty xcodebuild 输出格式化工具
  • xclisten 测试用例自动执行工具
  • bwoken UIAutomation 脚本执行工具
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
@tangqiaoboy
tangqiaoboy / UIView+frameAdjust.h
Last active March 25, 2020 04:18
Adjust UIView frame category
//
// UIView+frameAdjust.h
// fenbi
//
// Created by Tang Qiao on 12-5-31.
// Copyright (c) 2012年 Fenbi.com . All rights reserved.
//
#import <Foundation/Foundation.h>
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
# Extension Copyright (c) 2013 Weptun Gmbh
# http://www.weptun.de
#
# Extended by Ronan O Ciosoig January 2012
#
# Extended by Patrick Blitz, April 2013
@lexrus
lexrus / uncrustify.cfg
Last active December 21, 2015 13:59
My ~/.uncrustify/uncrustify.cfg for https://github.com/benoitsan/BBUncrustifyPlugin-Xcode
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.4.3 (252)
#
# Alignment
# ---------
## Alignment
@WeptunUser
WeptunUser / floatsign.sh
Last active January 1, 2022 21:23 — forked from mediabounds/floatsign.sh
Now fix when no entitlements are present.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
# Extension Copyright (c) 2013 Weptun Gmbh
# http://www.weptun.de
#
# Extended by Ronan O Ciosoig January 2012
#
# Extended by Patrick Blitz, April 2013