This mini guide has been moved to here.
This file contains hidden or 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
## chmod +x this.file | |
#!/bin/bash | |
# install xcode command tool | |
xcode-select --install | |
# check | |
xcode-select -p | |
# install xcode from xcode-install |
This file contains hidden or 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
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.2/ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport/6.1/ /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/AppleTVOS.platform/DeviceSupport/13.2/ /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/DeviceSupport |
This file contains hidden or 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
//: Playground - noun: a place where people can play | |
// | |
// The result is not guaranteed to be accurate. Typically, the function requires 200-400 characters to reliably guess the language of a string. | |
// Reference: [CFStringTokenizerCopyBestStringLanguage(_:_:)](https://developer.apple.com/reference/corefoundation/1542136-cfstringtokenizercopybeststringl) | |
// | |
import Foundation | |
extension String { | |
func guessLanguage() -> String { |
This file contains hidden or 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 { | |
func isPossiblyVisible() -> Bool { | |
guard isHidden == false, | |
alpha > 0, | |
bounds != .zero, | |
let window = window, // In a window's view hierarchy | |
window.isKeyWindow, // Does not consider cases covered by another transparent window | |
window.hitTest(convert(center, to: nil), with: nil) != self | |
else { return false } |
This file contains hidden or 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
import StoreKit | |
//extension SKError: Error { } // Uncomment this line to make it throwable | |
func throwError() throws { | |
throw SKError.unknown // Can not be thrown. Thrown error code type 'SKError.Code' does not conform to 'Error' | |
} | |
do { | |
try throwError() |
When people install an app from the App Store, they want to feel confident that it’s safe to do so—that the app doesn’t contain upsetting or offensive content, won’t damage their device, and isn’t likely to cause physical harm from its use. We’ve outlined the major pitfalls below, but if you’re looking to shock and offend people, the App Store isn’t the right place for your app.
- 1.1 Objectionable Content Apps should not include content that is offensive, insensitive, upsetting, intended to disgust, or in exceptionally poor taste. Examples of such content include:
- 1.1.1 Defamatory, discriminatory, or mean-spirited content, including references or commentary about religion, race, sexual orientation, gender, national/ethnic origin, or other targeted groups, particularly if the app is likely to humiliate, intimidate, or place a targeted individual or group in harm’s way. Professional political satirists and humorists are generally exempt from this requirement
This file contains hidden or 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
# Updated for SwiftLint 0.29.2 | |
# See all rules: https://github.com/realm/SwiftLint/blob/master/Rules.md | |
opt_in_rules: | |
# Opt-in (Default Disabled) | |
- anyobject_protocol | |
- array_init | |
- attributes | |
- closure_body_length | |
- closure_spacing |
This file contains hidden or 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
// An (useless) example of Swift 4.2 @dynamicMemberLookup attributes. | |
// let color1 = HexColor().cbcbcb | |
// let color2 = HexColor().000000 // This can also be built. Will be treat as "000000" | |
import Foundation | |
@dynamicMemberLookup | |
struct HexColor { | |
subscript(dynamicMember member: String) -> UIColor? { | |
do { |
This file contains hidden or 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 tracker = Tracker() | |
// Which one do you prefer? Consider labels, indendentation, readability... | |
// 1 func trackEvent(_ event: Event, _ parameters: EventParameter...) | |
tracker.trackEvent(.viewItem, | |
.itemId("12345"), | |
.itemName("An Item"), | |
.list("List name")) | |
// 2. func track(event: Event, parameters: EventParameter...) | |
tracker.track(event: .viewItem, parameters: |
OlderNewer