// // TextViewController.swift // SearchDemo // // Created by Ralf Gronkowski on 13/10/14. // Copyright (c) 2014 Ralf Gronkowski. All rights reserved. // import UIKit import MessageUI class TextViewController: AbstractContentViewController{ var textView: UITextView? override func viewDidLoad() { super.viewDidLoad() textView = UITextView(frame: view.bounds) if let textView = textView{ textView.font = UIFont(name : "Courier Prime",size : 10) textView.contentInset = defaultContentInset textView.text = NSString(data: thisP4FileRev.getDataFromSwarm(), encoding: NSUTF8StringEncoding) textView.editable = false view.addSubview(textView) } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 10709 | gronk |
First working example of an iOS app that searches in P4Search and displys content by retrieving it from Swarm. There is a file JSON.swift in the project in which you need to paste some external code from here https://github.com/lingoer/SwiftyJSON/blob/master/SwiftyJSON/SwiftyJSON.swift to simplify JSON parsing. You will also need access to a running P4Search and Swarm instance if you want to run the app on a device or inside an emulator. Coded in Swift with XCode 6.0.1 |