跳至主要内容

博文

目前显示的是 一月, 2019的博文

macOS下更改iTunes备份路径

参考链接: macOS下更改iTunes备份路径 How to access iPhone backups on macOS Mojave 开始 首先寻找原先的备份目录。 打开终端,你可以去这里查找地址: $ cd ~/Library/Application\ Support/MobileSync (我这里已经映射了) 然后,你确保Backup目录下没有其他文件(如果有,可以考虑备份到其他地方) 然后就删除该目录吧! $ rm -rf Backup 同样,我们也在我们的外接硬盘上创建一个备份目录: $ cd /Volumes/MAC/MobileSync/Backup 然后回到刚刚的 Library 目录,使用如下命令链接即可: $ ln -s /Volumes/MAC/MobileSync/Backup ~/Library/Application\ Support/MobileSync/Backup 最后,去 iTunes 备份吧。。 注 最后一条命令执行时可能会出错: ln: /Users/xxxxx/Library/Application Support/MobileSync/Backup: Operation not permitted 原因是在Mojave系统上需要完全的磁盘访问权限才能建立软链接。 解决方法参考 这篇文章 。

The common raised center button problems in UITabBar

原文链接 参考链接:  https://stackoverflow.com/questions/30527738/how-do-we-create-a-bigger-center-uitabbar-item Ever had to do an app with that magnificent center button that’s sticking gorgeously out of the TabBar? Then I bet you know that it’s not as simple as throwing that piece in the TabBarController as a subview. It may be working at first, but it’ll stab you in the back the first chance it gets. Let’s take a look at this example: We have a TabBar with two normal items and one knob item in the middle. We’ll use a simple UITabBarController. First things first, let’s create two UITabBarItem-s and move them out of the way. Let’s shift them for about 15pt. guard let tabItems = tabBar. items else { return } tabItems[ 0 ]. titlePositionAdjustment = UIOffset ( horizontal : -15 , vertical : 0 ) tabItems[ 1 ]. titlePositionAdjustment = UIOffset ( horizontal : 15 , vertical : 0 ) view raw UITabBarController.swift  hosted with ❤ by  GitHub ...

iOS 12 通知新特性及适配

原文链接 写在前面 iOS 12 通知推送迎来部分功能更新,主要有: Grouped notifications 推送分组 Notification content extensions 推送内容扩展中的可交互和动态更改Action Notification management 推送消息的管理 Provisional authorization 临时授权 Critical alerts 紧急推送 ​ 本文针对以上特性进行一个简单描述,仅供参考,若需要了解更详细的内容,请跳转至本文末尾 参考 一节。 ​ 需要大家 重点关注 的是: ​  分组功能 :分组能让用户对通知的阅读更轻松。 ​  通知管理 :无处不在的 通知管理入口 ,用户可以轻而易举的打开或者关闭推送,或进行设置。 ​ 本文中的demo是 iOSNotification 。 一、推送分组 iOS 12 推送相关功能,最重要,最突出的特性就是支持分组。 分组维度 自动 按 thread-id 分组, thread-id 为服务端下发字段,每个分组可指定通知摘要。 顶层通知会伴随通知摘要(下发 summary-arg 指定),多分类的通知摘要将会叠加。 按应用分组 所有通知将会以应用为维度分组,即APP所有通知在同一组,每个组的顶层是该组收到的最新通知。 顶层通知会伴随通知摘要(下发 summary-arg 指定),多分类的通知摘要将会叠加。 关闭 不进行分组,所有消息以单条消息维度进行展示。 针对APP内分组的设置,请参考后文 三、推送管理 。 通知摘要 分组之后,每个分组的通知摘要,系统默认为:“还有**个通知”,如下图: 以上红框部分,可支持自定义,自定义摘要可分为两种: 1. 摘要分类 ​ 客户端写好分类模板,如下面,“物流通知”、“优惠触达”为客户端规定的模板,之后服务端下发推送,只要指定分类( category 字段),就会采用不同的模板。模板定义如下: 优惠模板 : <N>条优惠触达 物流模板 : <N>条物流通知 需要注意的是,分类模板与分组不冲突 ,无交叉关系。任何一个分组( thread-id 指定分...