图片 1

Xcode 秉承了 Apple 封闭的传统,提供的可自定义的选项比起其他 IDE
来说是比较少的,不过在 Xcode 7 之前(包含 Xcode
7)我们还是可以通过插件实现 Xcode 的自定义,甚至还出现了像 Alcatraz
的专门的插件管理工具,开源社区中也有诸如 VVDocumenter-Xcode、CocoaPods
等知名的插件,不过这些便利随着 Xcode 8
的发布成为了过去式。出于安全性考虑(比如说 Xcode ghost 事件),Apple 从
Xcode 8 开始不再支持第三方的插件。Apple 方面提供了基于 App Extension
的解决方案 — Xcode Source Editor
Extension,这是一个相当简单的方案,能且仅能完成有限的文本编辑辅助,很大部分之前第三方插件能完成的任务都没办法实现了。聊胜于无吧
😑(本文会介绍 Source Editor Extension
的开发以及分发相关的知识,本文对应的 Demo
在:

图片 2

临近年底手里的app都要上线,不知道大家有没有感觉这段时间的审核团队各种严,手里的3个项目全部被卡,其中两个是迭代,一个是新上线的app。全部都遭到了毒手~(>_<)~下面我就我遇见的问题做一下总结,希望可以帮到正在困惑中的你。

  1. 创建一个 Cocoa App:Source Editor Extension 不能独立存在,必须依附于
    Cocoa App。

    图片 3Cocoa
    App

  2. File -> New -> Target -> Xcode Source Editor Extension
    添加一个 Target,并激活这个 Target。

    图片 4Xcode
    Source Editor
    Extension图片 5激活
    target

首先题目写的有点大,这篇文章只是分享一下我平时用到的一些快捷键和习惯,希望能对大家平时的开发效率有所帮助。

Guideline 2.3.3 – Performance – Accurate Metadata

We noticed that your screenshots do not sufficiently reflect your app in
use.Please see attached screenshots for details.Next StepsTo resolve
this issue, please revise your screenshots to ensure that they
accurately reflect the app in use on the supported devices. For iPhone,
you need a set of 5.5-inch display screenshots and for iPad, you need a
set for 12.9-inch display. This set will be scaled appropriately down to
other device sizes when viewed on the App Store in each
territory.ResourcesFor resources on creating great screenshots for
the App Store, you may want to review the App Store Product Page
information available on the Apple developer portal.Please ensure you
have made any screenshot modifications using Media Manager. You should
confirm your app looks and behaves identically in all languages and on
all supported devices. Learn how to use Media Manager to add custom
screenshots for each display size and localization.Since your iTunes
Connect status is Metadata Rejected, we do NOT require a new binary.
To revise the metadata, visit iTunes Connect to select your app and
revise the desired metadata values. Once you’ve completed all changes,
reply to this message in Resolution Center and we will continue the
review.NOTE: Please be sure to make any metadata changes to all app
localizations by selecting each specific localization and making
appropriate changes.

这个问题很简单就是说自己的截图不能反应自己App的主要功能,然后重新换了截图(我是主要截了下自己的App的几个模块)就可以了

这样就创建好了一个可运行的 Source Editor Extension,相当的简单。🧐

原因有几点:

Guideline 2.1 – Performance – App Completeness

We discovered one or more bugs in your app when reviewed on iPad running
iOS 11.2.5 on Wi-Fi connected to an IPv6 network.Specifically, the
In-App Purchase results in an error.Below are the steps to reproduce the
issue:1. Launch the application2. Navigate to Purchase/Recharge tab3.
Proceed to purchase one of the IAP products4. IAP confirmation window
appears5. Confirm Purchase6. IAP results in an errorThe review was
conducted under sandbox environment.Please see attached screenshots for
details.Next StepsTo resolve this issue, please run your app on a
device to identify any issues, then revise and resubmit your app for
review.If we misunderstood the intended behavior of your app, please
reply to this message in Resolution Center to provide information on how
these features were intended to work.For new apps, uninstall all
previous versions of your app from a device, then install and follow the
steps to reproduce the issue. For updates, install the new version
as an update to the previous version, then follow the steps to reproduce
the issue.ResourcesFor information about testing your app and
preparing it for review, please see Technical Note TN2431: App Testing
Guide.For a networking overview, please review About Networking. For a
more specific overview of App Review’s IPv6 requirements, please review
the IPv6 and App Review discussion on the Apple Developer Forum.

图片 61.png

这个问题写的很清楚,说是在IPad上
IPv6网络下进行内购的时候支付不成功,老是支付失败

当我收到这个邮件的时候我就立刻做了开始测试,模拟IPv6网络 然后用iPhone
和iPad 都进行了测试,发现内购是完全可以的,只是在IPad
上面内购回调有点慢,然后我就截图给他们告诉他们经过测试内购是可以完成的没有问题的,然后晚上就等他们的回复。他们的邮件回复一般都是晚上1点之后(那个时候他们是早上8点多),等到晚上收到邮件还是说内购不行,还附带了一样的截图。然后我就奇怪了,怎么可能会这个样子呢,明明没有问题的他们怎么老是支付不成功呢,突然我发现一个问题,难道他们测支付不是用的沙盒测试账号?因为我的app
是新上的项目
内购项目还没有审核通过,如果不用沙盒测试账号就一定会购买失败,难道他们不是用的沙盒测试账号?不会吧!
虽然我不相信他们会这么傻,但是我也没有其他的办法可以处理了。

图片 7文件结构

  1. 工作中我发现有些iOS小伙伴平时开发的时候,比如在快速打开一个类文件的时候,还在项目目录里面一层一层的找,等等,希望本文能提升他们的开发幸福感。
  2. 我自认为我知道的快捷键还蛮多的,但是还是从同事那里学到了几个实用的🤓,这篇文章就当做记录分享自己平时开发的一些小技巧吧,大家看完有什么更好的tip
    可以留言分享给我,相当于抛砖引玉吧,我会持续更新的~希望大家都能做一个懒惰的程序员(文末有我对懒惰程序员的定义)。
之后我又回复邮件给他们说我的内购项目还没有过审核,内购测试必须用沙盒账号测试,然后又录制了视频传到了YouTube 证明在IPad 上内购是可以完成的。

然后有经过一天的等待晚上的时候收到了苹果的邮件回复:

Hello,Thank you for your response.We will continue to review your app,
and will notify you if there are any further issues.Best regards,App
Store Review

说感谢你的回复,我们再继续审核您的App。(说真的当时收到这个邮件的时候我并没有开心,我以为我们回复的次数太多他们烦了?这是要挂起我的App了?要过就过不过就不过呗,什么叫做继续审核,难道这就是传说中的延期审核吗?),当时有点担心的睡下了…
然而第二天我突然你发现竟然过了!开心的我在地铁里蹦了起来!

这个问题总结来说,如果自己真的没有问题就大胆的去据理力争吧,虽然审核变得很严但是没问题就是没问题,可以录视频截图证明自己的清白😝

  1. SourceEditorExtension 类:遵循 XCSourceEditorExtension
    协议的类,XCSourceEditorExtension 协议的头文件如下:

如果你用的iMac
大部分用的是苹果的鼠标,苹果的鼠标是可以设置智能手势的,这些在系统偏好里面都有教程和设置,大家可以去看一下,每每看到同事还在把iMac的鼠标当做windows的来用,我真想说这个鼠标贵是有道理的🙃。鼠标:1.
一个手指右滑返回,在Xcode 中就不用每次都去点击返回上一个类了。2.
两个手指左\右滑切换桌面,MacOS的多桌面挺好的,可以一个放UI,一个放代码,一个放接口文档等等。3.
两个手指轻点,相当于F3上面的快捷键Miss
Control,很方便。触摸板:跟鼠标基本一样,切换桌面是三个手指左\右滑,Miss
Control 是三个手指向上滑。

Guideline 5.1.1 – Legal – Privacy – Data Collection and Storage

We noticed that your app requests the user’s consent to access their
Camera but does not clarify the use of this feature in the permission
modal alert.Next StepsTo resolve this issue, please revise the
permission modal alert to specify why the app is requesting access to
the user’s Camera.ResourcesTo learn more about requesting the user’s
permission to access app features, visit the iOS Human Interface
Guidelines. You may also want to review the Technical Q&A QA1937:
Resolving the Privacy-Sensitive Data App Rejection page for details on
how to provide a usage description for permission request alerts.

这个问题是说我们在项目中使用到相机权限,却没有告诉用户什么地方使用到这个权限

图片 8

这里改成在什么服务中使用到相机就可以了,给过了!

好了,废话不多说,直接进入关键的吧,我默认用快捷键的使用频次排序吧,希望大家都能动手尝试下。

Guideline 3.1.1 – Business – Payments – In-App Purchase

We noticed that your app or its metadata enables the purchase of
content, services, or functionality in the app by means other than the
in-app purchase API, which is not appropriate for the App Store.The next
submission of this app may require a longer review time, and this app
will not be eligible for an expedited review until this issue is
resolved.Next Steps

  • Review the In-App Purchase section of the App Store Review
    Guidelines.
  • Ensure your app is compliant with all sections of the App Store
    Review Guidelines and the Terms & Conditions of the Apple Developer
    Program.
  • Once your app is fully compliant, resubmit your app for review.If
    you believe your app is compliant with the App Store Review
    Guidelines, you may submit an appeal. Alternatively, you may provide
    additional details about your app by replying directly to this
    message.In-App PurchaseIt may be appropriate to revise your app
    to use the in-app purchase API to provide content purchasing
    functionality.In-app purchase provides several benefits, including:
  • The flexibility to support a variety of business models.
  • Impacting your app ranking by consolidating your sales to one app
    rather than distributing them across multiple apps.
  • An effective marketing vehicle to drive additional sales of new
    content.For information on in-app purchase, please refer to the
    following documentation:In-App Purchase for DevelopersIn-App
    Purchase Programming GuideFor step-by-step instructions on in-app
    purchase creation within iTunes Connect, refer to In-App Purchase
    for Developers.

这个是说我的App用了内购之外的其他第三方支付(其实我们是做了隐形开关的),这个问题比较严重的,审核团队直接说你们的项目无法在加速,下次审核时间会比较长,这种问题如果你也准备这么做,建议最好现在不要,最近这个问题卡的非常严,处罚的也很重。
最好还是老老实实的删除掉了第三方支付换成了内购!

@protocol XCSourceEditorExtension <NSObject>@optional- extensionDidFinishLaunching;@property (readonly, copy) NSArray <NSDictionary <XCSourceEditorCommandDefinitionKey, id> *> *commandDefinitions;@end
  1. Shift + Command + O 弹出快速查找文件窗口(这个是字母O,Markdown
    O之后很像数字0 ),Shift +Commond + 0 是快速打开官方文档的快捷键。
  2. Shift + Comand + j 定位到文件所在目录,经常配合上面那条快捷键。
  3. Control + Command + 上\下 切换 .m.h
  4. Command + t
    新建一个Tab,这个很实用,我平时一般都会建3,4个Tab,关闭Tab 可以用
    Command + w
  5. 如果你不习惯开多个Tab,习惯开多个Xcode窗口,可以用Command + `
    来互相切换。
  6. Control + Command + e
    可以批量修改光标所在位置的变量,像这样图片 9
  7. Shift + Command + f
    打开全局搜索,当然你可以连续按住Command键连续按两次
    4,也会聚焦到全局搜索,全局搜索这里要说一下,搜索Xcode
    不仅仅是支持text匹配,最常用的可以加个 Any
    正则,就可以搜出如图中的这种,等等。图片 10
  8. Command + f 在类中搜索 ,enter 匹配下一个 Shift + enter
    匹配上一个。
  9. Command + 上\下\左\右 光标切换到类首,类尾,行首,行尾。
  10. alt + 左\右 光标左右移动一个单词。
  11. Command + delete 删除光标到行首的内容,同理alt + delete
    删除光标前的一个单词,另外可以先切换到到行尾
    Command + delete删除一整行内容。
  12. 同理 Command + Shift
    Command + alt加方向键就可以选中一整行或者多行了。
  13. 选中一段代码 Control + i 会自动缩进。
  14. Command + \
    当前行加断点,alt + Command + \,新建一个symbolic breakpoint
  15. Command + n新建文件 ,Shift + Command + n 新建工程
  16. alt + Command + 左\右
    折叠\显示当前块,Shift + alt + Command + 左\右
    折叠\显示当前文件中的块。
  17. alt + Command + [
    上移,如果没有选中,默认上移当前行,alt + Command + ] 下移。
  18. Command + ] 向右缩进,支持多行,Command + [ 向左缩进。
  19. Shift + Command + k product 清理,Command + r Run,Command + b
    编译。
  20. 还有一个重要的快捷键,☝️,Control + Command + p
    快捷导入,像这样,图片 11很酷吧,需要导入一个工具才可以实现,可以点击这里,Xcode
    9
    以前用过类似的插件也可以实现这个功能,之前还用Peak君的FastStub-Xcode也挺爽的。

Guideline 5.1.1 – Legal – Privacy – Data Collection and Storage

We noticed that your app requests the user’s consent to access the
Location services but does not clarify the use of this feature in the
permission modal alert.Please see attached screenshots for
details.Next StepsTo resolve this issue, please revise the
permission modal alert to specify why the app is requesting access to
the Location services.ResourcesTo learn more about requesting the
user’s permission to access app features, visit the iOS Human Interface
Guidelines. You may also want to review the Technical Q&A QA1937:
Resolving the Privacy-Sensitive Data App Rejection page for details on
how to provide a usage description for permission request alerts.

图片 122.png

这个问题说是我们使用了定位功能却没有说明哪里使用了定位却没有在权限中说明。
但是我们的应用没有使用定位,也没有寓见这个字眼,然后就非常莫名其妙,然后我就回复邮件告诉他们我们没有使用到定位功能,也从来没有使用这个字眼。
然后他们回复邮件说好吧,那你继续改其他问题吧…..
(还有其他的问题就是上面的内购)。
好吧,搞不懂怎么截取到这样的图,怀疑是其他应用弹出的!

XCSourceEditorExtension
协议只有一个方法和一个属性,extensionDidFinishLaunching
方法是用来在插件加载好后是对插件进行一些准备工作的,根据 WWDC
的说法,各个插件与 Xcode
本身的初始化过程是在不同进程上进行的,同样地,插件的崩溃并不会引起 Xcode
的崩溃。commandDefinitions 属性则可以动态返回插件的菜单项。

Guideline 4.2.3 – Design – Minimum Functionality

We were required to install the QQ app before we could log in via QQ.
Users should be able to log in with QQ and access their accounts without
having to install any additional apps.Next StepsIf you would like to
offer authentication through QQ, please use a mechanism that allows
users to log in with QQ from within your app without first having to
install an additional app.We recommend implementing the Safari View
Controller API to display web content within your app. The Safari View
Controller allows the display of a URL and inspection of the certificate
from an embedded browser in an app so that customers can verify the
webpage URL and SSL certificate to confirm they are entering their sign
in credentials into a legitimate page.ResourcesFor additional
information on the Safari View Controller API, please review the What’s
New in Safari webpage.

qq第三方登录必须安装qq才行,希望不安装qq也能使用,处理方法是支持网页的qq登录

SourceEditorCommand 类:遵循 XCSourceEditorCommand
协议的类,实现插件功能的核心类,对应到插件的菜单项,可以一个菜单项对应到一个
Command 类,也可以多个菜单项对应到一个 Command 类,XCSourceEditorCommand
协议头文件定义如下:

  1. Shift + Command + Y 隐藏 \ 显示 console
    区,但是我建议显示console区 用
    Shift + Command + C,会直接聚焦效果。
  2. Command + k console清屏。
  3. Control + 1
    这个应该很多工程师都没用过🌚,当然点击小图标也可以。图片 13如图可以看到所有调用者,导入的文件,被那些导入等等相关依赖。还可以找到最近打开的文件,Recent
    Files
  4. Control + 6 查看当前类的方法列表,这里建议用 pragma mark
    来合理分块,相关扩展阅读可以看这里的代码规范建议
  5. Command + 1,2,3,4,5,6,7,8,9 切换左边窗体,Command + 0 显示 \
    隐藏左边窗体。
  6. alt + Command + 0 显示 \
    隐藏右边窗体,同理alt + Command + 1,2等也可以切换
  7. Command + , 弹出 Perferences ,可以用 Command + w 隐藏

Guideline 5.1.1 – Legal – Privacy – Data Collection and Storage

We noticed that your app requires users to register with personal
information to purchase non account-based in-app purchase products,
which does not comply with the App Store Review Guidelines.Please see
attached screenshot for details.Apps cannot require user registration
prior to allowing access to app content and features that are not
associated specifically to the user.Next StepsUser registration that
requires the sharing of personal information must be optional or tied to
account-specific functionality.To resolve this issue, please make it
clear to the user that registering will enable them to access the
content from any of their iOS devices, and to provide them a way to
register at any time, if they wish to later extend access to additional
iOS devices.

我们注意到您的应用需要用户注册个人信息才能购买非基于帐户的应用内购买产品,这些产品不符合“App
Store评论指南”。 这个问题我之前在另一个App
就遇见过一次,当时我记得我是发邮件申述了下,说明我们的App
必须要登录才能购买商品,因为我们的商品是必须依托账号什么的巴拉巴拉的…..
具体什么我也忘了,当然如果你觉得可以说的清楚也可以试试,如果不行就要老实改下了,改成游客也能购买商品,最好是做到根据iCoud
存储下购买记录,以便跨设备使用。

@protocol XCSourceEditorCommand <NSObject>@required- performCommandWithInvocation:(XCSourceEditorCommandInvocation *)invocation completionHandler:(NSError * _Nullable nilOrError))completionHandler;@end

发表评论

电子邮件地址不会被公开。 必填项已用*标注