SwiftKotlin icon indicating copy to clipboard operation
SwiftKotlin copied to clipboard

A tool to convert Swift code to Kotlin.

Results 17 SwiftKotlin issues
Sort by recently updated
recently updated
newest added

Swift: ``` guard array.count > row, let a = CustomView.viewFor(item: array1[column].array[row]), let b = something(a) else { return UIView() } ... ``` Tool Return: ``` val a = CustomView.viewFor(item =...

bug

Optional plugin that could transform some types: `UIView` -> `View` `UITextField` -> `EditText` `UIButton` -> `Button` `UILabel` -> `Label` `UITableView` -> `RecyclerView` `UIScrollView` -> `ScrollView` `UIImageView` -> `ImageView` ... Then,...

enhancement

List of some methods that could be transformed. On List: - `list.first` --> `list.firstOrNull()` - `list.last` --> `list.lastOrNull()` - `list.count` --> `list.size` - `list.isEmpty` --> `list.isEmpty()` - `list.index(of: a)` -->...

enhancement

In Swift, switch cases can contain `where` clauses like the following: ``` switch exception { case .generic(let error) where error != nil: trackError(name: "generic", message: error!) default: trackError(name: "generic", message:...

bug

This Swift: ``` public struct VoucherCampaign { public static let inviteFriendsId = VoucherCampaignId("INVITE_FRIENDS") } ``` Translates to: ``` public data class VoucherCampaign( public val inviteFriendsId = VoucherCampaignId("INVITE_FRIENDS") ) {} ```...

bug

When body is empty, Kotlin allows to remove the `{}` Example: ``` class A { init() {} func test() {} } ``` Translates to: ``` class A { constructor() {}...

enhancement

Strings with simple expressions can remove the `{}`. Example: ``` "\(day), \(date.totalTime)" ``` Translates to ``` "${day}, ${date.totalTime}" ``` But could be ``` "$day, ${date.totalTime}" ```

enhancement