A list of presenters at the Brooklyn Swift Developers Meetup with links to videos, slides and source code: http://www.meetup.com/Brooklyn-Swift-Developers
Taiki Suzuki - Flux & MVVM (Video)
Harlan Kellaway - Should Code Always be DRY? (Video)
A list of presenters at the Brooklyn Swift Developers Meetup with links to videos, slides and source code: http://www.meetup.com/Brooklyn-Swift-Developers
Taiki Suzuki - Flux & MVVM (Video)
Harlan Kellaway - Should Code Always be DRY? (Video)
import UIKit | |
extension UIImage { | |
func resizeWith(percentage: CGFloat) -> UIImage? { | |
let imageView = UIImageView(frame: CGRect(origin: .zero, size: CGSize(width: size.width * percentage, height: size.height * percentage))) | |
imageView.contentMode = .scaleAspectFit | |
imageView.image = self | |
UIGraphicsBeginImageContextWithOptions(imageView.bounds.size, false, scale) | |
guard let context = UIGraphicsGetCurrentContext() else { return nil } |
App Store Review Guidelines | |
Introduction | |
Apps are changing the world, enriching people’s lives, and enabling developers like you to innovate like never before. As a result, the App Store has grown into an exciting and vibrant ecosystem for millions of developers and more than a billion users. Whether you are a first time developer or a large team of experienced programmers, we are excited that you are creating apps for the App Store and want to help you understand our guidelines so you can be confident your app will get through the review process quickly. | |
The guiding principle of the App Store is simple - we want to provide a safe experience for users to get apps and a great opportunity for all developers to be successful. We do this by offering a highly curated App Store where every app is reviewed by experts and an editorial team helps users discover new apps every day. For everything else there is always the open Internet. If the App Store model and guidelines are not best for your app or business idea th |
It has been brought to my attention that there was more use for the unintended values()
functionality that I had outline in my "Other Languages" Java example below.
On the Swift Evolution mailing list, one developer outlined their requirement to loop through an array of enum
case values to add different states to objects.
Another example where a values
array would be useful if the developer wants to do something different for each different case, such as setting an image on a UIButton
subclass for each different UIControlState
// 打印按钮的action及其target | |
function actionWithTargets(button) { | |
var allTargets = [button allTargets].allObjects(); | |
if (!allTargets) { | |
return "is not a uicontrol" | |
} | |
var allShow = []; | |
for (var i = 0; i < allTargets.length; i++) { | |
var target = allTargets[i]; | |
var actions = [button actionsForTarget: target forControlEvent: UIControlEventTouchUpInside]; |
import Foundation | |
let date = Date.now | |
date.formatted(.iso8601) // "20210618T191800Z" | |
date.formatted(.iso8601.year().month().day().dateSeparator(.dash)) // "2021-06-18" | |
date.formatted(.iso8601.dateSeparator(.dash).timeSeparator(.colon)) // "2021-06-18T19:18:00Z" |
Hello, I’ve been working on implementing, optimizing, and improving String in preparation for ABI stability, and I thought I’d share the current status of String in Swift 5 and some potential directions to go. This is the product of conversations with open source contributors and my colleagues on the Swift standard library team at Apple.
The primary area of focus is stabilizing String’s ABI, but we’d be remiss if we couldn’t also fit in performance and ergonomic improvements. String’s ergonomics in particular is one area where we think the status quo is woefully inadequate, and over half of this email is devoted to that topic. At the end, there’s a section about a community initiative that we hope can help users of String as well as guide future development.
(Note: I’m sending this to swift-dev because much of the contents revolve around implementation concerns. I’ll also cross-reference on swift-evolution and swift-users. See also the [StringManife
// | |
// AppDelegate.swift | |
// Scheduling | |
// | |
// Created by Shaps Benkau on 19/02/2018. | |
// Copyright © 2018 152percent Ltd. All rights reserved. | |
// | |
import UIKit |