Four Steps To Swift 4 Export Of Images Inwards Graphic 3.1
If yous role Graphic on macOS for your vector drawing yous mightiness convey noticed inwards the recent update that yous tin straightaway export images to Swift 4.
There are a duet of steps to accomplish this:
1. Go to Graphic > Preferences... on the card bar too choose the Import/Export tab. At the bottom of the window yous volition run across that in that place is a drib downward card nether Core Graphics Export. Change the selected especial from Objective-C to Swift four too attain upwards one's heed whether you'd similar code for display on iOS or macOS devices.
2. Select the object(s) yous wishing to export inwards your drawing.
3. From the move on card choose Edit > Copy As > Core Graphics Code
4. Now yous tin Cmd + v glue the code into your app. However, endure aware that the output code is designed to endure used inside the draw(_ :) of a UIView subclass too that yous are responsible for the surrounding code. Here the carmine box highlights the pasted code too the surrounding code has been written beforehand.
The surrounding code reads:
import UIKit flat View:UIView { override func draw(_ rect: CGRect) { // insert Graphic generated Swift four code hither } } allow v = View(frame: CGRect(x: 0, y: 0, width: 400, height: 100))Change your view's frame accordingly to exam the results.
Comments
Post a Comment