Concept | Flutter | Jetpack Compose |
---|---|---|
Vertical Layout | Column | Column |
Horizontal Layout | Row | Row |
Stacking Layout | Stack | Box |
Flexible Space | Expanded | Spacer |
Text Display | Text | Text |
Text Style | style: TextStyle | style (TextStyle) |
Text Color | style: TextStyle(color: ...) | color |
Button | ElevatedButton, TextButton | Button |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
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
// MARK: Multiple Tappable Links in a UILabel | |
extension UITapGestureRecognizer { | |
func didTapAttributedTextInLabel(label: UILabel, inRange targetRange: NSRange) -> Bool { | |
// Create instances of NSLayoutManager, NSTextContainer and NSTextStorage | |
let layoutManager = NSLayoutManager() | |
let textContainer = NSTextContainer(size: CGSize.zero) | |
let textStorage = NSTextStorage(attributedString: label.attributedText!) | |
// Configure layoutManager and textStorage |
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 UIView { | |
private var viewInfo: String { | |
return "\(classForCoder), frame: \(frame))" | |
} | |
private func subviews(parentView: UIView, level: Int = 0, printSubviews: Bool = false) -> [UIView] { | |
var result = [UIView]() | |
if level == 0 && printSubviews { | |
result.append(parentView) |
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
// | |
// UIAccessorizedTextField.swift | |
// AccessorizedTextField | |
// | |
// Created by Damien Laughton on 28/03/2018. | |
// 2018 Mobilology Limited. No rights reserved. | |
// | |
import Foundation | |
import UIKit |
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 UITabBar { | |
override public func sizeThatFits(size: CGSize) -> CGSize { | |
super.sizeThatFits(size) | |
var sizeThatFits = super.sizeThatFits(size) | |
sizeThatFits.height = 71 | |
return sizeThatFits | |
} | |
} |
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
[merge] | |
keepBackup = false | |
tool = custom | |
[mergetool "custom"] | |
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$PWD/$BASE" "$PWD/$REMOTE" "$PWD/$LOCAL" "$PWD/$MERGED" | |
keepTemporaries = false | |
trustExitCode = false | |
keepBackup = false |
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
#!/usr/bin/env sh | |
# checks to see if running | |
launchctl list | grep mongo | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist | |
launchctl remove homebrew.mxcl.mongodb | |
pkill -f mongod |
Install HomeBrew first
brew update
brew tap caskroom/cask
brew install brew-cask
If you get the error "already installed", follow the instructions to unlink it, then install again:
NewerOlder