-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Jeon0976/feature/LocalDB
[feat]: Realm추가
- Loading branch information
Showing
16 changed files
with
265 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
disabled_rules: | ||
- trailing_whitespace | ||
- identifier_name | ||
- force_try | ||
|
||
function_parameter_count: | ||
- 8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// LocalDBMarker.swift | ||
// AVIRO | ||
// | ||
// Created by 전성훈 on 2023/10/11. | ||
// | ||
|
||
import Foundation | ||
|
||
import RealmSwift | ||
|
||
final class MarkerModelFromRealm: Object { | ||
@Persisted(primaryKey: true) var placeId: String | ||
@Persisted var latitude: Double | ||
@Persisted var longitude: Double | ||
|
||
@Persisted var isAll: Bool | ||
@Persisted var isSome: Bool | ||
@Persisted var isRequest: Bool | ||
|
||
// primary key 설정으로 convenince init 설정 | ||
convenience init( | ||
placeId: String, | ||
latitude: Double, | ||
longitude: Double, | ||
isAll: Bool, | ||
isSome: Bool, | ||
isRequest: Bool | ||
) { | ||
self.init() | ||
|
||
self.placeId = placeId | ||
self.latitude = latitude | ||
self.longitude = longitude | ||
self.isAll = isAll | ||
self.isSome = isSome | ||
self.isRequest = isRequest | ||
} | ||
|
||
func toAVIROMarkerModel() -> AVIROMarkerModel { | ||
return AVIROMarkerModel( | ||
placeId: placeId, | ||
x: longitude, | ||
y: latitude, | ||
allVegan: isAll, | ||
someMenuVegan: isSome, | ||
ifRequestVegan: isRequest | ||
) | ||
} | ||
} |
Oops, something went wrong.