|
|
@@ -1,7 +1,7 @@ |
|
|
|
import Foundation |
|
|
|
|
|
|
|
protocol MItemsCount { |
|
|
|
var itemsCount: Int { get } |
|
|
|
struct M { |
|
|
|
var itemsCount: Int = 16 |
|
|
|
} |
|
|
|
|
|
|
|
func memorySide() -> CGFloat { |
|
|
@@ -16,7 +16,7 @@ func memoryGap() -> CGFloat { |
|
|
|
return memorySide() + memorySpace() |
|
|
|
} |
|
|
|
|
|
|
|
func memoryItemPositions(M: MItemsCount) -> [(CGFloat, CGFloat)] { |
|
|
|
func memoryItemPositions(_ M: M) -> [(CGFloat, CGFloat)] { |
|
|
|
var pos = [(CGFloat, CGFloat)]() |
|
|
|
for i in stride(from: 0, to: M.itemsCount, by: 1) { |
|
|
|
let row = floor(Double(i) / 4) |
|
|
|