diff --git a/AutoCat.xcodeproj/project.pbxproj b/AutoCat.xcodeproj/project.pbxproj index a2ee777..406a87d 100644 --- a/AutoCat.xcodeproj/project.pbxproj +++ b/AutoCat.xcodeproj/project.pbxproj @@ -7,13 +7,13 @@ objects = { /* 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 */; }; 7A0420AA25619AEC00034941 /* Osago.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420A925619AEC00034941 /* Osago.swift */; }; 7A0420AD2561A0B100034941 /* OsagoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420AC2561A0B100034941 /* OsagoController.swift */; }; 7A0420B12561A0E100034941 /* OsagoAddController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420B02561A0E100034941 /* OsagoAddController.swift */; }; 7A0420B62568650C00034941 /* DkbmController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0420B52568650C00034941 /* DkbmController.swift */; }; 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 */; }; 7A0B96A0257D6D4B000B39AD /* MultilineLabelRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A0B969F257D6D4B000B39AD /* MultilineLabelRow.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 */; }; 7A11471823FDEBFA00B424AF /* ReportController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11471723FDEBFA00B424AF /* ReportController.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 */; }; 7A11474723FF2AA500B424AF /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A11474623FF2AA500B424AF /* User.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 */; }; 7A530B7E24017FEE00CBFE6E /* VehicleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A530B7D24017FEE00CBFE6E /* VehicleCell.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 */; }; 7A61FF912575A5B300D905D5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7A61FF8F2575A5B300D905D5 /* InfoPlist.strings */; }; 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 */; }; 7A7547E024032CB6004E8406 /* VehiclePhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A7547DF24032CB6004E8406 /* VehiclePhotoCell.swift */; }; 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 */; }; 7A813DC5250AAF3C00CC93B9 /* LocationEditController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A813DC4250AAF3C00CC93B9 /* LocationEditController.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 */; }; 7A96AE33246C095700297C33 /* Base64FS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A96AE32246C095700297C33 /* Base64FS.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 */; }; 7AAE6AD324CDDF950023860B /* VehicleEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AAE6AD224CDDF950023860B /* VehicleEvent.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 */; }; 7AE26A3324EEF9EC00625033 /* UIViewControllerExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE26A3224EEF9EC00625033 /* UIViewControllerExt.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 */; }; 7AEFE728240455E200910EB7 /* SettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AEFE727240455E200910EB7 /* SettingsController.swift */; }; 7AF12B1D258C9CFF0090F8B8 /* Cloneable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AF12B1C258C9CFF0090F8B8 /* Cloneable.swift */; }; - 7AF58D342402A91C00CE01A0 /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 7AF58D332402A91C00CE01A0 /* Kingfisher */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 6841AC687EA6293A0757678C /* ImageGrid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageGrid.swift; sourceTree = ""; }; 7A000AA124C2EEDE001F5B00 /* Location.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Location.swift; sourceTree = ""; }; 7A0420A925619AEC00034941 /* Osago.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Osago.swift; sourceTree = ""; }; 7A0420AC2561A0B100034941 /* OsagoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OsagoController.swift; sourceTree = ""; }; @@ -218,20 +207,7 @@ buildActionMask = 2147483647; files = ( 7A813DBE2506A57100CC93B9 /* AuthenticationServices.framework in Frameworks */, - 7AF58D342402A91C00CE01A0 /* Kingfisher in Frameworks */, - 7A813DC12508C4D900CC93B9 /* ExceptionCatcher in Frameworks */, - 7AEF47A4253DC4D2001D6238 /* Eureka 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; }; @@ -439,6 +415,7 @@ 7A1090EB24A4E3E100B4F0B2 /* CellProgressView.swift */, 7ADF6C96250F41B000F237B2 /* PNKeyboard.swift */, 7A1DC38D2517ED98002E9C99 /* BlockBarButtonItem.swift */, + 6841AC687EA6293A0757678C /* ImageGrid.swift */, ); path = Views; sourceTree = ""; @@ -482,19 +459,19 @@ ); name = AutoCat; packageProductDependencies = ( - 7A11471C23FEA18700B424AF /* RxSwift */, - 7A11471E23FEA18700B424AF /* RxRelay */, - 7A11472023FEA18700B424AF /* RxCocoa */, - 7A11472223FEA18700B424AF /* RxBlocking */, - 7A11472523FEA1F400B424AF /* Realm */, - 7A11472723FEA1F400B424AF /* RealmSwift */, - 7A530B8A240181F500CBFE6E /* RxRealm */, - 7AF58D332402A91C00CE01A0 /* Kingfisher */, - 7A051610241412CA00FC55AC /* SwiftDate */, - 7A813DC02508C4D900CC93B9 /* ExceptionCatcher */, - 7AABDE1C2532F3EB0041AFC6 /* PKHUD */, - 7AABDE22253327F10041AFC6 /* DifferenceKit */, - 7AEF47A3253DC4D2001D6238 /* Eureka */, + 7A11471C23FEA18700B424AF, + 7A11471E23FEA18700B424AF, + 7A11472023FEA18700B424AF, + 7A11472223FEA18700B424AF, + 7A11472523FEA1F400B424AF, + 7A11472723FEA1F400B424AF, + 7A530B8A240181F500CBFE6E, + 7AF58D332402A91C00CE01A0, + 7A051610241412CA00FC55AC, + 7A813DC02508C4D900CC93B9, + 7AABDE1C2532F3EB0041AFC6, + 7AABDE22253327F10041AFC6, + 7AEF47A3253DC4D2001D6238, ); productName = AutoCat; productReference = 7A1146FD23FDE7E500B424AF /* AutoCat.app */; @@ -526,15 +503,15 @@ ); mainGroup = 7A1146F423FDE7E500B424AF; packageReferences = ( - 7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */, - 7A11472423FEA1F400B424AF /* XCRemoteSwiftPackageReference "realm-cocoa" */, - 7A530B89240181F500CBFE6E /* XCRemoteSwiftPackageReference "RxRealm" */, - 7AF58D322402A91C00CE01A0 /* XCRemoteSwiftPackageReference "Kingfisher" */, - 7A05160F241412CA00FC55AC /* XCRemoteSwiftPackageReference "SwiftDate" */, - 7A813DBF2508C4D900CC93B9 /* XCRemoteSwiftPackageReference "ExceptionCatcher" */, - 7AABDE1B2532F3EB0041AFC6 /* XCRemoteSwiftPackageReference "PKHUD" */, - 7AABDE21253327F10041AFC6 /* XCRemoteSwiftPackageReference "DifferenceKit" */, - 7AEF47A2253DC4D2001D6238 /* XCRemoteSwiftPackageReference "Eureka" */, + 7A11471B23FEA18700B424AF, + 7A11472423FEA1F400B424AF, + 7A530B89240181F500CBFE6E, + 7AF58D322402A91C00CE01A0, + 7A05160F241412CA00FC55AC, + 7A813DBF2508C4D900CC93B9, + 7AABDE1B2532F3EB0041AFC6, + 7AABDE21253327F10041AFC6, + 7AEF47A2253DC4D2001D6238, ); productRefGroup = 7A1146FE23FDE7E500B424AF /* Products */; projectDirPath = ""; @@ -646,6 +623,7 @@ 7ADF6C97250F41B000F237B2 /* PNKeyboard.swift in Sources */, 7A000AA224C2EEDE001F5B00 /* Location.swift in Sources */, 7A7547E024032CB6004E8406 /* VehiclePhotoCell.swift in Sources */, + 6841A85D4B60DB71D1E68DA0 /* ImageGrid.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -887,7 +865,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 7A05160F241412CA00FC55AC /* XCRemoteSwiftPackageReference "SwiftDate" */ = { + 7A05160F241412CA00FC55AC = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/malcommac/SwiftDate.git"; requirement = { @@ -895,7 +873,7 @@ minimumVersion = 6.1.0; }; }; - 7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */ = { + 7A11471B23FEA18700B424AF = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/ReactiveX/RxSwift.git"; requirement = { @@ -903,7 +881,7 @@ minimumVersion = 5.0.1; }; }; - 7A11472423FEA1F400B424AF /* XCRemoteSwiftPackageReference "realm-cocoa" */ = { + 7A11472423FEA1F400B424AF = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/realm/realm-cocoa"; requirement = { @@ -911,7 +889,7 @@ minimumVersion = 5.0.0; }; }; - 7A530B89240181F500CBFE6E /* XCRemoteSwiftPackageReference "RxRealm" */ = { + 7A530B89240181F500CBFE6E = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/RxSwiftCommunity/RxRealm"; requirement = { @@ -919,7 +897,7 @@ minimumVersion = 3.0.0; }; }; - 7A813DBF2508C4D900CC93B9 /* XCRemoteSwiftPackageReference "ExceptionCatcher" */ = { + 7A813DBF2508C4D900CC93B9 = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/sindresorhus/ExceptionCatcher"; requirement = { @@ -927,7 +905,7 @@ minimumVersion = 1.1.0; }; }; - 7AABDE1B2532F3EB0041AFC6 /* XCRemoteSwiftPackageReference "PKHUD" */ = { + 7AABDE1B2532F3EB0041AFC6 = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/pkluz/PKHUD.git"; requirement = { @@ -935,7 +913,7 @@ minimumVersion = 5.4.0; }; }; - 7AABDE21253327F10041AFC6 /* XCRemoteSwiftPackageReference "DifferenceKit" */ = { + 7AABDE21253327F10041AFC6 = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/ra1028/DifferenceKit.git"; requirement = { @@ -943,7 +921,7 @@ minimumVersion = 1.1.5; }; }; - 7AEF47A2253DC4D2001D6238 /* XCRemoteSwiftPackageReference "Eureka" */ = { + 7AEF47A2253DC4D2001D6238 = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/selim-mustafaev/Eureka"; requirement = { @@ -951,7 +929,7 @@ kind = branch; }; }; - 7AF58D322402A91C00CE01A0 /* XCRemoteSwiftPackageReference "Kingfisher" */ = { + 7AF58D322402A91C00CE01A0 = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/onevcat/Kingfisher"; requirement = { @@ -962,69 +940,69 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 7A051610241412CA00FC55AC /* SwiftDate */ = { + 7A051610241412CA00FC55AC = { isa = XCSwiftPackageProductDependency; - package = 7A05160F241412CA00FC55AC /* XCRemoteSwiftPackageReference "SwiftDate" */; + package = 7A05160F241412CA00FC55AC; productName = SwiftDate; }; - 7A11471C23FEA18700B424AF /* RxSwift */ = { + 7A11471C23FEA18700B424AF = { isa = XCSwiftPackageProductDependency; - package = 7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */; + package = 7A11471B23FEA18700B424AF; productName = RxSwift; }; - 7A11471E23FEA18700B424AF /* RxRelay */ = { + 7A11471E23FEA18700B424AF = { isa = XCSwiftPackageProductDependency; - package = 7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */; + package = 7A11471B23FEA18700B424AF; productName = RxRelay; }; - 7A11472023FEA18700B424AF /* RxCocoa */ = { + 7A11472023FEA18700B424AF = { isa = XCSwiftPackageProductDependency; - package = 7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */; + package = 7A11471B23FEA18700B424AF; productName = RxCocoa; }; - 7A11472223FEA18700B424AF /* RxBlocking */ = { + 7A11472223FEA18700B424AF = { isa = XCSwiftPackageProductDependency; - package = 7A11471B23FEA18700B424AF /* XCRemoteSwiftPackageReference "RxSwift" */; + package = 7A11471B23FEA18700B424AF; productName = RxBlocking; }; - 7A11472523FEA1F400B424AF /* Realm */ = { + 7A11472523FEA1F400B424AF = { isa = XCSwiftPackageProductDependency; - package = 7A11472423FEA1F400B424AF /* XCRemoteSwiftPackageReference "realm-cocoa" */; + package = 7A11472423FEA1F400B424AF; productName = Realm; }; - 7A11472723FEA1F400B424AF /* RealmSwift */ = { + 7A11472723FEA1F400B424AF = { isa = XCSwiftPackageProductDependency; - package = 7A11472423FEA1F400B424AF /* XCRemoteSwiftPackageReference "realm-cocoa" */; + package = 7A11472423FEA1F400B424AF; productName = RealmSwift; }; - 7A530B8A240181F500CBFE6E /* RxRealm */ = { + 7A530B8A240181F500CBFE6E = { isa = XCSwiftPackageProductDependency; - package = 7A530B89240181F500CBFE6E /* XCRemoteSwiftPackageReference "RxRealm" */; + package = 7A530B89240181F500CBFE6E; productName = RxRealm; }; - 7A813DC02508C4D900CC93B9 /* ExceptionCatcher */ = { + 7A813DC02508C4D900CC93B9 = { isa = XCSwiftPackageProductDependency; - package = 7A813DBF2508C4D900CC93B9 /* XCRemoteSwiftPackageReference "ExceptionCatcher" */; + package = 7A813DBF2508C4D900CC93B9; productName = ExceptionCatcher; }; - 7AABDE1C2532F3EB0041AFC6 /* PKHUD */ = { + 7AABDE1C2532F3EB0041AFC6 = { isa = XCSwiftPackageProductDependency; - package = 7AABDE1B2532F3EB0041AFC6 /* XCRemoteSwiftPackageReference "PKHUD" */; + package = 7AABDE1B2532F3EB0041AFC6; productName = PKHUD; }; - 7AABDE22253327F10041AFC6 /* DifferenceKit */ = { + 7AABDE22253327F10041AFC6 = { isa = XCSwiftPackageProductDependency; - package = 7AABDE21253327F10041AFC6 /* XCRemoteSwiftPackageReference "DifferenceKit" */; + package = 7AABDE21253327F10041AFC6; productName = DifferenceKit; }; - 7AEF47A3253DC4D2001D6238 /* Eureka */ = { + 7AEF47A3253DC4D2001D6238 = { isa = XCSwiftPackageProductDependency; - package = 7AEF47A2253DC4D2001D6238 /* XCRemoteSwiftPackageReference "Eureka" */; + package = 7AEF47A2253DC4D2001D6238; productName = Eureka; }; - 7AF58D332402A91C00CE01A0 /* Kingfisher */ = { + 7AF58D332402A91C00CE01A0 = { isa = XCSwiftPackageProductDependency; - package = 7AF58D322402A91C00CE01A0 /* XCRemoteSwiftPackageReference "Kingfisher" */; + package = 7AF58D322402A91C00CE01A0; productName = Kingfisher; }; /* End XCSwiftPackageProductDependency section */ diff --git a/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcschemes/xcschememanagement.plist b/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcschemes/xcschememanagement.plist index 0519d6b..1351ee9 100644 --- a/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/AutoCat.xcodeproj/xcuserdata/selim.xcuserdatad/xcschemes/xcschememanagement.plist @@ -12,168 +12,168 @@ DifferenceKit (Playground) 1.xcscheme isShown - + orderHint 6 DifferenceKit (Playground) 2.xcscheme isShown - + orderHint 7 DifferenceKit (Playground).xcscheme isShown - + orderHint 3 Eureka (Playground) 1.xcscheme isShown - + orderHint 2 Eureka (Playground) 2.xcscheme isShown - + orderHint 4 Eureka (Playground) 3.xcscheme isShown - + orderHint - 16 + 19 Eureka (Playground) 4.xcscheme isShown - + orderHint - 17 + 21 Eureka (Playground) 5.xcscheme isShown - + orderHint - 18 + 23 Eureka (Playground).xcscheme isShown - + orderHint 1 GettingStarted (Playground) 1.xcscheme isShown - + orderHint - 14 + 15 GettingStarted (Playground) 2.xcscheme isShown - + orderHint - 15 + 17 GettingStarted (Playground) 3.xcscheme isShown - + orderHint 13 GettingStarted (Playground) 4.xcscheme isShown - + orderHint - 14 + 16 GettingStarted (Playground) 5.xcscheme isShown - + orderHint - 15 + 18 GettingStarted (Playground).xcscheme isShown - + orderHint 12 Rx (Playground) 1.xcscheme isShown - + orderHint 8 Rx (Playground) 2.xcscheme isShown - + orderHint 9 Rx (Playground).xcscheme isShown - + orderHint 5 SwiftDate (Playground) 1.xcscheme isShown - + orderHint 11 SwiftDate (Playground) 2.xcscheme isShown - + orderHint - 13 + 14 SwiftDate (Playground) 3.xcscheme isShown - + orderHint - 16 + 20 SwiftDate (Playground) 4.xcscheme isShown - + orderHint - 17 + 22 SwiftDate (Playground) 5.xcscheme isShown - + orderHint - 18 + 24 SwiftDate (Playground).xcscheme isShown - + orderHint 10 @@ -183,7 +183,7 @@ 7A1146FC23FDE7E500B424AF primary - + diff --git a/AutoCat/Controllers/AdsController.swift b/AutoCat/Controllers/AdsController.swift index db15673..2e9a6d4 100644 --- a/AutoCat/Controllers/AdsController.swift +++ b/AutoCat/Controllers/AdsController.swift @@ -59,6 +59,12 @@ class AdsController: FormViewController { // row.value = url // } // } + + if !ad.photos.isEmpty { + section <<< ImageGridRow() { row in + row.value = ad.photos.toArray() + } + } } } } diff --git a/AutoCat/Views/ImageGrid.swift b/AutoCat/Views/ImageGrid.swift new file mode 100644 index 0000000..b8ca330 --- /dev/null +++ b/AutoCat/Views/ImageGrid.swift @@ -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) + } +} diff --git a/AutoCat/Views/eureka/ImageGridRow.swift b/AutoCat/Views/eureka/ImageGridRow.swift index fbf2875..87ee45e 100644 --- a/AutoCat/Views/eureka/ImageGridRow.swift +++ b/AutoCat/Views/eureka/ImageGridRow.swift @@ -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, RowType { + required init(tag: String?) { + super.init(tag: tag) + cellProvider = CellProvider() + } +} \ No newline at end of file