Social Pinboard app template is the place to start to create your own social images iOS app. If you’re a user of Pinterest, Tumblr or even Instagram, you’ll know how addictive a great social image app can be. So if you want to launch the next hit app based around sharing pictures, here’s where you start. Complete with beautiful UI, slick animations and intuitive UX. We’ve done the hard work and created this functional UI template, ready for you to add in your backend API. And we’ve written it in native, modern Apple Swift. So get check out the video of it below, and get started on your iOS app now.
A beautiful Pinterest style iPhone app template. Social Pinboard app template is the place to start to create your own social images iOS app. If you’re a user of Pinterest, Tumblr or even Instagram, you’ll know how addictive a great social image app can be. So if you want to launch the next hit app […]
//
// HomeViewController.swift
// SocialPinboard
//
// Created by Rajkumar Sharma on 10/04/15.
// Copyright (c) 2015 MyAppTemplates. All rights reserved.
//
import UIKit
class HomeViewController: UIViewController {
@IBOutlet var contentScroll : UIScrollView!
var arrImages : [String] = ["home-pic-1","home-pic-2","home-pic-3","home-pic-4", "outdoor-pic-1", "outdoor-pic-2", "outdoor-pic-3"]
override func viewDidLoad() {
super.viewDidLoad()
self.populateScrollView()
// Do any additional setup after loading the view.
}
func populateScrollView() {
var width = (self.view.frame.size.width - 30) / 2
var xValueRow1 : CGFloat = CGFloat(10.0)
var xValueRow2 : CGFloat = width + 20
var yValueRow1 : CGFloat = CGFloat(9.0)
var yValueRow2 : CGFloat = CGFloat(9.0)
var lastHeight : CGFloat = 0
var dataHeight : CGFloat = 120
var margin : CGFloat = 20
for value in 1...7 {
var view : GridView!
var image : UIImage! = UIImage(named: arrImages[value - 1])
var height = CGFloat(width) * (image.size.height / image.size.width)
var currentX : CGFloat = xValueRow1
var currentY : CGFloat = yValueRow1
if value%2 == 0 {
currentX = CGFloat(xValueRow2)
currentY = CGFloat(yValueRow2)
}
view = GridView(frame: CGRectMake(CGFloat(currentX), CGFloat(currentY), CGFloat((self.view.frame.size.width - 30)/2), height + dataHeight))
view.backgroundColor = UIColor.whiteColor()
view.addDataAfterHeight(height)
var ImgView : UIImageView! = UIImageView(frame: CGRectMake(0, 0, width, height))
ImgView.image = image
view.addSubview(ImgView)
if value%2 == 0 {
yValueRow2 = yValueRow2 + height + dataHeight + margin
} else {
yValueRow1 = yValueRow1 + height + dataHeight + margin
}
var Btn : UIButton;
Btn = UIButton(frame: CGRectMake(0, 0, view.frame.size.width, view.frame.size.height))
view.addSubview(Btn)
Btn.addTarget(self, action: "showNextScreen", forControlEvents: UIControlEvents.TouchUpInside)
contentScroll.addSubview(view)
if (currentY + height + dataHeight + margin) > lastHeight {
lastHeight = currentY + height + dataHeight + margin
}
contentScroll.contentSize = CGSizeMake(contentScroll.contentSize.width, lastHeight )
}
}
func showNextScreen() {
self.performSegueWithIdentifier("showDetail", sender: nil)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func backBtnTapped(sender : UIButton) {
self.navigationController?.popViewControllerAnimated(true)
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}