Xcode won't let me use NSObject's init() function for UIView
To close this thread/question, I'll add an answer.
I wasn't the one who solved this. This project, if not mentioned in the question, is merely a side project, from a remote/freelance work. I was actually, if not mentioned above too, migrating the project to Swift 4.2. Along the way, this issue came up. I didn't bother to rename all the pieces of codes to be renamed during the update. Long story short, I gave up on this task for a bit, but someone in the company decided to solve it.
The solution is: finish the migration first. Just rename all the stuff that is needed for Swift 4.2, and update the pods as well. That's it! :) I hope this helps people in the future.
Swift 3 : Warning Unused result of call when overriding BecomeFirstResponder
The bug has been solved in the lastest Swift version.
Swift 3 : Warning Unused result of call when overriding BecomeFirstResponder
The bug has been solved in the lastest Swift version.
How do I get and store an initial value of a property of a UIView?
You cannot declare it as a class level property because it won't be created until the ViewController is instantiated. I think what you want to do is as follows.
//instantiate with an initial value of 0.0
public var inputRest : CGFloat = 0.0
override func viewDidLoad() {
super.viewDidLoad()
//you can do this here, because the userInputView will have been created
self.inputRest = self.userInputView.frame.origin.y
}
This is an inherent limitation of ViewControllers which are instantiated from a storyboard not being able to have let properties which can only be defined once. There are ways around this by overwriting the constructor used to create the view controller from the coder, but it's a lot of work, not easy to read, and very much a lot of work for nothing.
Related Topics
Realitykit VS Scenekit VS Metal - High-Quality Rendering
Xcode Swift Am/Pm Time to 24 Hour Format
How to Make a Random Color With Swift
When Should I Access Properties With Self in Swift
Use Binding≪Int≫ With a Textfield Swiftui
Check If 'Any' Value Is Object
Swift Lazy Instantiating Using Self
Why My Return Is Nil But If I Press the Url in Chrome/Safari, I Can Get Data
Printing a Variable Memory Address in Swift
How to Get Current Language Code With Swift
What Does "@Uiapplicationmain" Mean
What's the Simplest Way to Convert from a Single Character String to an Ascii Value in Swift
Getting the Decimal Part of a Double in Swift
Swift 2 ( Executefetchrequest ): Error Handling
How to Fix Cocoapod .Modulemap File Not Found
Rounding a Double Value to X Number of Decimal Places in Swift