Skip to content

Instantly share code, notes, and snippets.

@tony0x59
tony0x59 / .gitignore
Created March 27, 2014 05:11
.gitignore file for iOS dev
# from: https://github.com/github/gitignore/blob/master/Global/Xcode.gitignore
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
@tony0x59
tony0x59 / UITableView+reloadDataAnimated.m
Created August 31, 2013 06:31
tableview重载数据时的淡入淡出动画过渡效果
#import "UITableView+reloadDataAnimated.h"
@implementation UITableView (reloadDataAnimated)
- (void)reloadDataWithAnimated:(BOOL)animated
{
[self reloadData];
if (animated) {
CATransition *animation = [CATransition animation];
@tony0x59
tony0x59 / moveInAnimateUIView.m
Last active December 21, 2015 22:19
从顶部弹出视图的动画效果,当退出视图时调用[self leaveView]将视图弹出。
#pragma mark - UIAnimation
- (void)willMoveToSuperview:(UIView *)newSuperview
{
[self enterView];
}
#define ANIMATE_DURATION 0.3
- (void)enterView
{
@tony0x59
tony0x59 / setUIViewAlpha.m
Last active December 21, 2015 22:19
设置本UIView透明,但子视图不受影响(不透明)
self.backgroundColor = [[UIColor darkGrayColor] colorWithAlphaComponent:0.85];
@tony0x59
tony0x59 / UIColor+CreateMethod.h
Last active December 19, 2015 01:19
UIColor便捷设置
#define UIColorFromHexRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define UIColorFrom8BitRGB(r, g, b) [UIColor \
colorWithRed:(r)/255.0 \
green:(g)/255.0 \
blue:(b)/255.0 alpha:1.0]
@tony0x59
tony0x59 / GradientView.m
Last active December 17, 2015 18:19
iOS UIView 渐变色绘制
//
// GradientView.m
// GradientDemo
//
// Created by Tony Kong on 13-5-26.
// Copyright (c) 2013年 Tony Kong. All rights reserved.
//
#import "GradientView.h"