第一步:用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()
&
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()
&
Swift开发POP动画教程

本文介绍了如何在Swift项目中使用Cocoapods安装并应用POP动画库,详细步骤包括创建Podfile、安装、建立桥接头文件以及演示代码,展示了放大、旋转、移动和改变背景颜色的动画效果。
最低0.47元/天 解锁文章

137

被折叠的 条评论
为什么被折叠?



