<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          SwiftCGRectExtensions簡便函數(shù)的集合

          聯(lián)合創(chuàng)作 · 2023-09-28 16:55

          SwiftCGRectExtensions 是 CGRect, CGPointCGSize 簡便函數(shù)的集合,使用 Swift 編寫,支持 iOS 和 OS X。

          SwiftCGRectExtensions 目標(biāo)是為普遍使用的 rect 操作提供清晰的函數(shù)。

          特性

          • 用于添加,縮放尺寸,應(yīng)用的運(yùn)算符 CGAffineTransform
          • 角點(diǎn)和中心點(diǎn)的快捷方式屬性
          • 通過多種指定參數(shù)的方式來抵消,插入和擴(kuò)展方法
          • 矩形的對齊和居中大小
          • 復(fù)制具有某些值的矩形,而無需通過變量
          • 尊重iOS和OS X上的不同坐標(biāo)系
          • 單元測試

          示例:

          import Foundation
          import CGRectExtensions
          let rect = CGRect(1, 2, 100, 200) // shorter constructor
          let minY = rect.minY // shortcut properties
          let topCenter = rect.topCenter // OS-dependent coordinate system
          let oppositeOrigin = rect.origin + rect.size // adding
          let corneredRect = rect.with(x: 0, y: 0) // modified copy
          let nextPageRect = rect.rectByOffsetting(dx: 100) // offsetting
          let paddedRect = rect.rectByInsetting(top: 66, left: 10, right: 10) // insetting
          let quarterSize = rect.size * 0.5 // scaling sizes
          let corner = rect.rectByAligning(quarterSize, corner: .MinXEdge, .MinYEdge) // aligning sizes
          let halfWidthSize = rect.size * (0.5, 1) // scaling sizes
          let centeredRect = rect.rectByCentering(halfWidthSize) // centering sizes
          let scaledRect = rect * CGAffineTransformMakeScale(2.0, 3.0)
          瀏覽 30
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  天堂a v在线播放 | 手机av在线 | 豆花操逼视频 | 香蕉大香蕉久 | 国内性爱网站 |