ImageGrid

This commit is contained in:
Selim Mustafaev 2020-12-21 19:13:47 +03:00
parent f1880a88bd
commit 98bcfc540d
5 changed files with 236 additions and 120 deletions

View File

@ -7,13 +7,13 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
6841A85D4B60DB71D1E68DA0 /* ImageGrid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6841AC687EA6293A0757678C /* ImageGrid.swift */; };
7A000AA224C2EEDE001F5B00 /* Location.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A000AA124C2EEDE001F5B00 /* Location.swift */; }; 7A000AA224C2EEDE001F5B00 /* Location.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A000AA124C2EEDE001F5B00 /* Location.swift */; };
7A0420AA25619AEC00034941 /* Osago.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420A925619AEC00034941 /* Osago.swift */; }; 7A0420AA25619AEC00034941 /* Osago.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420A925619AEC00034941 /* Osago.swift */; };
7A0420AD2561A0B100034941 /* OsagoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420AC2561A0B100034941 /* OsagoController.swift */; }; 7A0420AD2561A0B100034941 /* OsagoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420AC2561A0B100034941 /* OsagoController.swift */; };
7A0420B12561A0E100034941 /* OsagoAddController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420B02561A0E100034941 /* OsagoAddController.swift */; }; 7A0420B12561A0E100034941 /* OsagoAddController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420B02561A0E100034941 /* OsagoAddController.swift */; };
7A0420B62568650C00034941 /* DkbmController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420B52568650C00034941 /* DkbmController.swift */; }; 7A0420B62568650C00034941 /* DkbmController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420B52568650C00034941 /* DkbmController.swift */; };
7A0420BA25693D2C00034941 /* dkbm.js in Resources */ = {isa = PBXBuildFile; fileRef = 7A0420B925693D2C00034941 /* dkbm.js */; }; 7A0420BA25693D2C00034941 /* dkbm.js in Resources */ = {isa = PBXBuildFile; fileRef = 7A0420B925693D2C00034941 /* dkbm.js */; };
7A051611241412CA00FC55AC /* SwiftDate in Frameworks */ = {isa = PBXBuildFile; productRef = 7A051610241412CA00FC55AC /* SwiftDate */; };
7A05161A2414FF0900FC55AC /* DateSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0516192414FF0900FC55AC /* DateSection.swift */; }; 7A05161A2414FF0900FC55AC /* DateSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0516192414FF0900FC55AC /* DateSection.swift */; };
7A0B96A0257D6D4B000B39AD /* MultilineLabelRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0B969F257D6D4B000B39AD /* MultilineLabelRow.swift */; }; 7A0B96A0257D6D4B000B39AD /* MultilineLabelRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0B969F257D6D4B000B39AD /* MultilineLabelRow.swift */; };
7A1090E824A394F100B4F0B2 /* AudioRecordCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A1090E724A394F100B4F0B2 /* AudioRecordCell.swift */; }; 7A1090E824A394F100B4F0B2 /* AudioRecordCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A1090E724A394F100B4F0B2 /* AudioRecordCell.swift */; };
@ -27,12 +27,6 @@
7A11471623FDEB2A00B424AF /* MainSplitController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11471523FDEB2A00B424AF /* MainSplitController.swift */; }; 7A11471623FDEB2A00B424AF /* MainSplitController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11471523FDEB2A00B424AF /* MainSplitController.swift */; };
7A11471823FDEBFA00B424AF /* ReportController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11471723FDEBFA00B424AF /* ReportController.swift */; }; 7A11471823FDEBFA00B424AF /* ReportController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11471723FDEBFA00B424AF /* ReportController.swift */; };
7A11471A23FE839000B424AF /* AuthController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11471923FE839000B424AF /* AuthController.swift */; }; 7A11471A23FE839000B424AF /* AuthController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11471923FE839000B424AF /* AuthController.swift */; };
7A11471D23FEA18700B424AF /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 7A11471C23FEA18700B424AF /* RxSwift */; };
7A11471F23FEA18700B424AF /* RxRelay in Frameworks */ = {isa = PBXBuildFile; productRef = 7A11471E23FEA18700B424AF /* RxRelay */; };
7A11472123FEA18700B424AF /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = 7A11472023FEA18700B424AF /* RxCocoa */; };
7A11472323FEA18700B424AF /* RxBlocking in Frameworks */ = {isa = PBXBuildFile; productRef = 7A11472223FEA18700B424AF /* RxBlocking */; };
7A11472623FEA1F400B424AF /* Realm in Frameworks */ = {isa = PBXBuildFile; productRef = 7A11472523FEA1F400B424AF /* Realm */; };
7A11472823FEA1F400B424AF /* RealmSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 7A11472723FEA1F400B424AF /* RealmSwift */; };
7A11474423FF06CA00B424AF /* Api.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11474323FF06CA00B424AF /* Api.swift */; }; 7A11474423FF06CA00B424AF /* Api.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11474323FF06CA00B424AF /* Api.swift */; };
7A11474723FF2AA500B424AF /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11474623FF2AA500B424AF /* User.swift */; }; 7A11474723FF2AA500B424AF /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11474623FF2AA500B424AF /* User.swift */; };
7A11474923FF2B2D00B424AF /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11474823FF2B2D00B424AF /* Response.swift */; }; 7A11474923FF2B2D00B424AF /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11474823FF2B2D00B424AF /* Response.swift */; };
@ -56,7 +50,6 @@
7A530B7A24001D3300CBFE6E /* CheckController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A530B7924001D3300CBFE6E /* CheckController.swift */; }; 7A530B7A24001D3300CBFE6E /* CheckController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A530B7924001D3300CBFE6E /* CheckController.swift */; };
7A530B7E24017FEE00CBFE6E /* VehicleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A530B7D24017FEE00CBFE6E /* VehicleCell.swift */; }; 7A530B7E24017FEE00CBFE6E /* VehicleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A530B7D24017FEE00CBFE6E /* VehicleCell.swift */; };
7A530B802401803A00CBFE6E /* Vehicle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A530B7F2401803A00CBFE6E /* Vehicle.swift */; }; 7A530B802401803A00CBFE6E /* Vehicle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A530B7F2401803A00CBFE6E /* Vehicle.swift */; };
7A530B8B240181F500CBFE6E /* RxRealm in Frameworks */ = {isa = PBXBuildFile; productRef = 7A530B8A240181F500CBFE6E /* RxRealm */; };
7A61FF8B2575A2CD00D905D5 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7A61FF892575A2CD00D905D5 /* Localizable.strings */; }; 7A61FF8B2575A2CD00D905D5 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7A61FF892575A2CD00D905D5 /* Localizable.strings */; };
7A61FF912575A5B300D905D5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7A61FF8F2575A5B300D905D5 /* InfoPlist.strings */; }; 7A61FF912575A5B300D905D5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7A61FF8F2575A5B300D905D5 /* InfoPlist.strings */; };
7A61FFA0257D3CFC00D905D5 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = 7A61FFA2257D3CFC00D905D5 /* Localizable.stringsdict */; }; 7A61FFA0257D3CFC00D905D5 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = 7A61FFA2257D3CFC00D905D5 /* Localizable.stringsdict */; };
@ -74,7 +67,6 @@
7A6E03282485951700DB22ED /* OwnersController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6E03272485951700DB22ED /* OwnersController.swift */; }; 7A6E03282485951700DB22ED /* OwnersController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6E03272485951700DB22ED /* OwnersController.swift */; };
7A7547E024032CB6004E8406 /* VehiclePhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A7547DF24032CB6004E8406 /* VehiclePhotoCell.swift */; }; 7A7547E024032CB6004E8406 /* VehiclePhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A7547DF24032CB6004E8406 /* VehiclePhotoCell.swift */; };
7A813DBE2506A57100CC93B9 /* AuthenticationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A813DBD2506A57100CC93B9 /* AuthenticationServices.framework */; }; 7A813DBE2506A57100CC93B9 /* AuthenticationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A813DBD2506A57100CC93B9 /* AuthenticationServices.framework */; };
7A813DC12508C4D900CC93B9 /* ExceptionCatcher in Frameworks */ = {isa = PBXBuildFile; productRef = 7A813DC02508C4D900CC93B9 /* ExceptionCatcher */; };
7A813DC32508EE4F00CC93B9 /* EventCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A813DC22508EE4F00CC93B9 /* EventCell.swift */; }; 7A813DC32508EE4F00CC93B9 /* EventCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A813DC22508EE4F00CC93B9 /* EventCell.swift */; };
7A813DC5250AAF3C00CC93B9 /* LocationEditController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A813DC4250AAF3C00CC93B9 /* LocationEditController.swift */; }; 7A813DC5250AAF3C00CC93B9 /* LocationEditController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A813DC4250AAF3C00CC93B9 /* LocationEditController.swift */; };
7A813DC9250B5C9700CC93B9 /* LocationRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A813DC8250B5C9700CC93B9 /* LocationRow.swift */; }; 7A813DC9250B5C9700CC93B9 /* LocationRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A813DC8250B5C9700CC93B9 /* LocationRow.swift */; };
@ -86,8 +78,6 @@
7A96AE31246B2FE400297C33 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A96AE30246B2FE400297C33 /* Constants.swift */; }; 7A96AE31246B2FE400297C33 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A96AE30246B2FE400297C33 /* Constants.swift */; };
7A96AE33246C095700297C33 /* Base64FS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A96AE32246C095700297C33 /* Base64FS.swift */; }; 7A96AE33246C095700297C33 /* Base64FS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A96AE32246C095700297C33 /* Base64FS.swift */; };
7A9FEEC82529AB23001CA50E /* RxRealmDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A9FEEC72529AB23001CA50E /* RxRealmDataSource.swift */; }; 7A9FEEC82529AB23001CA50E /* RxRealmDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A9FEEC72529AB23001CA50E /* RxRealmDataSource.swift */; };
7AABDE1D2532F3EB0041AFC6 /* PKHUD in Frameworks */ = {isa = PBXBuildFile; productRef = 7AABDE1C2532F3EB0041AFC6 /* PKHUD */; };
7AABDE23253327F10041AFC6 /* DifferenceKit in Frameworks */ = {isa = PBXBuildFile; productRef = 7AABDE22253327F10041AFC6 /* DifferenceKit */; };
7AABDE26253350C30041AFC6 /* RxSectionedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AABDE25253350C30041AFC6 /* RxSectionedDataSource.swift */; }; 7AABDE26253350C30041AFC6 /* RxSectionedDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AABDE25253350C30041AFC6 /* RxSectionedDataSource.swift */; };
7AAE6AD324CDDF950023860B /* VehicleEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AAE6AD224CDDF950023860B /* VehicleEvent.swift */; }; 7AAE6AD324CDDF950023860B /* VehicleEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AAE6AD224CDDF950023860B /* VehicleEvent.swift */; };
7AB562BA249C9E9B00473D53 /* Region.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB562B9249C9E9B00473D53 /* Region.swift */; }; 7AB562BA249C9E9B00473D53 /* Region.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB562B9249C9E9B00473D53 /* Region.swift */; };
@ -103,14 +93,13 @@
7AE24C5F251F1B4E00758E39 /* Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE24C5E251F1B4E00758E39 /* Buttons.swift */; }; 7AE24C5F251F1B4E00758E39 /* Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE24C5E251F1B4E00758E39 /* Buttons.swift */; };
7AE26A3324EEF9EC00625033 /* UIViewControllerExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE26A3224EEF9EC00625033 /* UIViewControllerExt.swift */; }; 7AE26A3324EEF9EC00625033 /* UIViewControllerExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE26A3224EEF9EC00625033 /* UIViewControllerExt.swift */; };
7AE26A3524F31B0700625033 /* EventsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE26A3424F31B0700625033 /* EventsController.swift */; }; 7AE26A3524F31B0700625033 /* EventsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE26A3424F31B0700625033 /* EventsController.swift */; };
7AEF47A4253DC4D2001D6238 /* Eureka in Frameworks */ = {isa = PBXBuildFile; productRef = 7AEF47A3253DC4D2001D6238 /* Eureka */; };
7AEFC3BE2529D3CC00BADFB2 /* ConfigurableCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AEFC3BD2529D3CC00BADFB2 /* ConfigurableCell.swift */; }; 7AEFC3BE2529D3CC00BADFB2 /* ConfigurableCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AEFC3BD2529D3CC00BADFB2 /* ConfigurableCell.swift */; };
7AEFE728240455E200910EB7 /* SettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AEFE727240455E200910EB7 /* SettingsController.swift */; }; 7AEFE728240455E200910EB7 /* SettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AEFE727240455E200910EB7 /* SettingsController.swift */; };
7AF12B1D258C9CFF0090F8B8 /* Cloneable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AF12B1C258C9CFF0090F8B8 /* Cloneable.swift */; }; 7AF12B1D258C9CFF0090F8B8 /* Cloneable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AF12B1C258C9CFF0090F8B8 /* Cloneable.swift */; };
7AF58D342402A91C00CE01A0 /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 7AF58D332402A91C00CE01A0 /* Kingfisher */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
6841AC687EA6293A0757678C /* ImageGrid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageGrid.swift; sourceTree = "<group>"; };
7A000AA124C2EEDE001F5B00 /* Location.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Location.swift; sourceTree = "<group>"; }; 7A000AA124C2EEDE001F5B00 /* Location.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Location.swift; sourceTree = "<group>"; };
7A0420A925619AEC00034941 /* Osago.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Osago.swift; sourceTree = "<group>"; }; 7A0420A925619AEC00034941 /* Osago.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Osago.swift; sourceTree = "<group>"; };
7A0420AC2561A0B100034941 /* OsagoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OsagoController.swift; sourceTree = "<group>"; }; 7A0420AC2561A0B100034941 /* OsagoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OsagoController.swift; sourceTree = "<group>"; };
@ -218,20 +207,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
7A813DBE2506A57100CC93B9 /* AuthenticationServices.framework in Frameworks */, 7A813DBE2506A57100CC93B9 /* AuthenticationServices.framework in Frameworks */,
7AF58D342402A91C00CE01A0 /* Kingfisher in Frameworks */,
7A813DC12508C4D900CC93B9 /* ExceptionCatcher in Frameworks */,
7AEF47A4253DC4D2001D6238 /* Eureka in Frameworks */,
7A96AE2F246B2BCD00297C33 /* WebKit.framework in Frameworks */, 7A96AE2F246B2BCD00297C33 /* WebKit.framework in Frameworks */,
7A11472823FEA1F400B424AF /* RealmSwift in Frameworks */,
7A11472123FEA18700B424AF /* RxCocoa in Frameworks */,
7A051611241412CA00FC55AC /* SwiftDate in Frameworks */,
7A11472323FEA18700B424AF /* RxBlocking in Frameworks */,
7AABDE1D2532F3EB0041AFC6 /* PKHUD in Frameworks */,
7AABDE23253327F10041AFC6 /* DifferenceKit in Frameworks */,
7A530B8B240181F500CBFE6E /* RxRealm in Frameworks */,
7A11471F23FEA18700B424AF /* RxRelay in Frameworks */,
7A11471D23FEA18700B424AF /* RxSwift in Frameworks */,
7A11472623FEA1F400B424AF /* Realm in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -439,6 +415,7 @@
7A1090EB24A4E3E100B4F0B2 /* CellProgressView.swift */, 7A1090EB24A4E3E100B4F0B2 /* CellProgressView.swift */,
7ADF6C96250F41B000F237B2 /* PNKeyboard.swift */, 7ADF6C96250F41B000F237B2 /* PNKeyboard.swift */,
7A1DC38D2517ED98002E9C99 /* BlockBarButtonItem.swift */, 7A1DC38D2517ED98002E9C99 /* BlockBarButtonItem.swift */,
6841AC687EA6293A0757678C /* ImageGrid.swift */,
); );
path = Views; path = Views;
sourceTree = "<group>"; sourceTree = "<group>";
@ -482,19 +459,19 @@
); );
name = AutoCat; name = AutoCat;
packageProductDependencies = ( packageProductDependencies = (
7A11471C23FEA18700B424AF /* RxSwift */, 7A11471C23FEA18700B424AF,
7A11471E23FEA18700B424AF /* RxRelay */, 7A11471E23FEA18700B424AF,
7A11472023FEA18700B424AF /* RxCocoa */, 7A11472023FEA18700B424AF,
7A11472223FEA18700B424AF /* RxBlocking */, 7A11472223FEA18700B424AF,
7A11472523FEA1F400B424AF /* Realm */, 7A11472523FEA1F400B424AF,
7A11472723FEA1F400B424AF /* RealmSwift */, 7A11472723FEA1F400B424AF,
7A530B8A240181F500CBFE6E /* RxRealm */, 7A530B8A240181F500CBFE6E,
7AF58D332402A91C00CE01A0 /* Kingfisher */, 7AF58D332402A91C00CE01A0,
7A051610241412CA00FC55AC /* SwiftDate */, 7A051610241412CA00FC55AC,
7A813DC02508C4D900CC93B9 /* ExceptionCatcher */, 7A813DC02508C4D900CC93B9,
7AABDE1C2532F3EB0041AFC6 /* PKHUD */, 7AABDE1C2532F3EB0041AFC6,
7AABDE22253327F10041AFC6 /* DifferenceKit */, 7AABDE22253327F10041AFC6,
7AEF47A3253DC4D2001D6238 /* Eureka */, 7AEF47A3253DC4D2001D6238,
); );
productName = AutoCat; productName = AutoCat;
productReference = 7A1146FD23FDE7E500B424AF /* AutoCat.app */; productReference = 7A1146FD23FDE7E500B424AF /* AutoCat.app */;
@ -526,15 +503,15 @@
); );
mainGroup = 7A1146F423FDE7E500B424AF; mainGroup = 7A1146F423FDE7E500B424AF;
packageReferences = ( packageReferences = (
7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */, 7A11471B23FEA18700B424AF,
7A11472423FEA1F400B424AF /* XCRemoteSwiftPackageReference "realm-cocoa" */, 7A11472423FEA1F400B424AF,
7A530B89240181F500CBFE6E /* XCRemoteSwiftPackageReference "RxRealm" */, 7A530B89240181F500CBFE6E,
7AF58D322402A91C00CE01A0 /* XCRemoteSwiftPackageReference "Kingfisher" */, 7AF58D322402A91C00CE01A0,
7A05160F241412CA00FC55AC /* XCRemoteSwiftPackageReference "SwiftDate" */, 7A05160F241412CA00FC55AC,
7A813DBF2508C4D900CC93B9 /* XCRemoteSwiftPackageReference "ExceptionCatcher" */, 7A813DBF2508C4D900CC93B9,
7AABDE1B2532F3EB0041AFC6 /* XCRemoteSwiftPackageReference "PKHUD" */, 7AABDE1B2532F3EB0041AFC6,
7AABDE21253327F10041AFC6 /* XCRemoteSwiftPackageReference "DifferenceKit" */, 7AABDE21253327F10041AFC6,
7AEF47A2253DC4D2001D6238 /* XCRemoteSwiftPackageReference "Eureka" */, 7AEF47A2253DC4D2001D6238,
); );
productRefGroup = 7A1146FE23FDE7E500B424AF /* Products */; productRefGroup = 7A1146FE23FDE7E500B424AF /* Products */;
projectDirPath = ""; projectDirPath = "";
@ -646,6 +623,7 @@
7ADF6C97250F41B000F237B2 /* PNKeyboard.swift in Sources */, 7ADF6C97250F41B000F237B2 /* PNKeyboard.swift in Sources */,
7A000AA224C2EEDE001F5B00 /* Location.swift in Sources */, 7A000AA224C2EEDE001F5B00 /* Location.swift in Sources */,
7A7547E024032CB6004E8406 /* VehiclePhotoCell.swift in Sources */, 7A7547E024032CB6004E8406 /* VehiclePhotoCell.swift in Sources */,
6841A85D4B60DB71D1E68DA0 /* ImageGrid.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -887,7 +865,7 @@
/* End XCConfigurationList section */ /* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */ /* Begin XCRemoteSwiftPackageReference section */
7A05160F241412CA00FC55AC /* XCRemoteSwiftPackageReference "SwiftDate" */ = { 7A05160F241412CA00FC55AC = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/malcommac/SwiftDate.git"; repositoryURL = "https://github.com/malcommac/SwiftDate.git";
requirement = { requirement = {
@ -895,7 +873,7 @@
minimumVersion = 6.1.0; minimumVersion = 6.1.0;
}; };
}; };
7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */ = { 7A11471B23FEA18700B424AF = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/ReactiveX/RxSwift.git"; repositoryURL = "https://github.com/ReactiveX/RxSwift.git";
requirement = { requirement = {
@ -903,7 +881,7 @@
minimumVersion = 5.0.1; minimumVersion = 5.0.1;
}; };
}; };
7A11472423FEA1F400B424AF /* XCRemoteSwiftPackageReference "realm-cocoa" */ = { 7A11472423FEA1F400B424AF = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/realm/realm-cocoa"; repositoryURL = "https://github.com/realm/realm-cocoa";
requirement = { requirement = {
@ -911,7 +889,7 @@
minimumVersion = 5.0.0; minimumVersion = 5.0.0;
}; };
}; };
7A530B89240181F500CBFE6E /* XCRemoteSwiftPackageReference "RxRealm" */ = { 7A530B89240181F500CBFE6E = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/RxSwiftCommunity/RxRealm"; repositoryURL = "https://github.com/RxSwiftCommunity/RxRealm";
requirement = { requirement = {
@ -919,7 +897,7 @@
minimumVersion = 3.0.0; minimumVersion = 3.0.0;
}; };
}; };
7A813DBF2508C4D900CC93B9 /* XCRemoteSwiftPackageReference "ExceptionCatcher" */ = { 7A813DBF2508C4D900CC93B9 = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/sindresorhus/ExceptionCatcher"; repositoryURL = "https://github.com/sindresorhus/ExceptionCatcher";
requirement = { requirement = {
@ -927,7 +905,7 @@
minimumVersion = 1.1.0; minimumVersion = 1.1.0;
}; };
}; };
7AABDE1B2532F3EB0041AFC6 /* XCRemoteSwiftPackageReference "PKHUD" */ = { 7AABDE1B2532F3EB0041AFC6 = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/pkluz/PKHUD.git"; repositoryURL = "https://github.com/pkluz/PKHUD.git";
requirement = { requirement = {
@ -935,7 +913,7 @@
minimumVersion = 5.4.0; minimumVersion = 5.4.0;
}; };
}; };
7AABDE21253327F10041AFC6 /* XCRemoteSwiftPackageReference "DifferenceKit" */ = { 7AABDE21253327F10041AFC6 = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/ra1028/DifferenceKit.git"; repositoryURL = "https://github.com/ra1028/DifferenceKit.git";
requirement = { requirement = {
@ -943,7 +921,7 @@
minimumVersion = 1.1.5; minimumVersion = 1.1.5;
}; };
}; };
7AEF47A2253DC4D2001D6238 /* XCRemoteSwiftPackageReference "Eureka" */ = { 7AEF47A2253DC4D2001D6238 = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/selim-mustafaev/Eureka"; repositoryURL = "https://github.com/selim-mustafaev/Eureka";
requirement = { requirement = {
@ -951,7 +929,7 @@
kind = branch; kind = branch;
}; };
}; };
7AF58D322402A91C00CE01A0 /* XCRemoteSwiftPackageReference "Kingfisher" */ = { 7AF58D322402A91C00CE01A0 = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/onevcat/Kingfisher"; repositoryURL = "https://github.com/onevcat/Kingfisher";
requirement = { requirement = {
@ -962,69 +940,69 @@
/* End XCRemoteSwiftPackageReference section */ /* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */ /* Begin XCSwiftPackageProductDependency section */
7A051610241412CA00FC55AC /* SwiftDate */ = { 7A051610241412CA00FC55AC = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7A05160F241412CA00FC55AC /* XCRemoteSwiftPackageReference "SwiftDate" */; package = 7A05160F241412CA00FC55AC;
productName = SwiftDate; productName = SwiftDate;
}; };
7A11471C23FEA18700B424AF /* RxSwift */ = { 7A11471C23FEA18700B424AF = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */; package = 7A11471B23FEA18700B424AF;
productName = RxSwift; productName = RxSwift;
}; };
7A11471E23FEA18700B424AF /* RxRelay */ = { 7A11471E23FEA18700B424AF = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */; package = 7A11471B23FEA18700B424AF;
productName = RxRelay; productName = RxRelay;
}; };
7A11472023FEA18700B424AF /* RxCocoa */ = { 7A11472023FEA18700B424AF = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */; package = 7A11471B23FEA18700B424AF;
productName = RxCocoa; productName = RxCocoa;
}; };
7A11472223FEA18700B424AF /* RxBlocking */ = { 7A11472223FEA18700B424AF = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */; package = 7A11471B23FEA18700B424AF;
productName = RxBlocking; productName = RxBlocking;
}; };
7A11472523FEA1F400B424AF /* Realm */ = { 7A11472523FEA1F400B424AF = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7A11472423FEA1F400B424AF /* XCRemoteSwiftPackageReference "realm-cocoa" */; package = 7A11472423FEA1F400B424AF;
productName = Realm; productName = Realm;
}; };
7A11472723FEA1F400B424AF /* RealmSwift */ = { 7A11472723FEA1F400B424AF = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7A11472423FEA1F400B424AF /* XCRemoteSwiftPackageReference "realm-cocoa" */; package = 7A11472423FEA1F400B424AF;
productName = RealmSwift; productName = RealmSwift;
}; };
7A530B8A240181F500CBFE6E /* RxRealm */ = { 7A530B8A240181F500CBFE6E = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7A530B89240181F500CBFE6E /* XCRemoteSwiftPackageReference "RxRealm" */; package = 7A530B89240181F500CBFE6E;
productName = RxRealm; productName = RxRealm;
}; };
7A813DC02508C4D900CC93B9 /* ExceptionCatcher */ = { 7A813DC02508C4D900CC93B9 = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7A813DBF2508C4D900CC93B9 /* XCRemoteSwiftPackageReference "ExceptionCatcher" */; package = 7A813DBF2508C4D900CC93B9;
productName = ExceptionCatcher; productName = ExceptionCatcher;
}; };
7AABDE1C2532F3EB0041AFC6 /* PKHUD */ = { 7AABDE1C2532F3EB0041AFC6 = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7AABDE1B2532F3EB0041AFC6 /* XCRemoteSwiftPackageReference "PKHUD" */; package = 7AABDE1B2532F3EB0041AFC6;
productName = PKHUD; productName = PKHUD;
}; };
7AABDE22253327F10041AFC6 /* DifferenceKit */ = { 7AABDE22253327F10041AFC6 = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7AABDE21253327F10041AFC6 /* XCRemoteSwiftPackageReference "DifferenceKit" */; package = 7AABDE21253327F10041AFC6;
productName = DifferenceKit; productName = DifferenceKit;
}; };
7AEF47A3253DC4D2001D6238 /* Eureka */ = { 7AEF47A3253DC4D2001D6238 = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7AEF47A2253DC4D2001D6238 /* XCRemoteSwiftPackageReference "Eureka" */; package = 7AEF47A2253DC4D2001D6238;
productName = Eureka; productName = Eureka;
}; };
7AF58D332402A91C00CE01A0 /* Kingfisher */ = { 7AF58D332402A91C00CE01A0 = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = 7AF58D322402A91C00CE01A0 /* XCRemoteSwiftPackageReference "Kingfisher" */; package = 7AF58D322402A91C00CE01A0;
productName = Kingfisher; productName = Kingfisher;
}; };
/* End XCSwiftPackageProductDependency section */ /* End XCSwiftPackageProductDependency section */

View File

@ -12,168 +12,168 @@
<key>DifferenceKit (Playground) 1.xcscheme</key> <key>DifferenceKit (Playground) 1.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>6</integer> <integer>6</integer>
</dict> </dict>
<key>DifferenceKit (Playground) 2.xcscheme</key> <key>DifferenceKit (Playground) 2.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>7</integer> <integer>7</integer>
</dict> </dict>
<key>DifferenceKit (Playground).xcscheme</key> <key>DifferenceKit (Playground).xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>3</integer> <integer>3</integer>
</dict> </dict>
<key>Eureka (Playground) 1.xcscheme</key> <key>Eureka (Playground) 1.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>2</integer> <integer>2</integer>
</dict> </dict>
<key>Eureka (Playground) 2.xcscheme</key> <key>Eureka (Playground) 2.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>4</integer> <integer>4</integer>
</dict> </dict>
<key>Eureka (Playground) 3.xcscheme</key> <key>Eureka (Playground) 3.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>16</integer> <integer>19</integer>
</dict> </dict>
<key>Eureka (Playground) 4.xcscheme</key> <key>Eureka (Playground) 4.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>17</integer> <integer>21</integer>
</dict> </dict>
<key>Eureka (Playground) 5.xcscheme</key> <key>Eureka (Playground) 5.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>18</integer> <integer>23</integer>
</dict> </dict>
<key>Eureka (Playground).xcscheme</key> <key>Eureka (Playground).xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>1</integer> <integer>1</integer>
</dict> </dict>
<key>GettingStarted (Playground) 1.xcscheme</key> <key>GettingStarted (Playground) 1.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>14</integer> <integer>15</integer>
</dict> </dict>
<key>GettingStarted (Playground) 2.xcscheme</key> <key>GettingStarted (Playground) 2.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>15</integer> <integer>17</integer>
</dict> </dict>
<key>GettingStarted (Playground) 3.xcscheme</key> <key>GettingStarted (Playground) 3.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>13</integer> <integer>13</integer>
</dict> </dict>
<key>GettingStarted (Playground) 4.xcscheme</key> <key>GettingStarted (Playground) 4.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>14</integer> <integer>16</integer>
</dict> </dict>
<key>GettingStarted (Playground) 5.xcscheme</key> <key>GettingStarted (Playground) 5.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>15</integer> <integer>18</integer>
</dict> </dict>
<key>GettingStarted (Playground).xcscheme</key> <key>GettingStarted (Playground).xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>12</integer> <integer>12</integer>
</dict> </dict>
<key>Rx (Playground) 1.xcscheme</key> <key>Rx (Playground) 1.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>8</integer> <integer>8</integer>
</dict> </dict>
<key>Rx (Playground) 2.xcscheme</key> <key>Rx (Playground) 2.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>9</integer> <integer>9</integer>
</dict> </dict>
<key>Rx (Playground).xcscheme</key> <key>Rx (Playground).xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>5</integer> <integer>5</integer>
</dict> </dict>
<key>SwiftDate (Playground) 1.xcscheme</key> <key>SwiftDate (Playground) 1.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>11</integer> <integer>11</integer>
</dict> </dict>
<key>SwiftDate (Playground) 2.xcscheme</key> <key>SwiftDate (Playground) 2.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>13</integer> <integer>14</integer>
</dict> </dict>
<key>SwiftDate (Playground) 3.xcscheme</key> <key>SwiftDate (Playground) 3.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>16</integer> <integer>20</integer>
</dict> </dict>
<key>SwiftDate (Playground) 4.xcscheme</key> <key>SwiftDate (Playground) 4.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>17</integer> <integer>22</integer>
</dict> </dict>
<key>SwiftDate (Playground) 5.xcscheme</key> <key>SwiftDate (Playground) 5.xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>18</integer> <integer>24</integer>
</dict> </dict>
<key>SwiftDate (Playground).xcscheme</key> <key>SwiftDate (Playground).xcscheme</key>
<dict> <dict>
<key>isShown</key> <key>isShown</key>
<false/> <false />
<key>orderHint</key> <key>orderHint</key>
<integer>10</integer> <integer>10</integer>
</dict> </dict>
@ -183,7 +183,7 @@
<key>7A1146FC23FDE7E500B424AF</key> <key>7A1146FC23FDE7E500B424AF</key>
<dict> <dict>
<key>primary</key> <key>primary</key>
<true/> <true />
</dict> </dict>
</dict> </dict>
</dict> </dict>

View File

@ -59,6 +59,12 @@ class AdsController: FormViewController {
// row.value = url // row.value = url
// } // }
// } // }
if !ad.photos.isEmpty {
section <<< ImageGridRow() { row in
row.value = ad.photos.toArray()
}
}
} }
} }
} }

View File

@ -0,0 +1,94 @@
import UIKit
import Kingfisher
class ImageCell: UICollectionViewCell {
private var imgView: UIImageView!
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(frame: CGRect) {
super.init(frame: frame)
self.imgView = UIImageView()
self.contentView.addSubview(self.imgView)
self.imgView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
self.imgView.leadingAnchor.constraint(equalTo: self.contentView.leadingAnchor),
self.imgView.trailingAnchor.constraint(equalTo: self.contentView.trailingAnchor),
self.imgView.topAnchor.constraint(equalTo: self.contentView.topAnchor),
self.imgView.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor)
])
}
func configure(with image: String) {
guard let url = URL(string: image) else { return }
self.imgView.kf.setImage(with: url)
}
}
class ImageGrid: UICollectionView, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {
private var images: [String] = []
private var columnsCount: Int = 1
private var spacing: CGFloat = 0
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) {
super.init(frame: frame, collectionViewLayout: layout)
self.register(ImageCell.self, forCellWithReuseIdentifier: "ImageCell")
self.dataSource = self
self.delegate = self
}
convenience init(columns: Int, spacing: CGFloat = 0) {
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .vertical
layout.minimumInteritemSpacing = spacing
layout.minimumLineSpacing = spacing
layout.estimatedItemSize = .zero
self.init(frame: .zero, collectionViewLayout: layout)
self.columnsCount = columns
self.spacing = spacing
}
override var intrinsicContentSize: CGSize {
return self.collectionViewLayout.collectionViewContentSize
}
func set(images: [String]) {
self.images = images
self.reloadData()
self.invalidateIntrinsicContentSize()
}
func set(columnsCount: Int) {
self.columnsCount = columnsCount
self.reloadData()
self.invalidateIntrinsicContentSize()
}
// MARK: - UICollectionViewDataSource
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return self.images.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
guard let cell = self.dequeueReusableCell(withReuseIdentifier: "ImageCell", for: indexPath) as? ImageCell else { return UICollectionViewCell() }
cell.configure(with: self.images[indexPath.row])
return cell
}
// MARK: - UICollectionViewDelegateFlowLayout
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let cellSize = (self.bounds.size.width - self.spacing*(CGFloat(self.columnsCount) - 1))/CGFloat(self.columnsCount)
print("====================================")
print("bounds: \(self.bounds)")
return CGSize(width: cellSize, height: cellSize)
}
}

View File

@ -1,2 +1,40 @@
import Foundation import UIKit
import Eureka
final class ImageGridCell: Cell<[String]>, CellType {
private var grid: ImageGrid!
required init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override func setup() {
super.setup()
self.grid = ImageGrid(columns: 3)
self.grid.translatesAutoresizingMaskIntoConstraints = false
self.contentView.addSubview(self.grid)
NSLayoutConstraint.activate([
self.grid.leadingAnchor.constraint(equalTo: self.contentView.leadingAnchor),
self.grid.trailingAnchor.constraint(equalTo: self.contentView.trailingAnchor),
self.grid.topAnchor.constraint(equalTo: self.contentView.topAnchor),
self.grid.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor)
])
}
override func update() {
super.update()
self.grid.set(images: row.value ?? [])
}
}
final class ImageGridRow: Row<ImageGridCell>, RowType {
required init(tag: String?) {
super.init(tag: tag)
cellProvider = CellProvider<ImageGridCell>()
}
}