Automated Source Code Transformation service
Re-cycle / Re-use / Re-purpose
This project demonstrates the conversion of Gallery demo. RecyclerView is ported to UICollectionView. Along with this this project also shows how android Toast, Snackbar and android resource class gets ported to iOS.
This repository contains the Android source code which was used as input and generated iOS source code project.
RecyclerView - The RecyclerView on iOS is ported to 'UICollectionView' is used. The 'cell_layout.xml' from android project is ported to xib file and used as layout for the 'UICollectionViewCell'. To handle button tap event addTarget() is used. UILabel and UIImageView do not have addTarget(), for these controls 'UITapGestureRecognizer' is assigned.
Snackbar - We were not able to identify suitable library which provides this functionality. Therefore swift implementation of android 'Snackbar' control is provided using custom lib 'RC_Snackbar.swift' developed by ReflectCode.
Toast - Swift implementation of android 'Toast' control is provided using custom lib 'RC_toast.swift' developed by ReflectCode.
Resources - During compilation Android creates R.java providing good type-safety. Taking inspiration from R.swift lib, RC generates 'R.swift' file which provide type-safe access to all the resources. To access the resources 'RC_GetResources.swift' provides various methods which are inlined with android 'Resources' class.
Credits for Android project - http://www.androidauthority.com/how-to-build-an-image-gallery-app-718976/
This project is made available under the MIT license. See the LICENSE file for more details.