In SwiftUI, you can use the print() function to print messages to the console, which is similar to the console.log() function in JavaScript. Here is an example: In this example, the ContentView struct has a Button that calls the print() function when tapped. The print() function takes a string argument, the message that will be…More
The best programming blog.
Covering a wide array of programming topics.
Xcode print variables not working
If you are not seeing the variables getting printed in the debug area or if you want to copy the value of the local variable to the clipboard then try this: Go to Xcode >> View menu. Click Debug Area >> Activate Console option. That will open the Console at the bottom of the Xcode…More
Angular 15 Run a single spec file
If you want to run a single spec file with ng test command then you need to pass the –include argument along with your ng test command. Example: The above command will run the tests for that specific file added in –include argument.More
Update Angular version in Ionic project
In order to update the Angular version in the Ionic project you need to run the following command: That will update the Angular version of your Ionic project.More
Reverse proxy web socket wss in Ngnix
If you want to reverse proxy the websocket for a domain to a URL in nginx on Ubuntu then you need to add the following section in the configuration file of your site: Go to your /etc/nginx/sites-available/<yourdomain> file and add the above section there at the location where you want to redirect. The complete file…More
How to check the status of ngnix service on Ubuntu
Run the following command to check the status the nginx service on Ubuntu: The above command will give you a detailed status like this: nginx.service – A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor prese> Active: active (running) since Sat 2022-12-11 19:25:12 UTC; 5min 11s ago Docs: man:nginx(8)More
Install specific version of Ionic Angular
If you want to update your Ionic project to a specific version of Ionic Angular in your project run the following command: Above, 14 is the version that we want to install in our project.More
Angular bootstrap Can’t find stylesheet to import.
Error while running ng build command: ./src/styles.scss – Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Can’t find stylesheet to import. @import “~bootstrap/scss/bootstrap”; Go to your styles files i.e src/styles.scss Replace the following line: with this: i.e remove the tild (~) from the path. Running ng build again will not face that issue now.More
Package “@angular-eslint/schematics” has an incompatible peer dependency to “@angular/cli”
Issue while updating the angular version in your project: Package “@angular-eslint/schematics” has an incompatible peer dependency to “@angular/cli” The solution is to run the ng update command first: That will give you the packages which you want to update first: Found 78 dependencies. We analyzed your package.json, there are some packages to update: Name Version…More
The installed Angular CLI version is outdated
Error while running ng commands: The installed Angular CLI version is outdated. Installing a temporary Angular CLI versioned …. to perform the update. Go to your Terminal on your machine and type the following command: This will fix the Angular CLI version is outdated issue for your ng commands.More