原创 iOS-給手勢UITapGestureRecognizer添加"tag"標誌

UITapGestureRecognizer是沒有tag屬性,但他有UIView的屬性,我們可以通過給UIView添加tag屬性,從而標記UITapGestureRecognizer。 [objc] view plaincopy

原创 iOS-系統導航欄字體修改及自定製導航欄

//更改self.title的字體大小及顏色 NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],UITex

原创 iOS-UITableView 貼在最左側

UITableView 在8.0系統裏面,是距左邊有一定距離的,如果想讓UITableView貼在左側,則需要做以下處理。    #define kSystemVersion [[[UIDevice currentDevice

原创 iOS-xcode7 新特性相關

1.HTTP請求相關 在info.plist 右鍵 -》OpenAs -》Source Code -> 加入 <key>NSAppTransportSecurity</key><dict><key>NSAllowsArbitraryLoa

原创 iOS-cell可變高度相關

cell高度可變的tableView提升加載速度 //這裏爲可變cell高度計算方法 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIn

原创 iOS-判斷字符串中是否只含有\n

 一個字符串中,只有\n\n\n,通過str.length是不能判斷出來的,這個時候str.length=3,所以就要通過以下的方法。  NSString *tempStr = @"\n";         BOOL isAllEnter

原创 iOS-破解版PS

http://blog.sina.com.cn/s/blog_73dc36510101ahim.html 直接mark人家的網址,謝謝原創作者,麼麼噠。

原创 iOS-手繪點

手繪點 UIBezierPath *path = [UIBezierPath bezierPath];          CGFloat width = 150.f;     CGFloat height = self.tableVie

原创 iOS-文字轉語音

AVSpeechSynthesisVoice:用來配置發音,支持的發音非常多.個人感覺臺灣發音最好聽~通過調用 [AVSpeechSynthesisVoicespeechVoices]類方法可用看到支持的發音種類; AVSpeech

原创 iOS-清除緩存

- ( void )clearFile {     NSString * cachPath = [ NSSearchPathForDirectoriesInDomains ( NSCachesDirectory , NSUserD

原创 iOS-手繪點(類似分段選擇器下方突出的小三角)

UIBezierPath *path = [UIBezierPath bezierPath];          CGFloat width = 150.f;     CGFloat height = s

原创 iOS-比較兩張圖片內容是否相同,判斷一個imageView是否有image

首先要把需要做出判斷的imageView轉成NSData, 如果NSData爲空,則沒有圖片 if (UIImagePNGRepresentation(_picView.image) == nil) {                 

原创 iOS-置頂按鈕相關

//置頂點擊事件 - (IBAction)topClick:(UIButton *)sender {     //回到頂部     [self.tableView setContentOffset:CGP

原创 iOS-用手機查詢手機UDID

請使用 iOS 設備的 Safari 瀏覽器打開    http://fir.im/udid

原创 iOS-iOS打開手機QQ與指定用戶聊天界面

http://www.2cto.com/kf/201410/347659.html 這裏只是給了一個別人寫好的鏈接而已。