I have a tableView inside a UIView in a VC.
This VC is in a navigation view. It is a UIViewController, not a UITableViewController.
The VC set up is this one:
The issue:
When I run app, there is a bar (full width, about 25 pixels high) appearing over the tableView at the bottom, hiding partially a cell (we see the (i) button nearly completely hidden). When scrolling tableView, this bar does not move and hides other cell.
I looked at the view in debugger (I edited the content of cells):
and found that the bar which is hiding comes from navigation controller:
So 2 questions:
what is this view ?
How to avoid it coming over the table view ?
I have a solution by replacing upperView by a header in tableView, but I would like to understand what goes on here.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I get this weird behaviour of Xcode.
Version 13.2.1 or 13.2 RC (may be other).
In the storyboard I had a UITableViewController. As it does not give any flexibility to add other views in the VC, I created a new UIViewController, recreated the tableView inside as well as some other objects, added the new views I needed, redid all connections.
Then I removed the UITableViewController.
Everything works perfectly fine.
But sometimes (cannot find any pattern for the cases), when opening the project, the old UITableViewController appears in Storyboard. The new UIViewController doesn't even seem to be here. When I select different VC in SB, no information in Identity inspector or other inspector.
But it compiles and runs OK, using the new UIViewController.
I cleaned build folder, closed Xcode, reboot the Mac, to no avail.
Only way to get it solved was to close the SB and reopen it…
Is there a cache somewhere in SB that is not cleared ?
Here is the set up:
I try to set a constraint for the top of tableView relative to safe area.
No way by control-drag from tableView to Safe area.
But if i create such a constraint for another object (here, like upperView) and then edit the constraint in Inspector, I can replace UpperView by tableView ; and get my constraint set.
What am I missing here ?
I get a surprising crash when adapting constraints.
Xcode 13.2.1
iOS 15.2 on simulator
Here is the set up in storyboard:
A subclass of UIView (PopoverView) to draw a popover like frame and label and button inside.
PopoverView can set its arrow position all around, for instance on the right, so that popover will appear on the left of an object,
or on the left, to appear on the right.
Button tap is used to loop through the arrow position.
I have defined constraints (and their IBOutlets), and notably for the centerX position of popoverView to centerX of the label.
I adapt the value of the constraints in viewWillLayoutSubviews to position the popover in correct position relative to the label.
Now the problem.
To position the popover on the right of the label, I set its centerX constraint as follows in viewWillLayoutSubviews():
popoverCenterToLabelCenterConstraint.constant = (popoverLabel.frame.width + label.frame.width) / 2
That works OK
To position the popover on the left of the label, I set its constraint as follows (offset the opposite value):
popoverCenterToLabelCenterConstraint.constant = -(popoverLabel.frame.width + label.frame.width) / 2
I also tried:
popoverCenterToLabelCenterConstraint.constant = -popoverLabel.frame.width / 2 - label.frame.width / 2
App does not crash but hangs, apparently in an infinite loop.
Idem if I divide by 2.0 instead of 2 : label.frame.width / 2.0
The width of the label, at this point of code, is 92.33333333333333
So I replaced by the value directly:
popoverCenterToLabelCenterConstraint.constant = -popoverLabel.frame.width / 2 - 46.2
and it works OK. Idem with 46.1
So the problem is not due to the position of popoverView
If I replace the div by 2 by 2.01 :
- popoverCenterToLabelCenterConstraint.constant = -popoverLabel.frame.width / 2 - label.frame.width / 2.01
it works !!!!!!
Conclusion: it is the exact div by 2 that causes the hanging.
What could be the reason for this strange behaviour ?
Since a few hours, Sat 1/29/2022, several pages of the forum do not open, such as:
https://developer.apple.com/forums/
https://developer.apple.com/forums/tags/ios
all showing the same messages:
Other tags open without problem.
And those open with a payload:
https://developer.apple.com/forums/?page=1&sortBy=lastUpdated
https://developer.apple.com/forums/search/?q=column&page=1&sortBy=lastUpdated
https://developer.apple.com/forums/tags/ios/?page=2 works, but page=1 doesn't
Does anyone experience the same errors ?
Conf:
MacOS 12.2 (21D49)
Safari Technology Preview Release 139 (Safari 15.4, WebKit 17613.1.14.41.3)
But the pages open correctly on Firefox, Chrome.
Does not open either on Safari Version 15.3 (17612.4.9.1.5)
So issue is apparently on Safari probably not MacOS 12.2 (21D49) , nor on server side.
I have a func to flash a view a number of times and execute closure at the end.
The following code with UIView.setAnimationRepeatCount works OK: animation occurs the requested number of times and afterEnd closure executes at the end.
func flashIt(repeated: Int, cycleTime: Double, delayed: Double = 5.0, afterEnd: (() -> Void)? = nil) {
if repeated < 0 { return }
let initAlpha = self.alpha
UIView.animate(withDuration: cycleTime,
delay: delayed,
options:[.allowUserInteraction, .curveEaseInOut, .autoreverse, .repeat],
animations: {
UIView.setAnimationRepeatCount(Float(repeated))
self.alpha = 0.1 // Not 0.0, to allow user interaction
},
completion: { (done: Bool) in
self.alpha = initAlpha
afterEnd?()
} )
}
To address UIView.setAnimationRepeatCount deprecation, I now try this (inspired by https://stackoverflow.com/questions/47496584/uiviewpropertyanimator-reverse-animation)
func flashIt(repeated: Int, cycleTime: Double, delayed: Double = 5.0, afterEnd: (() -> Void)? = nil) {
if repeated < 0 { return }
let initAlpha = self.alpha
let animator = UIViewPropertyAnimator(duration: cycleTime, curve: .linear) {
self.alpha = 0.1
}
animator.addCompletion { _ in
let reverseAnimator = UIViewPropertyAnimator(duration: cycleTime, curve: .linear) {
self.alpha = initAlpha
}
reverseAnimator.addCompletion { [self] _ in
flashIt(repeated: repeated-1, cycleTime: cycleTime, delayed: 0) // without delay here
}
reverseAnimator.startAnimation()
if repeated <= 1 { // 1 and not 0, otherwise an extra loop…
afterEnd?() // Not called
return
}
}
animator.startAnimation(afterDelay: delayed)
}
The flash works, but afterEnd closure is never called.
I've tried to call
if repeated <= 1 { // 1 and not 0, otherwise an extra loop…
afterEnd?() // Not called
return
}
in other places, to no avail.
What do I miss ?
Is there a better and simpler way to have a RepeatCount with UIViewPropertyAnimator ?
I use UIActivityViewController to airDrop pdfFile (pdfURL) from iPhone to iMac.
Works well, file is airDropped.
let activityVC = UIActivityViewController(activityItems: [pdfURL], applicationActivities: nil)
present(activityVC, animated: true, completion: nil)
I want to customise it:
limit services to AIrDrop and mail
How can I exclude such services as WhatsApp, Notes… ?
perform some action once the file has completed airDrop or once cancelled.
I tried to implement with completionWithItemsHandler:
activityVC.completionWithItemsHandler = { (activity, success, items, error) in
print("Completed")
}
This doesn't work, print is not executed.
My ultimate goal is to close the activityVC automatically once action was completed, without need to tap close button.
Should I define some content for applicationActivities ?
The following code opens the app settings, including preferred language.
func openSettings() {
guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {
return
}
if UIApplication.shared.canOpenURL(settingsUrl) {
UIApplication.shared.open(settingsUrl, completionHandler: nil)
}
}
That works well in iOS (14.6 or 15.2), on iPadOS 14.4 ( both device and simulator)
But on iPadOS 15.2 simulator, the preferred language setting for the app does not show.
I noticed this in 2 different apps.
UISegmented controls seem not to work correctly in iPhone 13 Mini simulator. When tapping on a segment, control does not react before 30 to 40 s ; then it shows uncomplete redraw:
I also noted similar lag in updating display when some label text changes.
Configuration:
MacOS 11.6.1
Xcode 13RC
iOS 15.0 simulator.
It works ok on a few other simulators I tested.
I created an extremely simple project to reproduce:
new project in Xcode 13RC
added a segmentedControl at bottom of view, constrained to leading and trailing 0 to the safe area
set selected color to red.
run on iPhone 13 mini simulator
I will test later with Xcode 13.2ß
When testing in simulator with Xcode 13, I noted a subtle difference in the display of WKInterfaceLabel between Watch series 6 and series 7.
WKInterfaceLabel is in a WKInterfaceGroup.
On Series 7: the text Fast Driving is clipped with round corner at top and bottom
On Series 6, round clipping is much less (noticeable on leading F and D)
I could not find what parameter has changed in IB nor how to change this round corner value. Nor why such a change ?
I submitted an iOS app with a watchOS companion app.App has been 'Metadata Rejected':Here is the full message:Guideline 2.1 - Information NeededWe have started the review of your app, but we are not able to continue because we need access to a video that demonstrates the current version of your app in use on a physical watchOS device.Please only include footage in your demo video of your app running on a physical watchOS device, and not on a simulator. It is acceptable to use a screen recorder to capture footage of your app in use.Next StepsTo help us proceed with the review of your app, please provide us with a link to a demo video in the App Review Information section of App Store Connect and reply to this message in Resolution Center.To provide a link to a demo video:- Log in to App Store Connect- Click on "My Apps"- Select your app- Click on the app version on the left side of the screen- Scroll down to "App Review Information"- Provide demo video access details in the "Notes" section- Once you've completed all changes, click the "Save" button at the top of the Version Information page.Please note that in the event that your app may only be reviewed by means of a demo video, you will be required to provide an updated demo video with every resubmission.Since your App Store Connect status is Metadata Rejected, we do NOT require a new binary. To revise the metadata, visit App Store 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.I have 3 questions:- Is it a systematic requirement for Watch apps ? I did not see in guidelines ; or is it for some reason specific to my app or to the reviewer ?- How can I record video on the Apple Watch ? Should I film the watch while in operation and post this video ? Or is there a direct way to record the video from the watch to iPhone (using system tools, not third party).- I understand it is not video for publication on appstore, but video for tester. So should I include video in the screen captures section or put it on some web site and give a link to it to the tester ?
Even though I have selected all the notification options in my profile,
I do not receive any mail (since about a week), at least when an answer is marked as correct.
I did check they are not in spam.
What do I miss ?
How to reorder a pdf document?
move page p after page n, or at a given m position.
add new page at certain position
rotate a page 90° or 180°.
I've seen libraries, but I would prefer to redevelop those simple functions directly in an iOS app (Swift).
I don't need to edit the document content, just rearrange.
The Code Block doesn't number lines anymore.
The work around is to ask for Numbered list in addition to Code block.
Just applying Code Block:
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
commonInit()
}
Code Block AND Numbered List (or the other order)
1. required init?(coder aDecoder: NSCoder) {
2. super.init(coder: aDecoder)
3. commonInit()
4. }
Is there another way to get numbering directly ?
In the new version of download > More, there doesn't seem to be a way to filter search efficiently. I searched for instance for MacOS (to see all releases). I get a very long list (200+) references, with a lot of Xcode, but nothing specific to MacOS.
If I search for Xcode 11, I get all Xcode references:
I added quotes to try and force an exact search, I just get a Java extension…
That was not the case in the previous version of the more page. Or do I miss something ?