Skip to content

Instantly share code, notes, and snippets.

View mehdin13's full-sized avatar

Mehdi Negahban mehdin13

View GitHub Profile
@imkevinxu
imkevinxu / Device.swift
Last active March 4, 2023 16:09
iOS device checks for OS version and screen size in Swift
//
// Device.swift
// imHome
//
// Created by Kevin Xu on 2/9/15. Updated on 6/20/15.
// Copyright (c) 2015 Alpha Labs, Inc. All rights reserved.
//
import Foundation
@alex-zige
alex-zige / gist:523f8f0a8534eebff731
Last active May 23, 2023 09:45
Custom Search Bar in Nav
@mbigatti
mbigatti / UIColor+RGB.swift
Last active February 14, 2021 07:22
UIColor extension that add a whole bunch of utility functions.
//
// UIColor+RGB.swift
// Copyright (c) 2014 Massimiliano Bigatti. All rights reserved.
//
import Foundation
import UIKit
/**
UIColor extension that add a whole bunch of utility functions like:
@nicklockwood
nicklockwood / gist:10399979
Last active March 14, 2019 13:08
How to put a fixed search bar in a UITableViewController
#import "TableViewController.h"
@interface TableViewController ()
@property (nonatomic, strong) UISearchBar *searchBar;
@end
@implementation TableViewController
@alvareztech
alvareztech / gist:7162180
Created October 25, 2013 21:33
iOS: Delegate UISwitch change state.
[yourSwitchObject addTarget:self action:@selector(setState:) forControlEvents:UIControlEventValueChanged];
- (void)setState:(id)sender {
BOOL state = [sender isOn];
}
@benvium
benvium / FadeSplash.m
Created September 28, 2012 09:05
iOS: Fade from the splash screen to your initial view. Works on iPhone 5 (and 4,3). Add a UIImageView property called splashView.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//.. do other setup
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
// Transition neatly from splash screen
// Very odd, on iPhone 5 you need to position the splash screen differently..
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 15, 2025 08:33
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S