Skip to content

Instantly share code, notes, and snippets.

View robbdimitrov's full-sized avatar

Robert Dimitrov robbdimitrov

View GitHub Profile
@robbdimitrov
robbdimitrov / RDVNetworkActivityIndicatorManager.h
Last active December 16, 2015 04:29
Simple NetworkActivityIndicator manager
// RDVNetworkActivityIndicatorManager.h
//
// Copyright (c) 2013 Robert Dimitrov
//
// 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:
@robbdimitrov
robbdimitrov / Person.h
Created June 19, 2013 09:21
Test object subscripting in Objective-C
//
// Person.h
// SubscriptingSample
//
// Created by Robert Dimitrov on 6/19/13.
// Copyright (c) 2013 Robert Dimitrov. All rights reserved.
//
#import <Foundation/Foundation.h>

Development Environment Setup

Install Xcode

Download Xcode from Apple Developer. Install Command Line Tools and iOS 6 simulator.

Setup terminal

@robbdimitrov
robbdimitrov / iOS and Objective-C snippets.md
Last active August 6, 2020 03:56
Useful iOS and Objective-C snippets

iOS and Objective-C snippets

Move content from underneath the navigationBar (iOS 7)

if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
    [self setEdgesForExtendedLayout:UIRectEdgeRight|UIRectEdgeBottom|UIRectEdgeLeft];
}

Change the color of the back arrow in navigationBar (iOS 7)

@robbdimitrov
robbdimitrov / regularexpressions.md
Last active October 8, 2017 10:10
Regular expressions

Regular expressions

Phone number

^\\+?[0-9]{6,15}$

Email address

@robbdimitrov
robbdimitrov / NSObject+PrivateSuperMethod.h
Created May 8, 2014 08:57
Call private methods on super without warnings
// NSObject+PrivateSuperMethod.h
//
// Copyright (c) 2014 Robert Dimitrov
//
// 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:
@robbdimitrov
robbdimitrov / OSX Tricks.md
Last active August 29, 2015 14:01
OSX Fixes

OSX Fixes

Reset Airplay when unable to select it as a sound output device

sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'`

Uninstall Java

@robbdimitrov
robbdimitrov / CMTWTRConposerViewControlller.h
Created May 13, 2016 13:17
Twitter doesn't allow setting text in TWTRConposerViewControlller, which is used for app cards. This is a simple hack to do just that.
//
// CMTWTRConposerViewControlller.h
// ProtoSketch
//
// Created by Robert Dimitrov on 5/13/16.
// Copyright © 2016 Codemotion Ltd. All rights reserved.
//
#import <TwitterKit/TwitterKit.h>
@robbdimitrov
robbdimitrov / UIResponder+CMAdditions.h
Created May 23, 2016 11:20
Find the active responder by going through the responder chain
//
// UIResponder+CMAdditions.h
// ProtoSketch
//
// Created by Robert Dimitrov on 5/23/16.
// Copyright © 2016 Codemotion Ltd. All rights reserved.
//
#import <UIKit/UIKit.h>
@robbdimitrov
robbdimitrov / CarouselView.swift
Last active April 3, 2018 12:25
Swift 3 Carousel view
//
// Author: Robert Dimitrov
//
// License: MIT
//
import UIKit
//MARK: - CarouselViewDelegate protocol