Skip to content

Instantly share code, notes, and snippets.

View Yoloabdo's full-sized avatar
:octocat:
Building another UIViewController

Abdoelrhman Yoloabdo

:octocat:
Building another UIViewController
View GitHub Profile
@veritech
veritech / CALayer.m
Created April 12, 2011 12:24
Using CAKeyFrameAnimation to animate images in a CALayer
//Create the layer
layer = [CALayer layer];
//Configure the animation
animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
[animation setCalculationMode:kCAAnimationDiscrete];
[animation setDuration:2.0f];
[animation setRepeatCount:HUGE_VALF];
@haldun
haldun / gist:7535617
Last active April 17, 2018 22:42
books to be read

Advanced Mac OS X Programming: The Big Nerd Ranch Guide

While there are several books on programming for Mac OS X, Advanced Mac OS X Programming: The Big Nerd Ranch Guide is the only one that contains explanations of how to leverage the powerful underlying technologies. This book gets down to the real nitty-gritty. The third edition is updated for Mac OS X 10.5 and 10.6 and covers new technologies like DTrace, Instruments, Grand Central Dispatch, blocks, and NSOperation.

Cocoa Design Patterns

“Next time some kid shows up at my door asking for a code review, this is the book that I am going to throw at him.” –Aaron Hillegass, founder of Big Nerd Ranch, Inc., and author of Cocoa Programming for Mac OS X Unlocking the Secrets of Cocoa and Its Object-Oriented Frameworks Mac and iPhone developers are often overwhelmed by the breadth and sophistication of the Cocoa frameworks. Although Cocoa is indeed huge, once you understand the object-oriented patterns it uses, you’ll find it remarkably elegant, consist

//
// ViewController.m
// AVPlayerCaching
//
// Created by Anurag Mishra on 5/19/14.
// Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer
//
#import "ViewController.h"
#import <AVFoundation/AVFoundation.h>
@staltz
staltz / introrx.md
Last active May 19, 2026 02:25
The introduction to Reactive Programming you've been missing
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active March 21, 2026 18:03
The best FRP iOS resources.

Videos

Git Cheat Sheet

Commands

Getting Started

git init

or

@kiwiznesic
kiwiznesic / UIColor+Random.swift
Last active October 6, 2015 11:45
Get random UIColor with Swift
/*
UIColor class method that returns a random color. All parameters are optional.
*/
import UIKit
extension UIColor{
class func randomColor(hue:CGFloat? = ( CGFloat( CGFloat(arc4random()) % 256 / 256.0 ) ),
saturation:CGFloat? = ( CGFloat( CGFloat(arc4random()) % 128 / 256.0 ) + 0.5 ),
brightness:CGFloat? = ( CGFloat( CGFloat(arc4random()) % 128 / 256.0 ) + 0.5 ),
@chriseidhof
chriseidhof / tableviews.swift
Last active October 15, 2023 20:56
trySwift
import UIKit
// If you enjoyed this talk (video link will be up soon), then you might also enjoy our book Advanced Swift: http://www.objc.io/books/advanced-swift
struct Person {
let name: String
let city: String
}
let people = [
@uhw76tgwquerhjbqwnejk
uhw76tgwquerhjbqwnejk / gist:7be323b066058667851b
Created March 28, 2016 05:51
Video Loading/Caching with AVAssetResourceLoader
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
VideoCell *videoCell = (VideoCell *)[self.tableView dequeueReusableCellWithIdentifier:@"VideoCell"];
NSString *urlString = @"streaming://download.wavetlan.com/SVV/Media/HTTP/MOV/ConvertedFiles/MediaCoder/MediaCoder_test11_36s_H263_VBR_590kbps_176x144_25fps_MPEG1Layer3_CBR_160kbps_Stereo_22050Hz.mov";
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
// Configure Video Cell Here:
NSURL *url = [NSURL URLWithString:urlString];
videoCell.contentView.backgroundColor = [UIColor clearColor];
videoCell.backgroundColor = [UIColor clearColor];
@IBDesignable
class UIPaddedLabel:UILabel {
@IBInspectable var topPadding:CGFloat = 0 {
didSet {
updatePadding()
}
}
@IBInspectable var leftPadding:CGFloat = 0 {
didSet {