原创 UIView、UIResponder、UIAlertView、UIActionSheet

code 通用 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgrou

原创 Label_TextField_自定義視圖

LTView.h @interface LTView : UIView <UITextFieldDelegate> @property (nonatomic, retain) UILabel *myLabel; @propert

原创 UILabel

UILabel UILabel code 文本中間對齊 圓角邊框 設置字體大小 property Method code 文本中間對齊 UILabel *myLabel = [[UILabel alloc

原创 UIButton

code UIButtonTypeSystem型,默認藍色 UIButton *myButton = [UIButton buttonWithType:UIButtonTypeSystem]; myButton.f

原创 自定義瀑布流

DKFlowLayout類 DKFlowLayout.h // 在.h裏@class, 在.m裏#import @class DKFlowLayout; @protocol DKFlowLayoutDelegate <NSObject>

原创 界面傳值

Block 傳值 後一頁向前一頁傳值 ViewController先向DetailViewController跳轉 DetailViewController頁面往ViewController頁面傳值 1.View.m // View向

原创 毛玻璃效果

code 毛玻璃效果 UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; UIVisualEffectView *visu

原创 數據持久化

前奏 文件的路徑有幾種方式獲取, 比如直接從工程拽出來的路徑是當前工程文件夾的路徑, 這個路徑會隨着工程的移動而發生變化 也可通過 NSBundle 獲取, bundle 可以獲取工程裏文件的路徑, 這個路徑不會隨着工程

原创 BaseModel

.h @interface BaseModel : NSObject + (NSMutableArray *) baseModelByArr: (NSArray *) arr; @end .m @implementation Base

原创 NetWorkingTool

.h @protocol NetWorkingToolDelegate <NSObject> - (void)bringValue: (id) result; @end @interface NetWorkingTool : NSO

原创 省市區存儲數據

樣本 北京 1 北京市 1 西城區 1 東城區 2 .... 天津 2 天津市 2 和平區 19 河東區 20 河西區 21 ... 河北 3 石家莊市 3 長安

原创 UITableView

code 設置 UITableView – 高級 @property (nonatomic, retain) UITableView *myTableView; // 創建 UITableView self.myTableVie

原创 UITableViewController

code App.m self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; [self.window makeKey

原创 相冊,循環滾動,可縮放

#import "ViewController.h" #define HEIGHT 400 #define WIDTH self.view.frame.size.width @interface ViewController ()<UIS

原创 UIScrollView、UIPageControl、NSTimer

UIScrollView code // 寬度爲屏幕寬度9倍的UIScrollView UIScrollView *myScrollView = [[UIScrollView alloc] initWithFrame: self.