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
// Created by Zef Houssney on 1/9/20. | |
// This takes some inspiration from https://gist.github.com/chriseidhof/3c6ea3fb2102052d1898d8ea27fbee07 | |
// but uses a different approach. | |
// Instead of trying to calculate the position of each item and placing them manually using calculated coordinates, | |
// this calculates the amount of space each item wants to take up, then splits the items into rows that should fit | |
// within the available width. | |
// Then, the views are distributed into rows, made up of an HStack for each row inside a VStack. | |
// | |
// This seems non-conventional, but I was having trouble getting the frame of my top-level view to be respected when returning |
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
// | |
// ContentView.swift | |
// DeleteMe | |
// | |
// Created by Chris Eidhof on 02.02.21. | |
// | |
import SwiftUI | |
/* |
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
ditto -ck --sequesterRsrc --keepParent `ls -1 -d -t ~/Library/Developer/Xcode/DerivedData/*/Build/Products/*-iphonesimulator/*.app | head -n 1` path/to/YourApp.zip | |
## https://developers.facebook.com/docs/ios/getting-started/advanced |
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
extension UIImage { | |
func fixedOrientation() -> UIImage { | |
if imageOrientation == UIImageOrientation.Up { | |
return self | |
} | |
var transform: CGAffineTransform = CGAffineTransformIdentity | |
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
let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] | |
extension Array { | |
func splitBy(subSize: Int) -> [[Element]] { | |
return 0.stride(to: self.count, by: subSize).map { startIndex in | |
let endIndex = startIndex.advancedBy(subSize, limit: self.count) | |
return Array(self[startIndex ..< endIndex]) | |
} | |
} | |
} |
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
/* | |
* Copyright (C) 2014 skyfish.jy@gmail.com | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
A warning occurred (42 apples) | |
An error occurred |