简体   繁体   中英

Remove Watchkit Glance from my App

When I created my app I was excited to work with Glances and Notifications, but as it progressed I realized that it wasn't a needed functionality. I deleted the .swift and interfaces for both the glance and notification controllers, but is that all? I don't want to submit my app with a blank glance.

I only worry because there is build scheme for both the notification and glance. I can delete these but i'm afraid there is some kind of plist key hidden somewhere that says my app still requires glances and notifications.

Any ideas how to permanently remove these from a watckhit app?

Two options

1) Do as you suggested, delete swift files, delete glance from interface builder, delete build schemes. If something went wrong during the removal, you should get a build error and you can go from there.

2) Delete the watchkit app and re-create it without the glance.

Only way to test this is to get an apple watch and see if the glance doesn't show up. If you don't have the glancecontroller though, you should be fine.

Testing on a watch confirms you must entirely remove the class from your Xcode project.

I performed clean builds to my phone (which auto installed on my paired watch) in between these steps and only the final one removed the glance.

  1. Remove glance from interface builder storyboard
  2. Remove file from Target > Build Phases > Compile Sources (So I could potentially continue coding for a future release.)
  3. Remove source file from project

It's possible I made a mistake along the way (as it's pretty late, and the clean building is a bit putzy) but I believe all of those steps are required.

I'm not sure why having a file in project would be the last indicator for the glance to be included, and renaming might've worked if I had any source code I wanted to save.

Funny business:

  • Between steps one and two, my interface still appeared roughly like what I had framed-in in the storyboard before I deleted the glance (long ago).
  • Between steps two and three, the glance just showed a spinner
  1. Remove glance controller from storyboard.

  2. Trash GlanceController.swift from project.

  3. Confirm that the same file is not persisting in Targets -> Extension -> Build Phases -> Compile Sources file list.

  4. Important: This warning may persist until you close the project and reopen it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM