uiimage

How to create an image of specific size from UIView

笑着哭i 提交于 2020-05-13 22:57:01
问题 I'm working on iOS app which should enable users to create Instagram stories photos and export them to Instagram. Basically app like Unfold, Stellar, Chroma Stories... I've prepared UI where user can select from prepared templates and add to them own photos with filters, labels etc. My question is - what is the best way to export created UIView to bigger Image? I mean how to get the best quality, sharp pixels of labels etc? Because the template view with subviews (added photos, labels...) is

How to create an image of specific size from UIView

て烟熏妆下的殇ゞ 提交于 2020-05-13 22:55:10
问题 I'm working on iOS app which should enable users to create Instagram stories photos and export them to Instagram. Basically app like Unfold, Stellar, Chroma Stories... I've prepared UI where user can select from prepared templates and add to them own photos with filters, labels etc. My question is - what is the best way to export created UIView to bigger Image? I mean how to get the best quality, sharp pixels of labels etc? Because the template view with subviews (added photos, labels...) is

Custom circular button for SignIn with Apple

↘锁芯ラ 提交于 2020-04-16 04:53:12
问题 I'm following Apple's guidelines for implementing the "Sign in with Apple" button. In the documentation apple says that it is also possible to use only the logo to create a custom button of "Log in with Apple), also you can also change the shape of the image to have a circular button ... In order to be able to edit the image it also provides insert a mask but I don't understand that we have to create a mask for the button or the selected image. This is what apple wrote in the documentation At

UICollectionViewLayout Not working with UIImage in Swift 5 and Xcode 11

雨燕双飞 提交于 2020-04-07 08:21:11
问题 Please check this attached code and screen short. It's work fine when I set the color of container view but when I add UIImage in cell then it's not working. I changed the imageview content mode but it's not working. class ViewController: UIViewController { @IBOutlet weak var segColumn: UISegmentedControl! @IBOutlet weak var collectionView: UICollectionView! fileprivate var items: [UIImage] = [ // My images ] override func viewDidLoad() { super.viewDidLoad() self.setup() } } extension

SwiftUI - Add Border to One Edge of an Image

半腔热情 提交于 2020-03-19 05:09:16
问题 It's a pretty straight-forward question - how does one apply a border effect to only the wanted edges of an Image with SwiftUI? For example, I only want to apply a border to the top and bottom edges of an image because the image is taking up the entire width of the screen. Image(mission.missionImageString) .resizable() .aspectRatio(contentMode: .fit) .border(Color.white, width: 2) //Adds a border to all 4 edges Any help is appreciated! 回答1: Using this custom struct: struct EdgeBorder: Shape {

SwiftUI - Add Border to One Edge of an Image

偶尔善良 提交于 2020-03-19 05:02:17
问题 It's a pretty straight-forward question - how does one apply a border effect to only the wanted edges of an Image with SwiftUI? For example, I only want to apply a border to the top and bottom edges of an image because the image is taking up the entire width of the screen. Image(mission.missionImageString) .resizable() .aspectRatio(contentMode: .fit) .border(Color.white, width: 2) //Adds a border to all 4 edges Any help is appreciated! 回答1: Using this custom struct: struct EdgeBorder: Shape {

CGImage from images stored on iCloud look wrong

浪子不回头ぞ 提交于 2020-03-04 07:02:42
问题 I'm extracting pixel colors from a CGImage using the code described in this answer. However, I just realized that if I load an image that was created on another device, the pixels values look wrong. The first obvious problem is that the alpha is gone. The CGImageAlphaInfo reports .noneSkipLast , but I know the image is RGBA. If I read it from the same device it was created, it looks fine. The second problem is that there is some color bleeding, as if the image had been resized. Perhaps is

CGImage from images stored on iCloud look wrong

冷暖自知 提交于 2020-03-04 07:02:18
问题 I'm extracting pixel colors from a CGImage using the code described in this answer. However, I just realized that if I load an image that was created on another device, the pixels values look wrong. The first obvious problem is that the alpha is gone. The CGImageAlphaInfo reports .noneSkipLast , but I know the image is RGBA. If I read it from the same device it was created, it looks fine. The second problem is that there is some color bleeding, as if the image had been resized. Perhaps is

CGImage from images stored on iCloud look wrong

时光怂恿深爱的人放手 提交于 2020-03-04 07:02:04
问题 I'm extracting pixel colors from a CGImage using the code described in this answer. However, I just realized that if I load an image that was created on another device, the pixels values look wrong. The first obvious problem is that the alpha is gone. The CGImageAlphaInfo reports .noneSkipLast , but I know the image is RGBA. If I read it from the same device it was created, it looks fine. The second problem is that there is some color bleeding, as if the image had been resized. Perhaps is

Swizzling UIImage init not working iOS Swift

六月ゝ 毕业季﹏ 提交于 2020-02-24 18:38:30
问题 I am trying to swizzle UIImage.init(named:) but the init is not being called extension UIImage { @objc public convenience init?(swizzledName: String) { self.init(named: swizzledName) /// Do something print("this is working") } static func swizzle() { guard let instance = class_getClassMethod(self, #selector(UIImage.init(named:))), let swizzledInstance = class_getClassMethod(self, #selector(UIImage.init(swizzledName:))) else { return } method_exchangeImplementations(instance, swizzledInstance)