Skip to content

Commit

Permalink
feat: use UIGraphicsImageRenderer (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski authored Jan 8, 2025
1 parent 367b000 commit dd0a34b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/react-native-bottom-tabs/ios/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ extension PlatformImage {
}
return newImage
#else
UIGraphicsBeginImageContextWithOptions(size, false, 0.0)
self.draw(in: CGRect(origin: CGPoint.zero, size: size))
let resizedImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
return resizedImage
let renderer = UIGraphicsImageRenderer(size: size)
return renderer.image { context in
self.draw(in: CGRect(origin: .zero, size: size))
}
#endif
}
}
Expand Down

0 comments on commit dd0a34b

Please sign in to comment.