Post

Replies

Boosts

Views

Activity

Reply to Constraints don't work (UIKit)
before adding a constraint you must set the translatesAutoresizingMaskIntoConstraints=false on the given view. import UIKit class ViewController: UIViewController {     var myView = UIView()     override func viewDidLoad() {         super.viewDidLoad()         myView.frame.size.width = 100         myView.frame.size.height = 100         myView.backgroundColor = .green         view.addSubview(myView)         let margins = view.layoutMarginsGuide /** set translatesAutoresizingMaskIntoConstraints=false for every view a constraint is being applied to*/ myView.translatesAutoresizingMaskIntoConstraints=false          myView.trailingAnchor.constraint(equalTo: margins.trailingAnchor).isActive = true     } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’22
Reply to Question about formatting of Measurement<...> items
import Foundation let times = [1,10,100,1000,10103,2354,83674,182549].map {     Measurement<UnitDuration>(value: $0, unit: .microseconds) } // convert times from microseconds to milliseconds let milliseconds = times.map { $0.converted(to: .milliseconds)} milliseconds.forEach { print($0.value) } // output 0.001 0.009999999999999998 0.09999999999999999 1.0 10.103 2.3539999999999996 83.67399999999999 182.54899999999998 Or to mutate a measurement inplace var micro = Measurement<UnitDuration>(value: 1000000, unit: .microseconds) micro.convert(to: .milliseconds) print(micro.value) // output 1000.00
Topic: App & System Services SubTopic: General Tags:
Mar ’22
Reply to App got rejected
More functionality. Add more beef in terms of the feature set not minimal fluff just to show that you can load a JSON feed. What benefits will your application offer the end user. Will it allow the end user to submit their recipes, will it allow the end user to share recipes, will it allow them to rate other recipes or plan meals. Sit down and ask yourself as an end user of this application what will compel me to want to download this app and build your new design and work flows from those questions. Involve family & friends get their feedback.
Topic: Design SubTopic: General Tags:
Mar ’22