项目中常会遇到,上传图片的操作,由于iPhone手机直接拍照的图片往往比较大,一般3-4M,如果直接上传不做处理会浪费用户很多流量,再者有很多场景并不需要高清图片,所以在上传图片前对图片进行压缩,是很有必要的。 1.OC中的UIKit中提供了现成的压缩函数 UIImageJPEGRepresenta ...
分类:
移动开发 时间:
2017-01-09 16:44:30
阅读次数:
252
使用UIBezierPath类可以创建基于矢量的路径,这个类在UIKit中。此类是Core Graphics框架关于path的一个封装。使用此类可以定义简单的形状,如椭圆或者矩形,或者有多个直线和曲线段组成的形状。 1.Bezier Path 基础 UIBezierPath对象是CGPathRef数 ...
分类:
其他好文 时间:
2017-01-03 20:30:02
阅读次数:
298
使用CAShapeLayer与UIBezierPath可以实现不在view的drawRect方法中就画出一些想要的图形 。 1:UIBezierPath: UIBezierPath是在 UIKit 中的一个类,继承于NSObject,可以创建基于矢量的路径.此类是Core Graphics框架关于p ...
分类:
其他好文 时间:
2017-01-03 20:25:41
阅读次数:
211
转载注明出处:http://blog.csdn.net/qxuewei/article/details/53945445 因为OC 的局限性, 使得iOS 开发组件化编程变得不可能,得益于面向对象...
分类:
移动开发 时间:
2017-01-03 12:06:36
阅读次数:
496
import UIKit class FourVC: UIViewController { var label:UILabel = UILabel() var index : Int = 1 var timer:Timer = Timer() override func viewDidLoad() ... ...
分类:
其他好文 时间:
2016-12-30 18:42:56
阅读次数:
169
import UIKit enum VendingMachineError: Error { case invalidSelection //选择无效 case insufficientFunds(coinsNeeded: Int) //金额不足 case outOfStock //缺货 } str... ...
分类:
其他好文 时间:
2016-12-30 16:59:04
阅读次数:
179
Customization: Overlayering and extensions https://ax.help.dynamics.com/en/wiki/customization-overlayering-and-extensions/ Customize model elements us ...
分类:
其他好文 时间:
2016-12-27 16:02:32
阅读次数:
235
前言 iOS 10 中废弃了 UILocalNotification ( UIKit Framework ) 这个类,采用了全新的 UserNotifications Framework 来推送通知,从此推送通知也有了自己的标签 UN (这待遇真是没别人了),以及对推送功能的一系列增强改进(两个 e ...
分类:
移动开发 时间:
2016-12-27 13:45:57
阅读次数:
267
import UIKit class ViewController: UIViewController { var button : UIButton! var array = NSMutableArray() override func viewDidLoad() { super.viewDidL ...
分类:
编程语言 时间:
2016-12-27 09:45:40
阅读次数:
264
1 import UIKit 2 import CoreData 3 4 // coredata管理器 5 class CoreDataManager: NSObject { 6 7 // 单例 8 static let sharedManager:CoreDataManager = CoreDat... ...
分类:
移动开发 时间:
2016-12-25 17:38:09
阅读次数:
231