In the last issue, we have mentioned a nifty macOS app capable of converting JSON to Swift. We have another interesting free app for developers with this number. Bear with us.
Also in the last issue, we wrote about how Apple changed several items on their App Review policies and guidelines, this time pro developers. And they are also accepting criticism and suggestions for future changes.
As announced at WWDC20, App Store product pages will feature a new privacy information section to help users understand an app’s privacy practices.
In the following page, Apple publishes more details for developers on what will be covered by this new privacy section.
Later this year, you’ll be able to acquire, retain, and win back subscribers with subscription offer codes: unique, alphanumeric codes that provide free or discounted prices for auto-renewable subscriptions.
All you need to know if you want to sponsorship this newsletter, in the following link.
We have developed this Class Extension while ago to create UIBezierPah circles and squares the easy way. You can use this on your projects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | /* Created by Magno Urbano (www.katkay.com) Distributed under Attribution 4.0 International License (CC BY 4.0) */ import Foundation import UIKit extension UIBezierPath { class func circlePathWith(center: CGPoint, radius: CGFloat) -> UIBezierPath { let circlePath = UIBezierPath() circlePath.addArc(withCenter: center, radius: radius, startAngle: -CGFloat(Double.pi), endAngle: -CGFloat(Double.pi/2), clockwise: true) circlePath.addArc(withCenter: center, radius: radius, startAngle: -CGFloat(Double.pi/2), endAngle: 0, clockwise: true) circlePath.addArc(withCenter: center, radius: radius, startAngle: 0, endAngle: CGFloat(Double.pi/2), clockwise: true) circlePath.addArc(withCenter: center, radius: radius, startAngle: CGFloat(Double.pi/2), endAngle: CGFloat(Double.pi), clockwise: true) circlePath.close() return circlePath } class func rectanglePathWith(center: CGPoint, side: CGFloat) -> UIBezierPath { let squarePath = UIBezierPath() let startX = center.x - side / 2 let startY = center.y - side / 2 squarePath.move(to: CGPoint(x: startX, y: startY)) squarePath.addLine(to: squarePath.currentPoint) squarePath.addLine(to: CGPoint(x: startX + side, y: startY)) squarePath.addLine(to: squarePath.currentPoint) squarePath.addLine(to: CGPoint(x: startX + side, y: startY + side)) squarePath.addLine(to: squarePath.currentPoint) squarePath.addLine(to: CGPoint(x: startX, y: startY + side)) squarePath.addLine(to: squarePath.currentPoint) squarePath.close() return squarePath } } |
How to use it:
1 2 | let circle = UIBezierPath.circlePathWith(center: centerPoint, radius: radius) let solidSquare = UIBezierPath.rectanglePathWith(center: centerPoint, side: sideLength) |
Suppose you want to check if all members of an collection satisfy a given condition.
Imagine we have this array describing the distance, in light-years, to specific stars:
1 | let stars = [8.6, 4.4, 11.9, 18.8, 10.5] |
If you want to check if all elements are 10 light-years or higher you can use:
1 | let result:Bool = stars.allSatisfy { $0 >= 10.0 } |
Here are 15 tips from Savvy Apps Development Team to help improve your Swift style and make your code clean and blazingly fast. Tips go from improving code readability to avoiding using @objc as much as possible to make code run faster. It is a must read.
Boop is an interesting free macOS app that performs some functions to plain text. Examples:encode text to Base64 or decode from it, count characters, words or lines, convert date to timestamp, convert CSV to JSON, URL encode or decode, convert JSON to CSV, minify JSON, minify CSS, sort text, and much more. Completely free.