iosappdevelopmentwithswiftinaction / distanceconverter Goto Github PK
View Code? Open in Web Editor NEWApp to convert miles to kilometers and vice versa
App to convert miles to kilometers and vice versa
In step 3 under "CONNECTING ACTIONS FROM CODE" you say:
You could also remove the @IBAction keyword from the convertToMiles()
method because this is called from code now, and isn’t connected to an event in
Interface Builder. If you forget to do this, don’t worry; it’s not strictly necessary.
But if you remove @IBAction
you get the following compiler error:
[...]/DistanceConverter/DistanceConverter/ViewController.swift:25:45: Argument of '#selector' refers to instance method 'convertToMiles' that is not exposed to Objective-C
[...]/DistanceConverter/DistanceConverter/ViewController.swift:35:10: Add '@objc' to expose this instance method to Objective-C
If you use the fix button and to add @objc
it works again. Not sure if that's worth mentioning in there? Or If I've just set things up wrong somewhere.
I'm enjoying the book, thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.