react-component / react-component/upload

iOS 11以下. 在模态进入的(presentViewController)控制器, 调用会出现退出当前控制器的问题.

Open
#106 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
804
Forks
323
Avg merge
12m
Merged PRs (30d)
1

Description

估计原因: iOS 11 以后, DocumentViewController 是一个ViewController, dissmiss 并不会导致此类问题. 而在iOS10上, 当点击(空白区域或者 点击选择某个选项时)会出现此类Bug. 因为会调用iOS 方法里的 dismissViewControllerAnimated:completion.

我这边暂时解决方案是:
`
//override dismissViewControllerAnimated: completion

  • (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion {

      UIViewController *topVC = [[self topViewController]; //获取栈顶控制器
    
      if ([topVC isKindOfClass:[WebVC class]]) {
    
          if (self.isClickExit) { //WebVC 上点击dissmiss 按钮
              [super dismissViewControllerAnimated:flag completion:completion];
          }
      } else {
          [[self topViewController] dismissViewControllerAnimated:flag completion:completion];
      }
    

}
`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the modal-controller flow on iOS 10, focusing on taps on the blank area or an option that trigger dismissViewControllerAnimated:. Trace the presentViewController and dismissViewControllerAnimated: path around DocumentViewController, WebVC, and the top view controller. Done means those interactions no longer dismiss the current controller unexpectedly while an explicit WebVC exit still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.