//
// ImageViewController.swift
// SearchDemo
//
// Created by Ralf Gronkowski on 13/10/14.
// Copyright (c) 2014 Ralf Gronkowski. All rights reserved.
//
import UIKit
import MessageUI
class ImageViewController: AbstractContentViewController {
var imageView: UIImageView?
override func viewDidLoad() {
super.viewDidLoad()
imageView = UIImageView(frame: view.bounds)
if let imageView = imageView{
imageView.image = UIImage(data: thisP4FileRev.getDataFromSwarm())
view.addSubview(imageView)
imageView.contentMode = UIViewContentMode.ScaleAspectFit
}
}
}
| # | 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 |