Swift開發條碼掃描器:Mockingbird

jopen 9年前發布 | 14K 次閱讀 Apple Swift開發 Mockingbird

 Swift開發條碼掃描器:Mockingbird

Requirements

  • iOS 7.0+
  • Xcode 6.3
  • </ul>

    Use

    let storyboard:UIStoryboard = UIStoryboard(name: "Mockingbird", bundle: NSBundle.mainBundle())
    let navC:UINavigationController = storyboard.instantiateViewControllerWithIdentifier("MockingbirdNavigationID") as! UINavigationController
    let mockingbird:MockingbirdScanCodeManager = navC.topViewController as! MockingbirdScanCodeManager
    mockingbird.globalTitle = "掃描條碼"
    mockingbird.globalColor = MOKTeal
    self.presentViewController(navC, animated: true, completion: nil)

    property

    • globalColor:UIColor? 設置全局的顏色
    • globalTitle:String? 設置導航標題
    • previewLineColor:UIColor? 設置線動畫的顏色
    • </ul>

      Notification

      NSNotificationCenter.defaultCenter().addObserver(self, selector: "mockingbird:", name:MOKNotifiScanResult, object: nil)

      scan code result | 通過通知來獲取掃描的結果

      OR Callback Func

      scan code result | 或者通過回調函數

      mockingbird.mockingbirdResult = {(value:String?)->Void in
         println(value)
         println("回調函數")
         if let _value = value{
             self.scancode.text = _value
         }
      }

      how learning used AVFoundation to create scan code

      how learning used AVFoundation to create scan code | 利用AVFoundation實現掃描條碼


      項目主頁:
      http://www.baiduhome.net/lib/view/home/1434464821895

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!