Swift Xcode - FittedSheets Errors - swift

I have just updated Xcode to the newest released version Xcode 12 and had updates my cocoa pods. I am now getting errors with 'FittedSheets' cocoa pod. I am not sure if they have released a new documentation on how to fix these errors but wanted to see if anyone has encountered and solved these errors.
let sheetController = SheetViewController(controller: vc, sizes: [.fixed(290)])
sheetController.blurBottomSafeArea = false
sheetController.adjustForBottomSafeArea = false
// Make corners more round
sheetController.topCornersRadius = 15

Update your pods through terminal, this usually fixes the problem when swift updates.

Related

Flutter ml kit not working , possibly after Catalina update

I'm using Flutters mlkit plugin, which was working about 5 days ago. I'm now getting errors in Xcode. I'm not sure if its from Flutter upgrading. I am in the stable channel and my flutter doctor has no issues. I have run Flutter clean and updated my pods, but still get errors. I have also updated my macs OS to Catalina since then and not sure if this is a contributor.
Some of the issues are:
No visible #interface for 'FIRRemoteModel' declares the selector 'initWithName:allowsModelUpdates:initialConditions:updateConditions:'
No visible #interface for 'FIRModelManager' declares the selector 'registerRemoteModel:'
No visible #interface for 'FIRLocalModel' declares the selector 'initWithName:path:'
No visible #interface for 'FIRModelManager' declares the selector 'registerLocalModel:'
No known class method for selector 'modelInterpreterWithOptions:'

NSOutlineViewDelegate in High Sierra not working

I am a novice learning Swift and xcode by rewriting a code I originally developed in Javascript/PHP/MySql. I am working in macOS, using a storyboard in xcode as my basis for development. At the moment I am developing a SplitView. In the Master side I have an OutlineView. It has three levels, the outer two are expandable, and, until today, it worked just fine. All levels were populated, visible, and expandable where appropriate. I had Swift(4.0) and xcode (9.1) up-to-date as far as I know. So, today I decided it was time to update from Sierra to High Sierra. My master view has now gone completely blank. Nada. I tried to track the problem down and discovered, using the debugger in xcode, that the outlineView function in the NSOutlineViewDelegate extension to my MasterViewController is, apparently, not being called at all! I checked the Connections Inspector, and the connections to DataSource and Delegate are still intact. I searched online and found a few people with what seemed to be vaguely related recent problems associated with Cocoa bindings, but I could not connect their problem solution to mine since I am not using Cocoa bindings...it's on my list, but I am not there yet. The only thing I know that changed was going from Sierra to High Sierra. Any suggestions? Thanks!
ADDED: I now know a bit more about the problem.
Here is the code that works prior to High Sierra:
class ViewController: NSViewController {
#IBOutlet weak var webView: WebView!
#IBOutlet weak var outlineView: NSOutlineView!
var feeds = Feed
let dateFormatter = DateFormatter()
override func viewDidLoad() {
super.viewDidLoad()
dateFormatter.dateStyle = .short
if let filePath = Bundle.main.path(forResource: "Feeds", ofType: "plist") {
feeds = Feed.feedList(filePath)
print(feeds)
}
}
The code is taken from a tutorial on the OutlineView on the Ray_Wenderlich.com site. I patterned my code after this and both the tutorial and my code worked...until High Sierra. Apparently, until High Sierra, the system would spontaneously parse "feeds" and generate the outlineView display. With High Sierra the behavior changed and it no longer spontaneously produced the outlineView, neither in the tutorial nor my project. The result was a blank outLineView.
In a comment added to the tutorial, I now find that someone else had encountered the same behavior and suggested that the code now needed:
outlineView.reloadData(),
but my naive implementation of that suggestion simply generated a runtime error,
"[NSView reloadData]: unrecognized selector sent to instance"
Just make sure that when you start a new ‘Playground’ you have macOS as an application checked and not IOS. If you have IOS checked Swift will import UIKit (instead of Cocoa) which will cause your problem. GL.

How to fix error – "No Visible #interface for ARCamera"?

I'm trying to build a project that I downloaded from git and I got some errors in the Xcode beta 9.
I noticed that there are some things that are deprecated like ARWorldTrackingSessionConfiguration so I changed them and they were fixed. But I get an error that I can't fix, this is the part from the code:
matrix_float4x4 projectionMatrix = [frame.camera projectionMatrixWithViewportSize: nativeSize
orientation:[[UIApplication sharedApplication] statusBarOrientation]
zNear:(CGFloat)unityCameraNearZ
zFar:(CGFloat)unityCameraFarZ];
I could not fix this and I don't know what to do.
the error for that is this:
No visible #interface for 'ARCamera' declares the selector 'projectionMatrixWithViewportSize:orientation:zNear:zFar
Hope you can help me with this issue?
Thank you.
First of all you should update your XCode from beta to a stable version.
As for
No visible #interface for 'ARCamera' declares the selector 'projectionMatrixWithViewportSize:orientation:zNear:zFar
Here is official Apple documentation about ARCamera class which shows that there is no method projectionMatrixWithViewportSize:orientation:zNear:zFar and it's most possibly was changed to projectionMatrixForOrientation:viewportSize:zNear:zFar:. Signatures of this two methods requires the same parameters, so it won't be problem to replace the old method with a new one.

XPC connection interrupted in Xcode 7 for iOS 9

I recently updated to Xcode 7 and upgraded my iPhone to iOS 9. I have developed and released an iOS app that had worked perfectly fine on the latest version of iOS 8 and Xcode 6.
Upon trying to go through the process of updated the app for iOS 9 support, I am getting the most ridiculously strange error that has left me baffled.
I have done all the syntax corrections automatically through Xcode, and now my app builds properly. It even runs fine at first.
I have a button that segues to a view controller with a WebView. This view controller loads a link that will display either an image, website, or video from youtube. The content is loaded perfectly fine as always. However, the program will crash and reboot the simulator (and my iPhone) and send me to the lock screen when I click the Back button (I am on a navigation stack).
In Xcode, I get the following messages:
XPC Connection Interrupted.
Terminating since there is no system app.
I have Flurry analytics integrated in my app by the way, not sure if thats an issue.
How can I fix this issue? My searches for XPC connections do not seem to return problems similar to mine. I do not even have a clue what an XPC connection is, so why is this in my app anyway?
EDIT: I have found a workaround for the issue. I cannot really say it is a fix.
The crashing was occurring during the use of the method self.navigationController?.popViewControllerAnimated, when set to true. I happened to set this to false, and the crashing stops (now the transition looks awful).
I do not know why this works, and just adds to my confusion.
The problem lied in the storyboard for me as well. I created a new project and laid out the views and everything seemed to be working fine. I found these couple lines in the storyboard source (right click on storyboard and select view as -> source code) which weren't common between the working version and the broken version:
<keyCommands>
<keyCommand/>
</keyCommands>
I have no idea what those lines are supposed to do, or how they crept into my storyboard file, but they were what was crashing the app so hard that the phone had to restart. I removed those lines from my main project and everything worked again.
This error can be caused by executing a loop repeatedly. In my case it was a 'for' loop in which I reset the counting variable. As soon as I added an NSLog in the loop it was obvious.
I just faced the same problem. I don't know if that will help you, but I also think it's coming from the Storyboard:
In my case, the problem is coming from a UITextView. Whenever I try to change the default text inside it, I have this error. If I let the default text or leave it empty, the app works fine. Making an IBOutlet and changing the text programmatically works as well.
I tried with other UI elements, but only the UITextView seems to have this issue.
I have struggled with exact same error. Through a process of elimination I established that it had nothing to do with the any class but had to do with the storyboard. Luckily I keep regular backup copies and I tried to compare storyboards to establish what I had done - but could find nothing obvious.
The backup copy worked fine and I was able to copy my controller classes (from the faulty copy with the changes) into the backup copy and they worked fine.
I think there is a bug possibly in storyboards.
I have same error message when I place a subview in -layoutSubviews method:
-(void)layoutSubviews
{
[super layoutSubviews];
[self populateByImageViews];
}
It causes infinite cycle of layout process and crashes app. Don't place subviews in this place!
Deleting UITextView from the one of the view in Storybord removes the error in my case.
In valueChanged: method of a UIControl, I had the same problem
so I made the code inside valueChanged: to run in main thread and it solved the problem.
#IBAction func valueChanged(sender: AnyObject) {
dispatch_async(dispatch_get_main_queue(), {
//code
}
}
For me was some missing constraints with a UISearchBar, but the error was only in the simulator.
I only add some constraints and works better
For me it was xcode live issues caused by IB_DESIGNABLE
If you have any IB_DESIGNABLE in source files, the system's live tracker will check for issues in StoryBoard too. It may leads to unnecessary building.
To disable it-
Open Storyboard file. Editor -> Automatically Refresh Views (Uncheck)
If you needs to Disable Live issue tracking
XCode -> Preferences -> General -> Issues -> Uncheck Live Issues
Reference
My issue probably originated with some storyboard issue, but I cleaned the project, restarted Xcode AND restarted the simulator app and that fixed it.
When using QLPreviewController, I am confronted with this problem. Error messages as follows,
XPC connection interrupted
_BSMachError: (os/kern) invalid capability (20)
_BSMachError: (os/kern) invalid name (15)
Since XPC means OS X interprocess communication, so I think this can solve the problem, especial when updating the UI
dispatch_async(dispatch_get_main_queue(), ^{
// do what you want to do.
});
For Swift 4+, user
DispatchQueue.main.async {
//Your Code
}

Nil optional does not crash in Release

I have the following simple code in NSAppDelegate
func applicationDidFinishLaunching(aNotification: NSNotification) {
var opt:Int?
NSLog("\(opt)")
NSLog("\(opt!)")
NSLog("done")
}
Now when I run that in debug mode it tells me what we all know about unwrapping nil optional. But when I run that for release it silently exits the app with no message at all. No console log. No dump. Nothing!
What's going on here?
Apple has asked me to check if the bug has been fixed with Xcode 6.3 beta 3 with Swift 1.2 (Build: 6D543q). Not sure if I really want to test another beta :-/ However, the answer to my question: it's a bug.
Edit Jumped over my own shadow and tested with the last beta (4). Issue has been fixed.