跳到主要內容

發表文章

目前顯示的是 12月, 2015的文章

[IOS] xcode 複製專案並修改專案名稱

xcode 複製專案並修改專案名稱 1.將專案copy到新的folder下(OLD->NEW) 2.用xcode打開OLD.xcodeproj 3.將專案名稱點兩下直接改名,改完後clean and close 4.回到NEW目錄下將所有的資料夾及檔案名稱全改成NEW 5.對NEW.xcodeproj顯示套件內容,用xcode打開project.pbxproj,將所有的OLD換成NEW 6.到manager schemes修改scheme名稱 搞定 !

[IOS] Remote logging

使用 https://logentries.com 註冊完後就直接來新增一個log set                   這裡我是用IOS                     這裡我是設定App名稱               下載lib到Project裡,把 lelib 資料夾拉進xcode裡           很貼心,把相關程式都寫出來                                         完成!超簡單!      

[IOS] 一些切割圖片的套件

可以在圖片上拉一個隨意的方形來切割 (Objective-C) https://github.com/myang-git/iOS-Image-Crop-View   先設定一個圖形的mask,讓圖片可以在後面拖拉縮放(Objective-C) https://github.com/DuncanMC/CropImg   https://github.com/gavinbunney/Toucan

[Swift] 將 TableView 或 CollectionView 的 Cell 加上類似 button 的 TouchDown 的效果

class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { override func viewDidLoad() { super.viewDidLoad() self.tableView.dataSource = self self.tableView.delegate = self // 加上這一行才不會看不到TouchDown的效果 self.tableView.delaysContentTouches = false //... } //... // MARK: - UITableViewDelegate func tableView(tableView: UITableView, didHighlightRowAtIndexPath indexPath: NSIndexPath) { let cell = tableView.cellForRowAtIndexPath(indexPath)! cell.alpha = 0.3 } func tableView(tableView: UITableView, didUnhighlightRowAtIndexPath indexPath: NSIndexPath) { let cell = tableView.cellForRowAtIndexPath(indexPath)! cell.alpha = 1 } }

[Swift] 幫 UITextField 增加一個 done 按鈕

func addDoneButtonOnKeyboard(targetField:UITextField) { let doneToolbar: UIToolbar = UIToolbar(frame: CGRectMake(0, 0, 320, 50)) doneToolbar.barStyle = UIBarStyle.BlackTranslucent let flexSpace = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil) let done: UIBarButtonItem = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Done, target: self, action: Selector("doneButtonAction")) var items = Array<UIBarButtonItem>() items.append(flexSpace) items.append(done) doneToolbar.items = items doneToolbar.sizeToFit() targetField.inputAccessoryView = doneToolbar }