第一步:用cocoapods 安装pop
1.新建一个工程在根目录创建一个空文件Podfile,
2.在Podfile中写入 pod 'pop','~> 1.0'
3.关闭工程,在终端进入工程目录,然后输入pod install 进行安装
4.安装结束,打开工程文件夹的xworkspace文件
5.进入工程之后建立swift-oc的桥接头文件 import "POP.h"
6.到此pop安装完成
第二步:使用pop,demo代码如下
demo效果,放大两倍,旋转180度,移动位置,改变背景颜色
//
// ViewController.swift
// Popswift
//
// Created by lyj on 15/3/22.
// Copyright (c) 2015年 lyj. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let redBall = UIView(frame: CGRect(x: 50, y: 50, width: 100, height: 100))
redBall.backgroundColor = UIColor.redColor()
self.view.add
1.新建一个工程在根目录创建一个空文件Podfile,
2.在Podfile中写入 pod 'pop','~> 1.0'
3.关闭工程,在终端进入工程目录,然后输入pod install 进行安装
4.安装结束,打开工程文件夹的xworkspace文件
5.进入工程之后建立swift-oc的桥接头文件 import "POP.h"
6.到此pop安装完成
第二步:使用pop,demo代码如下
demo效果,放大两倍,旋转180度,移动位置,改变背景颜色
//
// ViewController.swift
// Popswift
//
// Created by lyj on 15/3/22.
// Copyright (c) 2015年 lyj. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let redBall = UIView(frame: CGRect(x: 50, y: 50, width: 100, height: 100))
redBall.backgroundColor = UIColor.redColor()
self.view.add