Skip to content

Instantly share code, notes, and snippets.

View shams-ahmed's full-sized avatar
🌞

Shams Ahmed shams-ahmed

🌞
View GitHub Profile
@lostincode
lostincode / CollectionViewDataSource.swift
Last active December 27, 2018 16:38
Lighter View Controller (UICollectionViewDatasource) in Swift
//
// CollectionViewDataSource.swift
//
// Created by Bill Richards on 10/1/14.
// Copyright (c) 2014 Bill Richards. All rights reserved.
//
import Foundation
typealias CollectionViewCellConfigureBlock = (cell:UICollectionViewCell, item:AnyObject?) -> ()
@krzyzanowskim
krzyzanowskim / define_for_all_pods
Last active March 26, 2020 09:42
Disable NSLog with all CocoaPods with post_install hook.
post_install do | installer |
print "Updating #{installer.sandbox.target_support_files_root}/Pods/Pods-environment.h\n"
open("#{installer.sandbox.target_support_files_root}/Pods/Pods-environment.h","a") do |file|
file.puts <<EOF
// Disable logs
#ifndef DEBUG
#define NSLog(...)
#endif
EOF
end
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@krzysztofzablocki
krzysztofzablocki / gist:4396302
Last active November 24, 2021 19:17
Set symbol breakpoint on objc_msgSend then setup this debug command to log all methods called in iOS Simulator. If you want to do device debugging change esp+4 register to r0, esp+8 to r1 Found long ago somewhere on stackoverflow.
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) )
@mbinna
mbinna / podforceupdate.sh
Created December 4, 2012 09:43
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update