手机版
热门标签
站点地图
我要投稿
广告合作
联系我们
搜 索
广告位招租
广告位招租
切换导航
首页
编程教程
编程导航
编程百科
编程问答
编程博文
编程实例
硬件设备
网络运营
软件教程
移动数码
办公软件
操作系统
人工智能
栏目导航
▸ 编程语言
▸ 前端开发
▸ 移动开发
▸ 开发工具
▸ 程序设计
▸ 行业应用
▸ CMS系统
▸ 服务器
▸ 数据库
公众号推荐
微信公众号搜
"智元新知"
关注
微信扫一扫可直接关注哦!
子栏目导航
iOS
Android
Swift
Hybrid
Cocos2d-x
Flutter
Xcode
Silverlight
cocoa
Cordova
编程之家
Swift
[Swift Weekly Contest 122]LeetCode987. 二叉树的垂序遍历 | Vertical Order Traversal of a Binary Tree
Given a binary tree, return the vertical order traversal of its nodes values. For each node at position (X, Y), its left and right children respectively will be at positions (X-1, Y-1)and (X+1, Y-1).
作者:编程之家 时间:2020-08-10
[Swift通天遁地]八、媒体与动画-(2)实现视频文件的播放和画中画
本文将演示使用AVPlayerViewController播放视频并实现画中画。 往项目中导入了一个视频文件。 在左侧的项目导航区,打开视图控制器的代码文件【ViewController.swift】 1 import UIKit 2 //在当前的类文件中, 3 //引入需要用到的相关类库 4 import AVFoundation 5 import AVKit 6
作者:编程之家 时间:2020-08-10
[Swift通天遁地]八、媒体与动画-(12)CoreText框架中的字体的FontMetrics布局信息
本文将演示字体的布局信息。文字的布局就是将众多字形,通过一定的规则排列在显示设备上。 文字分布的区域被称为文本区,字形的排列是基于一条不可见的线进行排列的,这条抽象的线称为基线。 在左侧的项目导航区,打开视图控制器的代码文件【ViewController.swift】 1 import UIKit 2 3 class ViewController: UIViewController {
作者:编程之家 时间:2020-08-10
[Swift通天遁地]八、媒体与动画-(13)CoreText框架实现图文混排
本文将演示CoreText框架实现图文混排。CoreText(富文本)框架并不支持图片的绘制, 需要借助Core Graphics框架来进行图片的绘制。 图文混排的实现原理非常简单,就是在一个富文本中插入一个占位符, 表示此处需要插入一张图片。然后再由另一个图形绘制框架, 在占位符所在位置绘制指定的图片。 在项目文件夹上点击鼠标右键,弹出右键菜单。 【New File】->【Cocoa Touch
作者:编程之家 时间:2020-08-10
[Swift通天遁地]八、媒体与动画-(15)使用TextKit实现精美的图文混排效果
本文将演示制作一款更加精美的图文的图文混排效果:将文字紧贴图片边缘的图文混排效果。 往项目中导入一份文本文件。 在左侧的项目导航区,打开视图控制器的代码文件【ViewController.swift】 1 import UIKit 2 3 class ViewController: UIViewController { 4 5 override func viewDi
作者:编程之家 时间:2020-08-10
[Swift通天遁地]八、媒体与动画-(14)使用TextKit快速实现文章的分栏效果
本文将演示对长文本进行分栏显示。往项目中导入一份文本文件。 在左侧的项目导航区,打开视图控制器的代码文件【ViewController.swift】 现在开始编写代码,加载文本文件中的内容,并对文字进行分栏。 1 import UIKit 2 3 class ViewController: UIViewController { 4 5 override func vi
作者:编程之家 时间:2020-08-10
swift 数组部分排序
数组自带排序函数,如果想实现部分排序,先对数组进行部分截取,然后对截取部分替换位排序好的子序列 var nums = [1,3,4,5,1,3,6] var sub = nums[3...6] nums.replaceSubrange(3...6, with: sub.sorted()) //output: [1, 3, 4, 1, 3, 5, 6]
作者:编程之家 时间:2020-08-10
[Swift通天遁地]九、拔剑吧-(5)创建Tab图标具有多种样式的Tab动画
本文将演示创建动画样式的底部标签条的切换效果。 Github项目地址:【animated-tab-bar】,下载项目,解压成文件夹窗口。 将第三方类库的标签控制器文件夹【RAMAnimatedTabBarConroller】拖动到项目中。 在弹出的文件导入确认窗口中,点击【Finish】完成按钮,确认文件的导入。 在左侧的项目导航区打开视图控制器的代码文件【Main.storyboard】 选择故
作者:编程之家 时间:2020-08-10
[Swift通天遁地]九、拔剑吧-(11)创建强大的Pinterest风格的瀑布流界面
本文将演示如何创建强大的Pinterest风格的瀑布流界面。 Github项目:【demonnico/PinterestSwift】,下载并解压文件。 【PinterestSwift】文件夹->【CHTCollectionViewWatrfallLayout.swift】文件 ->按下【Command】,继续选择【Extension.swift】->继续选择【Macro.swift】 ->继续选择
作者:编程之家 时间:2020-08-10
[Swift通天遁地]九、拔剑吧-(12)创建Preview-Transition图像预览界面
本文将演示如何创建一个漂亮的图像预览界面。 首先确保已经安装了所需的第三方类库。双击查看安装配置文件【Podfile】 1 platform :ios, ‘12.0’ 2 use_frameworks! 3 4 target ‘DemoApp‘ do 5 source ‘https://github.com/CocoaPods/Specs.git‘ 6 pod "Pre
作者:编程之家 时间:2020-08-10
[Swift通天遁地]九、拔剑吧-(17)创建一个三维折叠样式的页面展开效果
本文将演示实现单元格在扩展、收缩时折叠式的炫目动态效果。 GitHub项目:【Ramotion/folding-cell】,下载并解压文件。 【FoldingCell】->【FoldingCell.swift】文件->将该文件拖动到项目中,点击【Finish】 创建一个继承自第三方类库的单元格。 在项目文件夹上点击鼠标右键,弹出右键菜单。 【New File】->【Cocoa Touch】->【N
作者:编程之家 时间:2020-08-10
Swift-UITextView占位文字及占位文字颜色扩展(可在xib中直接使用)
使用案例 extension UITextView { private struct RuntimeKey { static let hw_placeholderLabelKey = UnsafeRawPointer.init(bitPattern: "hw_placeholderLabelKey".hashValue) /// ...其他Key声明
作者:编程之家 时间:2020-08-10
[Swift Weekly Contest 124]LeetCode995. K 连续位的最小翻转次数 | Minimum Number of K Consecutive Bit Flips
In an array A containing only 0s and 1s, a K-bit flip consists of choosing a (contiguous) subarray of length K and simultaneously changing every 0 in the subarray to 1, and every 1 in the subarray to
作者:编程之家 时间:2020-08-10
[Swift Weekly Contest 124]LeetCode994. 腐烂的橘子 | Rotting Oranges
In a given grid, each cell can have one of three values: the value 0 representing an empty cell; the value 1 representing a fresh orange; the value 2 representing a rotten orange. Every minute, any fr
作者:编程之家 时间:2020-08-10
[Swift]LeetCode497. 非重叠矩形中的随机点 | Random Point in Non-overlapping Rectangles
Given a list of non-overlapping axis-aligned rectangles rects, write a function pick which randomly and uniformily picks an integer point in the space covered by the rectangles. Note: An integer point
作者:编程之家 时间:2020-08-10
[Swift]LeetCode502. IPO | Initial Public Offerings(首次公开募股)
Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital before the IPO. Since it
作者:编程之家 时间:2020-08-10
[Swift]LeetCode503. 下一个更大元素 II | Next Greater Element II
Given a circular array (the next element of the last element is the first element of the array), print the Next Greater Number for every element. The Next Greater Number of a number x is the first gre
作者:编程之家 时间:2020-08-10
[Swift]LeetCode508. 出现次数最多的子树元素和 | Most Frequent Subtree Sum
Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (includi
作者:编程之家 时间:2020-08-10
[Swift]LeetCode515. 在每个树行中找最大值 | Find Largest Value in Each Tree Row
You need to find the largest value in each row of a binary tree. Example: Input: 1 / 3 2 / \ \ 5 3 9 Output: [1, 3, 9] 您需要在二叉树的每一行中找到最大的值。
作者:编程之家 时间:2020-08-10
[Swift]LeetCode524. 通过删除字母匹配到字典里最长单词 | Longest Word in Dictionary through Deleting
Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, retur
作者:编程之家 时间:2020-08-10
[Swift]LeetCode525. 连续数组 | Contiguous Array
Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: [0,1] Output: 2 Explanation: [0, 1] is the longest contiguous subarray with equ
作者:编程之家 时间:2020-08-10
[Swift]LeetCode546. 移除盒子 | Remove Boxes
Given several boxes with different colors represented by different positive numbers. You may experience several rounds to remove boxes until there is no box left. Each time you can choose some contin
作者:编程之家 时间:2020-08-10
[Swift]LeetCode560. 和为K的子数组 | Subarray Sum Equals K
Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = [1,1,1], k = 2 Output: 2 Note: The length of the
作者:编程之家 时间:2020-08-10
[Swift]LeetCode583. 两个字符串的删除操作 | Delete Operation for Two Strings
Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one character in either string. Example 1: Input: "sea",
作者:编程之家 时间:2020-08-10
[Swift Weekly Contest 125]LeetCode999. 车的可用捕获量 | Available Captures for Rook |
在一个 8 x 8 的棋盘上,有一个白色车(rook)。也可能有空方块,白色的象(bishop)和黑色的卒(pawn)。它们分别以字符 “R”,“.”,“B” 和 “p” 给出。大写字符表示白棋,小写字符表示黑棋。 车按国际象棋中的规则移动:它选择四个基本方向中的一个(北,东,西和南),然后朝那个方向移动,直到它选择停止、到达棋盘的边缘或移动到同一方格来捕获该方格上颜色相反的卒。另外,车不能与其他
作者:编程之家 时间:2020-08-10
OC与swift混编
1.第三方库的使用 1、第三方库是swift库,导入到swift项目。 用到的文件中需要:import Alamofire 2、第三方库是swift库,导入到OC项目。 不考虑 3、第三方库是OC库,导入到swift项目。 用到的文件中需要:import AFNetworking 4、第三方库是OC库,导入到OC项目。 用到的文件中需要:#import "AFNetworking.h" 但是在
作者:编程之家 时间:2020-08-10
[Swift]LeetCode591. 标签验证器 | Tag Validator
Given a string representing a code snippet, you need to implement a tag validator to parse the code and return whether it is valid. A code snippet is valid if all the following rules hold: The code m
作者:编程之家 时间:2020-08-10
[Swift]LeetCode592. 分数加减运算 | Fraction Addition and Subtraction
Given a string representing an expression of fraction addition and subtraction, you need to return the calculation result in string format. The final result should be irreducible fraction. If your fin
作者:编程之家 时间:2020-08-10
[Swift]LeetCode606. 根据二叉树创建字符串 | Construct String from Binary Tree
You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be represented by empty parenthesis pair "()". And you n
作者:编程之家 时间:2020-08-10
swift – 如何配置DateFormatter以捕获微秒
iOS Date()以至少微秒的精度返回日期. 我通过调用Date().timeIntervalSince1970检查了这个语句,结果是1490891661.074981 然后我需要将日期转换为具有微秒精度的字符串. 我以下列方式使用DateFormatter: let formatter = DateFormatter() formatter.dateFormat = "yyyy-MM-dd'T
作者:编程之家 时间:2020-08-10
上一页
31
32
33
34
35
36
37
38
下一页
小编推荐
热门标签
更多
python
JavaScript
java
HTML
reactjs
C#
Android
CSS
Node.js
sql
r
python-3.x
MysqL
jQuery
c++
pandas
Flutter
angular
IOS
django
linux
swift
typescript
路由器
JSON
路由器设置
无线路由器
h3c
华三
华三路由器设置
华三路由器
电脑软件教程
arrays
docker
软件图文教程
C
vue.js
laravel
spring-boot
react-native